Junk code

I can make programs that work no problem. But unfortunately most of my code is junk code. I write 20 lines of code that could probably be done in 10. Are there any general tips that decrease the amount of lines taken up in my programs. I'm just so sick of knowing that i could do something a better way but not being able to think of what it is.
Any help is appreciated.

Thanks in advance.


[b]"To Error is Human"[/b]

Run Time Error

Comments

  • : I can make programs that work no problem. But unfortunately most of my code is junk code. I write 20 lines of code that could probably be done in 10. Are there any general tips that decrease the amount of lines taken up in my programs. I'm just so sick of knowing that i could do something a better way but not being able to think of what it is.
    : Any help is appreciated.
    :
    : Thanks in advance.
    :
    : [b]"To Error is Human"[/b]
    :
    : Run Time Error
    :

    Maybe if you post some examples (Pascal, if it's possible, or not to complicated C



  • i find the best way to improve the efficiency of your code is to do alot of it. especially large and complex programs where you quickly find that sloppy code becomes a major pain to debug.

    i remember when i was first learning to program, i started writing a chess program. i knew all the theory of that kind of game programming but my lack of experience prevented me from getting very far. however, three attempts later (and about 5 yrs) i managed to make a pretty decent chess engine that was fairly easy to understand.

    dont worry about not being able to think of the best way to do something. that will definitely come with experience. but this experience will only come if you enjoy punishing yourself :)

    of course i have no idea how old you are or how much experience youve already had, so i could be speaking out of my ass right now :)

  • : of course i have no idea how old you are or how much experience youve already had, so i could be speaking out of my ass right now :)
    :

    I don't have too much experience. Just enough to write a decent dos program. I guess I just have to follow that old philosophy. "Do stuff, repeat"

    Thanks for your help.


    [b]"To Error is Human"[/b]

    Run Time Error


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories