10

Im argueing with my friend if this is legacy or not. Please reply

Comments
  • 0
    @chasb96 yeah, actually ur rigth... Maby i should host it on github
  • 1
    Damn it's legacy !
  • 1
    @Vikram shit. Guess illtake it... 1 to 0 4 my friend
  • 0
    @Vikram what could i imrpove??
  • 2
    @linuxer4fun The indentation would be a good start!
  • 1
    So... much.. nested.. conditional logic
  • 1
    @Wildgoose indentation is what? Sry, im german :)
  • 1
    Is that a BASIC variant? It's hard to tell...
  • 0
    @nmunro no, its pascal
  • 0
    @linuxer4fun Indentation is additional spaces at the beginning of a line to visually show program structure.

    Two important points.

    It should be rigidly consistent, e.g. If you use 4-space indentation then a block that is on the third nesting level should have exactly 12 spaces before the start of a statement.

    (Studies show that indentation should be between 2 and 4 spaces to be optimal).

    Secondly, it should be kept to a minimum.

    Deep nesting is a sign there may be something wrong with the design of the program.

    A related point is the recommendation to keep your line lengths with a maximum length of 80 characters. You can't do this cleanly if your indentation is too great.
  • 0
    @Wildgoose but i use tab, is it ok too?
  • 0
    @linuxer4fun I set TAB to emit 4 spaces. The problem with TABs is that they don't align nicely with spaces when people have different settings.

    They're also typically 8 chars wide which is far too many.
Add Comment