View Single Post
Old 24 August 2015, 23:34   #304
AMOS Extensions Developer
Lonewolf10's Avatar
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 37
Posts: 1,831
Originally Posted by idrougge View Post
Once you get used to curly braces (and learn to type it if you have a non-English keyboard), they may seem simple enough, but they also take some effort for the brain to decode.
Agreed. Although I haven't used any programming languages (as such) that use curly braces, the script that is used to describe scenes in POVray (PC software) does.

Originally Posted by idrougge View Post
I had my doubts about trying to teach a beginner programmer the art of Python indentation, but I think I've come to the conclusion that it makes sense. C programmers tend to indent their blocks as well, even though they have their braces, so why do both when one will do?
I always indent my BASIC code (for the languages that allow it, which is most modern BASIC languages) where appropriate. For example...

For Y=0 to 250
    For X=0 to 319
        MYCOLOR=INT((X/50)+10+(Y*50)) Mod 16
        Plot X,Y,MYCOLOR
    Next X
Next Y
I usually only indent between instructions like While... Wend, If... Endif etc.
Lonewolf10 is offline  
Page generated in 0.05103 seconds with 9 queries