Thread: Better way

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    22

    Better way

    What do you suggest as the better practice when coding a program?

    1.Figure out absolutely every little detail about the functioning of structures, classes, and functions, that goes inside the program before starting to code. Write down all those things, and start to write the program as the paper says.

    OR

    2.First only think of the basic functioning of the program and start to build structures and functions in a basic way. While the work in progress, decide all the small details that should be included in structures and functions. (I feel that this way is easier)

    - Kasun

  2. #2
    Registered User Ajsan's Avatar
    Join Date
    Dec 2003
    Posts
    55

    less is more

    the less that you have figured out about your programming the more that you will inevitably have to recode.

    while putting in basic structures and then changeing and adapting them might be easier it would be faster to know what your going to do before you do it and only be making minor changes to that plan as your program nears completion.


    if that doesn't help with anything i'm sry.
    Style is overrated.

    - —₽‚¢‰Î -

  3. #3
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    this has been covered before...so do a search,

    I personally figure most everything out on paper, and design my class interfaces first. Then its everything else. If you have a proper algo and know what to do, this method shouldn't fail

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    You should have a pretty good idea of what you can and cannot do without actually doing it, so I write all the class and function definitions, write the central portion of my program (main function) and then go and code in all the interfaces, etc..

  5. #5
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    How about design the simplest system possible that would work. That way you can figure out the details completely without getting overwhelmed. For example, only design with the most critical functionality in mind, then once that is working you design lower priority functionality and integrate it in the next release.

    This would be a combination of both 1 and 2.
    My best code is written with the delete key.

  6. #6
    Registered User
    Join Date
    Sep 2003
    Posts
    135
    Having done some initial design, you should be able to code and test a class in isolation before using it in your application.

    Being able to define everything in fine detail is certainly one approach; these days, particularly with OO, an iterative approach is perhaps more common.

  7. #7
    vae victus! skorman00's Avatar
    Join Date
    Nov 2003
    Posts
    594
    It's 6am, so his name escapes me, but one of the creators of C once said "Debugging is twice as hard as coding. Therefore if you code as cleverly as possible, you are by definition unable to debug your own code."

    Just an amusing quote that I liked.

  8. #8
    Registered User
    Join Date
    Sep 2003
    Posts
    135
    Originally posted by skorman00
    It's 6am, so his name escapes me, but one of the creators of C once said "Debugging is twice as hard as coding. Therefore if you code as cleverly as possible, you are by definition unable to debug your own code."

    Just an amusing quote that I liked.
    A quick search on Google threw up:

    “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” – Brian W. Kernighan

Popular pages Recent additions subscribe to a feed