Re: Learning Code...Fast

(At the recommendation of a colleague I'm posting this here as well,

> after posting to comp.programming.) > > I've been given an opportunity to start on a 100,000 line, C++ > software project that uses a nearly obsolete toolkit >
formatting link
and is, shall we say, "leanly" > documented. The pay raise would be nice, but the new job would require > that I be able to bring a new project to market in as little time as > possible. > > I should mention that it's an embedded systems project, so there are a > lot of magic numbers, memory addresses and hardware intricacies > sprinkled throughout the code. That may be the toughest part. As for > the project being in Zinc, it's a pretty readable format. (If the > dice of history rolled a little differently we might have all been > using Zinc instead of Java, but that's a topic for a different day.) > > The first thing that I may have to do would be to write the project > documentation, if only for my own sanity. But other than staring at > code from morning till night day after day, are there any other tips > and tricks that experienced programmers have found to help get them up > to speed on a project quickly? > > Thanks in advance, > Dan McCarty

Given an opportunity? Surely there are better things to do with your life than slave over 100,000 lines of obscure code. Experienced programmers either find interesting work or switch careers. Leave this one for someone who has a financial stake in it, or for some brain-dead drone. Move onto something real.

-- Joe Legris

Reply to
Joe Legris
Loading thread data ...

Why do you think this would not be interesting work? (leaving aside the fact that the OP clearly stated that he does have a financial stake in it.)

--
Al Balmer
Balmer Consulting
removebalmerconsultingthis@att.net
Reply to
Alan Balmer

What gives you the idea we're all using Java?

Furthermore, experienced programmers work where they work for any number of reasons besides interesting work. Like benefits, working hours, money, nearby skiing, cute coworkers and freedom from PHB's

Reply to
Jim Stewart

By financial stake I meant a profit/loss sharing potential. It's a great way to make an onerous task look interesting.

Let's see now - 100,000 lines of old code, no documents, unrealistic schedule. The silver lining - the opportunity to discover some subtle bugs, which then become your problem. Which part of it excites you?

-- Joe Legris

Reply to
Joe Legris

Before touching one line of code, ensure you have the complete tool chain to recreate the original, and to check that the result is bit for bit identical. Only after that can you afford to revise the source and tool chain.

Then do cosmetic revisions on the source. The thing that stands out is the 'magic numbers'. There is no reason for these, they should be properly defined with meaningful names. Such things as consistent indentation and naming conventions can be inserted here. These revisions can be checked for identical binary outputs.

If it doesn't exist, build a regression tester that can be easily and automatically run.

Now you are ready to make real progress rapidly. The up front work will pay off, and you will find yourself able to make bolder and bolder revisions as your understanding increases.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

Unless *you* get to decide what the word "possible" in that sentence is supposed to actually mean, accepting that job would appear suicidal, to me.

"so there" implies the latter is a direct consequence of the former. Mildly speaking, that's not exactly correct. Just because it's an embedded system doesn't mean the code must be crap.

There are tools designed to help with that. Automatic source code analyzers that let you visually inspect the structure of the project. RedHat Source Navigator would be one such tool worth trying, as long as the actual source code is still parseable as C++.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

As others have pointed out, timescale may be the biggest problem for you. These sort of things take as long as they are going to take. Offer no hard promises of when the end date might be as it will all depend on the quality of what you are inheriting (which, if documentation is lacking may be dubious).

There is no doubt but the first thing you will start doing is assembling whatever your detective work can find by way of real documentation. This means you finding the hardware data sheets, schematics, user manuals, any design notes that may still be around etc. You should also find the original compiler toolchain and recomp[ile the sources you find to ensure they are complete. If you can compile the whole lot then compare with the binary of a working unit (which I trust you will also have access to).

One other poster mentioned establishing a "war room" where you can hang the printed listings of the code and mark it up as you find out things. If the originalk author of this code has used a lot of magic numbers then put them in either a named constant of clearly identify them with a named definition of what they represent.

Don't forget, for your own sanity and the benefit of your paymasters, to establish a review process by which you can be assured that your efforts are progressing in the right diorection and they can see how the project progresses. This way they will usually wear longer timescales if they see progress being made but no way of helping to speed ity up.

Good luck if you accept the challenge.

--
********************************************************************
Paul E. Bennett ....................
Forth based HIDECS Consultancy .....
Mob: +44 (0)7811-639972 .........NOW AVAILABLE:- HIDECS COURSE......
Tel: +44 (0)1235-811095 .... see http://www.feabhas.com for details.
Going Forth Safely ..... EBA. www.electric-boat-association.org.uk..
********************************************************************
Reply to
Paul E. Bennett

I just meant that those who do use Java might be using Zinc instead. But I'll save it for alt.history.what-if.

Reply to
Daniel McCarty

I saw Zinc library in early '90. It was a rather impressive library of primitives for creating user interfaces under DOS (C compiler was not included). How could that library be possibly used as a programming language eludes me.

Vadim

Reply to
Vadim Borshchev

I didn't mean that one implies the other. I happen to have seen the code! ;-)

Reply to
Daniel McCarty

Absolutely, positively, and beyond a shadow of a doubt, the most valuable tool I have used in these types of situations is "Understand for C/C++" by Scientific Toolworks, Inc.

formatting link

I was introduced to it a few months ago on a 500K-line C program as a contractor/consultant and found it *so invaluable* that I (how's that electric shaver commercial go?) bought the product for my own toolchest for those other clients that dump their code on me and ask "how long will it take you to ________?". Now I have a tool that give me much more confidence in my Rough Order of Magnitude estimates for performing modifications without breaking something else.

[I'm only a happy customer, nothing more.]

-- Dan Henry

Reply to
Dan Henry

I have used this tool as well, and can also recommend it. It is also great for generating piles of documentation to keep certain types of QA people happy. (Here in South Africa there is a tendancy to use people who are useless at anything else for QA) It of course can also be used to generate very usefull documentation as well - hyperlinked to the actual source etc.

Regards Anton Erasmus

Reply to
Anton Erasmus

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.