4 ms·
I hate python because of the indentation. I know it's stupid, but I hate it.
by madshiva 9y ago
I hate python because of the indentation. I know it's stupid, but I hate it.
- peatmoss 9y agoI sort of view it as a weak form of how (some) people hate the way parentheses work in lisps. It's a superficial detail that causes a subset of people to see red. The difference is that in lisp / scheme / clojure, once the brain-bit gets flipped, parentheses become an amazing asset. Python's whitespace, on the other hand, only ever becomes not-a-big-deal. I'm not a fan on conceptual grounds, but I rarely run into issues with it (emacs keeps me good here). But I'm pretty sure Python's whitespace offers no enlightenment for my nominal troubles.
- marcosdumay 9y agoIt avoids hearthbleed style bugs. That's not a small thing. The biggest issue I once had with semantic white space was that demanded convoluted rules and imposed itself into the syntax like in the single line lambdas case... But then Haskell has none of those problems.
- bhaak 9y agoDon't you mean the goto fail by Apple? That blocks are syntactically correct if it's just one statement is one of the worst design decision of C-like languages. I thought Heartbleed was just a over-read of data and had nothing to do with parentheses and indentation. I also always thought I disliked white space indentation and then I used it with coffeescript. Apparently I just don't like Python.
- sametmax 9y agoIt's not stupid, it's taste. I have ruby for having "end". It's just taste. I like Python because it forces people to write well indented code. I worked with too many pigs.
- jacquesm 9y agoNo, it goes beyond taste. The inability to reliably cut-and-paste example code and the total mess you get when people have combined spaces and tabs which could result in ambiguous code is a danger that could have been side-stepped quite handily. It's like driving on the autobahn without guardrails. You may only need them once or twice in your life and yet, you're happy the guardrails are there. Just in case. Allowing both tabs and spaces was simply a mistake but it is too late to turn the clock back on that now. http://wiki.c2.com/?PythonWhiteSpaceDiscussion http://wiki.c2.com/?PythonWhiteSpaceDiscussion In general, significant whitespace isn't fantastic but at least now we have widespread version control which helps in case of accidental deletion/insertion of a space or a tab or a newline.
- pmontra 9y agoYes, but having to do a git diff to verify if I refactored a function correctly is telling about the shortcomings in the design of the language. Indentation should be left to the editor: RETURN starts a line at the correct indentation level (one more after a : ) and anything convenient to decrease indentation (example: TAB TAB in emacs) This is my major pain point with Python. No code blocks as arguments and single line lambdas are the second one. And those underscore looks so 80s, but that's when van Rossum started designing Python. Same thing for the self argument in method definition: it's the pointer to the struct holding the function pointers and instance variables in object oriented C (without ++). On the other side object = ClassName() is more convenient than object = ClassName.new # Ruby object = new ClassName(); // Java
- sametmax 9y agoEditors have nothing to do with this. You have dirty coders everywhere on the net. Having to edit a bit a code you copy paste from an badly formatted source (which you should do anyway for safety) is a small price to pay to avoid all the dirty coders in the world to write blocks with a showel.
- pmontra 9y ago
- wvenable 9y agoI don't mind it but I worked on a personal Python project last weekend and it was a random guess whether or not a particular piece of open source code used tabs or spaces.