Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: A note for all programmers  (Read 20333 times)

0 Members and 1 Guest are viewing this topic.

Dilbert

    Topic Starter
  • Moderator


  • Egghead

  • Welcome to ComputerHope!
  • Thanked: 44
    A note for all programmers
    « 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.
    "The geek shall inherit the Earth."

    fffreak



      Adviser

    • That's right I am a final fantasy freak.
    • Thanked: 3
      • Yes
      • JSPCRepair
    • Certifications: List
    • Experience: Guru
    • OS: Windows 7
    Re: A note for all programmers
    « 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
    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
    Re: A note for all programmers
    « 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:)

    Computer Hope Admin

    • Administrator


    • Prodigy

      Thanked: 248
      • Yes
      • Yes
      • Yes
      • Computer Hope
    • Certifications: List
    • Computer: Specs
    • Experience: Guru
    • OS: Windows 10
    Re: A note for all programmers
    « Reply #3 on: May 23, 2008, 08:36:50 PM »
    Locking topic to prevent new questions from being asked in this thread.
    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