News Focus
News Focus
Followers 29
Posts 21460
Boards Moderated 4
Alias Born 10/29/2000

Re: PMS Witch post# 17496

Saturday, 10/12/2002 8:30:12 PM

Saturday, October 12, 2002 8:30:12 PM

Post# of 222452
My point is this: one must be vigilant in choosing the correct library functions because they can often impact a program's performance profoundly. With my anagram solver, changing the code to use pointers cut execution time by one second. However, selecting different library functions to read my dictionary file cut execution time by twenty-two seconds. (Less than half.)

Good point... especially when it comes to io functions... that's usually where I find I can make the biggest improvements in performance. The other thing is loading often used data into memory.

Imagine debugging a few thousand lines of code that looks like this! I'll digress here, but I once worked with a guy whose code was filled with comments like "Guess what this does." and "I forgot how this works."

That's scary. It may be okay in one guy operation, but in a larger shop, comments are important and helpful to the next person looking at your code... or even to myself looking at it a couple years later. One guy I work with is the worst... very cryptic code with unnecessary complexity and few comments. It's a headache trying to figure out what he's doing.

I love the compactness of C/C++ but also try to make it readable and understandable to someone else. This comes from years of working in shops of 100+ programmers where they are not all the sharpest tools in the shed.



Sara

Go Giants! Go 49ers!

Sara

"I never give them hell. I just tell the truth and they think it's hell." - Harry Truman

Trade Smarter with Thousands

Leverage decades of market experience shared openly.

Join Now