Yuri wrote:
barnacle wrote:
Some people have very strong opinions...
I would expect that the notion of TABs vs. Spaces and indention levels (or not at all) or if/when to move those braces around has start a good number of religious wars over the years.
TABs (OCCAM, Python, Makefiles), (* ... *) Old BCPL, Braces (C, Modern BCPL, Ratfor, etc.), Begin/End (Algol, Pascal etc.) Start/Finish (imp77) and what not. Something is needed in a structured programming language where blocks of code extend over multiple lines. The holy war here is where do you place them - on the same line, line below at the same indent level, or line below indented. Personally I like my {}s aligned vertically under the controlling statement with the code indented, but 40+ years ago spaces cost both disk space and compile time so removing spaces, using TABs and putting them (begin/end, etc.) on the same line made sense...
Quote:
One of my primary gripes about Python is that it forces you to indent, and heaven forbid you don't do it the way the interpreter wants you to, or you get a TAB mixed up with a space or something.
Indentation is to replace the block start and end constructs. See above. Also; Programmer are lazy - why type BEGIN or use a { when you can just hit the TAB key...
Quote:
'cause you know, it's EASY to see when you have a TAB vs a few spaces in your text editor, right?
Why yes, it is. My editor of choice (vim) makes it very easy and even keeps the indentation. I can bind a key to a command that turns it on or off. I'm sure Emacs can do the same.
Note: I'm not a Python programmer - I really don't get it, but I do get the need for some sort of structure in our coding. I was taught that computers should make our lives easier - so in this case, the Python system ought to be able to work out the indentation level based on either spaces OR TABs OR any mixture of the 2 - but seemingly it doesn't. A failing IMO. It's a handful of lines in my own editor to de-tab a file - why can't python do that for you?
My own editor replaces TABs with spaces and the TAB key means:
Take the cursor to the column position under the last non space character on the line above, OR move 2 spaces. It floats my boat.
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/