cpp->setStatus( DONE );

Finally! After half year since I bought my C++ book), I’m ready to “graduate” from that section of my roadmap and proceed to the next. I actually finished reading the book a few weeks back, but due to the hustle and bustle of January festivities, I really didn’t have the chance to get some closure, so to speak. And I thought of doing a C++ project as the perfect closure. I wanted something not overly complicated, yet complex enough to showcase and test what I’ve learned, as well as pick up a few things about the software development process. In the end, I just decided to do a very simple addressbook program named Rolodeks. My code is in here along with my first manually-made Makefile and a tarball version of the whole thing. (Please be kind, it’s my first ever serious app project :P ) Along the way, I noticed/realized a few things:

1. I suck at OOAD. (Object-oriented Analysis and Design). While I know the technical aspects of creating a class, I didn’t really know how to design one. I kept on asking myself again and again, should this be private, public, or protected, should I provide a setter/getter for this, etc. I guess one of the things lacking in my book is the integration of problem analysis and design into some of the example problems. I had this old C book (Hands-on Turbo C by Larry Joel Goldstein and Larry Gritz) that did just that. Even just the basics of designing classes would probably do a lot for a beginner to C++. In fairness, my book does have a sort of discussion about OOAD, but presented as a sort of add-on, rather than an important part of the process.

2. Nothing beats experience. Even if a book contained all the information and theory on software development, it still wouldn’t compare to the actual experience of writing code. Unfortunately, for months I leaned more towards the “I need theory first” excuse for procrastination, thinking that theory will properly equip me with the necessary arsenal to tackle any problem. Fortunately for me, Sho has always been there to knock some sense into me (I owe so much in that area that I should probably dub him as my Vox Rationis). Thing is, you need theory too, but it’s only half the story. Theory is nothing without practice, as they say. You can’t possibly learn everything through just reading programming books. At some point, you’ll need to apply that by actually writing code. Then, along the way, you’ll realize stuff that you haven’t really learned well enough or not learned at all. Then it’s time to learn about those. It’s a cycle. It’s a process. Either way, it needs to get started first.

3. KDevelop is… I really don’t know what to say about it. Touted as one of the best C++ IDE’s on Linux, I was really eager to give it a try. I didn’t use it while I was still learning because I thought it would overkill at that time, when my exercise programs spanned 3 files at most (main.cpp, Class.h, Class.cpp for example). But when Rolodeks grew to around 3 classes, I thought it was time to try it out. KDevelop is overwhelming, was my first and instant reaction. Unfortunately, it didn’t get better for me. For one, it’s Project system forced me to create C++ projects that used Autotools or CMake. I couldn’t just create a project with all files grouped together or let me use my own Makefile. In fact, KDevelop doesn’t even let you compile a single file C++ program at all. I might have missed some things though, since I haven’t read the KDevelop docs, but suffice it to say, I was pretty disappointed. Luckily, Kate is wonderful for what it is, and advanced text editor. With a few plugins, I was able to convert it to a mini-IDE, complete with a Makefile plugin. Although it’s still missing debugger plugins. Maybe I’ll have better luck next time.

Up next: Qt! And hopefully more exciting and worthwile software project. :D

Leave a Reply