Home / Other / FAQ solutions database / Software / Programming / A note for all programmers
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] - (Bottom) Print
Author Topic: A note for all programmers  (Read 7996 times)
Dilbert
Topic Starter
Moderator
Egghead



Thanked: 40
Posts: 3,480

Welcome to ComputerHope!

« on: February 18, 2007, 12:27:10 AM »

Everyone who is on a large-scale project can benefit from this simple, yet amazing advice. It's the best way to make sure your code works. It can be summed up as follows:

Work on a portion of your project. Comment thoroughly why each code block exists. Then, check back in a week.

Why? As you are writing your code, everything makes sense to you. Your train of thought is fresh and you don't forsee any errors. However, after about a week or so of not touching your code, the patterns you formed in your brain as you wrote begin to diminish. By the time you return to your code, you are looking with the critical eye of someone who never saw this code before.

Novelists have the same problem: Everything makes sense to them, but nobody else understands it. Then, the author re-reads the passage and says: "Wait. I was trying to say [insert point here]". Then, s/he rewrites it more clearly. This is a good strategy to implement when writing code.

The larger the project, the more you can benefit from this. As I type, I am checking about a thousand lines or so of code. I need my comments; otherwise, it's incomprehensible. Even so, I'm finding tons of things I did that were redundant, prone to error, or just plain wrong altogether.

Of course, those who do programming for a career can't just tell their boss they're taking a week off to "de-familarize yourself" with the project. But that's what teams of programmers are for: To help watch for errors. This advice is better suited for the solo programmer.
IP logged

"The geek shall inherit the Earth."
fffreak
Adviser



Thanked: 3
Posts: 824

Experience: Guru
OS: Windows XP
That's right I am a final fantasy freak.

JSPCRepair 1
« Reply #1 on: February 26, 2007, 07:27:00 PM »

Also be sure to compile your code every now and then to make sure there are no, compile errors, and syntax errors. That way when the project is completely finished all you have to worry about are the run-time errors.

8-)fffreak
IP logged

Computers are the future, not us. Learn everything you can about them while you still can, soon they will be learning about us... Every bit of advice that I give you is best guess, it is your choice whether or not you listen to it.
mirage_servo
Guest
« Reply #2 on: September 22, 2007, 01:06:46 AM »

@fffreak

its a good idea to compile your code now and then but this would eliminate the competitiveness of the coder, but im not suggesting the other way around, its just it would look like a trial and error basis, but in the long run, compile the code if you want the results at hand.

@Dilbert

good, a very good idea for new programmers

@spiderlucci

you have to create a new thread for this to make sure you have prompt reply, this would give irrelevance to the topic at hand.

thanks to all

no flames just directions:)
IP logged
Computer Hope Admin
Administrator
Prodigy



Thanked: 210
Posts: 6,065

Certifications: List
Computer: Specs
Experience: Guru
OS: Windows Vista

Computer Hope 1 1 1
« Reply #3 on: May 23, 2008, 08:36:50 PM »

Locking topic to prevent new questions from being asked in this thread.
IP logged

Everybody is a genius. But, if you judge a fish by its ability to climb a tree, it will spend its whole life believing that it is stupid.
-Albert Einstein
Pages: [1] - (Top) Print 
Home / Other / FAQ solutions database / Software / Programming / A note for all programmers « previous next »
 


Login with username, password and session length

Old Forum Search | Forum Rules
Copyright © 2010 Computer Hope ® All rights reserved.
Powered by SMF 2.0 RC3 | SMF © 2006–2010, Simple Machines LLC
Page created in 0.107 seconds with 22 queries.