New Programmer Job

Hi all!!

Nice to be here, I have joined a Software corp recently as a programmer, the thing is that I am not very familiar with C++, my manager wants me to review the code left behind by the previous guy and maybe work on it later, right now my responsibilities are very obscure, but I have a hunch that I will need to really understand the code left by my predecessor, he was a pretty competent guy; although there aren't many comments and statements in the code from what I've seen so far, and I need to understand it before the axe falls on me, so what do you guys think is the right way to go about it, I think that I will just read the code line by line and refer online to anything I don't understand and hope I make it.
Any suggestions?? :-)

–Thanks.


How about letting some of us help you with it? This is a C++ help forum. This site also has plenty of information on the language. You should be able to get access to any information you need.
You should have on the job training to gain experience
@Browni3141

Thanks for that very considerate reply, the application that I'm studying accepts two input files/directories and generates a report of comparison, it has a Python GTK-UI to run the app. If you somehow understand the requirement here, how would you advise me to proceed?
The problem if probably too difficult for me myself to help you with, but if you give more specifics others may take up the challenge. It would help to see the specific piece of the code that is causing difficulty.
Reading it line-by-line, file-by-file is the wrong approach, at least in my experience.

My method: Work down the dependency tree.

(Start at the entry point of the program)
Read through the function line by line until you come to a class instantiation / function call.
If you doesn't have any idea what it could be doing / mean, go read it.
If you can sort of get the idea of what it does from the name / any documentation go on.
Once you've finished reading the part in question, go on to all of the things that it uses that you haven't looked at yet.
Once you've read down the tree completely, look at anything that's left over.

Basically, do a depth first traversal of the code where you don't know what it's doing, and a breadth first traversal where you can make a good enough guess as to what it's doing.

Should work petty well if it's a well designed code-base. However it doesn't work that well if there's a lot of circular dependency in the code.
@ Stravant
There is a main file and there are 13 other files, these are all the source files, then there's the header files in a separate directory, there is a makefile in the sourcefile dir and there is a python-GTK exe file as well, which when executed starts up a UI based version of the tool. so it can be run from both the terminal as well as the UI. My manager wants me to understand the whole functionality of the UI tool first and then make changes to the code later on. There is not much documentation to understand the UI functionality, so basically I have to read the code and understand the options available in the UI.... and that is causing problems.
Based on my working career, I spent about 75% of my time maintaining legacy code and that is exactly what you are tasked to do. The remaining 25% will be writing new code.

The reason is simple. It is actually more *DIFFICULT* to do maintenance then write new code. In maintenance, we need to spend time studying the code, understand how it works BEFORE we can attempt or dare to do any enhancement on it without breaking existing program functionalities. Let's say you understand already but due to the design of the program, some enhancements can be hard to implement without breaking the existing program design.

That is why a lot of companies is looking for in-house maintenance developers. If you want to do new software development, go for those vendor companies instead as most likely they will bid for new projects and start the software development from scratch.

Doing maintenance and enhancement can be as costly as doing new software development from the company perspective. And sometimes it is hard to convince the top mgmt to re-do from scratch as most likely they would have invested a lot of resources on the existing programs and they want ROI from it !!!
Topic archived. No new replies allowed.