very few programmers outside python don’t indent correctly, so this is pointless.
I don't think the downvotes were from python fanboyism, but from that comment being obviously incorrect. If that's what you've experienced, then you're lucky.
Making teaching easy was a central goal of the ABC language from which Python descended, and is still a central goal in 2018 as witnessed by recent PEP discussions.
You can use a language with curlys != Everyone moves to a language with curlys. Most people in machine learning who use Python stay with Python. R having them doesn't have anything to do with the statement above
If you can't write code with proper indentation unless the compiler interpreter forces you to, you're a moron. This feature is pretty damn pointless on Python, but I like other things about Python.
I always wonder why people feel so strongly about this. I agree, it's easy to get indentation right... so what's the problem? Who cares that it requires you to get the indentation right? Your experience won't change at all if you're not screwing it up.
If I had to rank language design decisions in terms of importance, I think whitespace vs curly braces would be one of the last items on the list. It just happens to be one of the simplest topics to understand which makes gives it a low barrier to entry for absurdly passionate stances.
Only Python coders are so obsessed with indentation. For every other language it's par for the course. Many people replying to me make it seem like Python is a sanctuary of proper indentation, and any code written in other languages is chaos with no indentation at all.
It's not hard at all to get indentation right, and for all the great things about Python, it's strict enforcing of indentation is not one of them.
very few programmers outside python don’t indent correctly
This is far from true. And there isn't even an established 'correct' indentation pattern, it's a style thing. You can easily have several developers indenting according to different styles.
I've seen several different styles of indentation within Python. Tabs vs. Spaces for instance. But when talking about spaces, there's many variations based on the number of spaces.
Of course, Tabs vs. Spaces is a topic of debate in all languages, so that factors out.
Whats left?
Well some people like their opening brace on the same line, like:
someFunction(){
and others like it on the next line:
someFunction()
{
Outside that distinction, braces don't affect coding style at all. Both languages can debate Tabs Vs. Spaces Vs. Number of spaces, so it's moot.
Python is one of many languages I work in, and outside Python I really don't run into problems with indentation. Anyone who thinks non-Python languages have indentation problems has psychosis.
In Java when you have a line length limit for checkstyle, it's not always clear how to indent when you add a newline character to roll over to the next line, so from this alone you can end up with wildly differing indentations.
In Java you could have all kinds of valid indentation for those rollover lines. It gets very messy when you have multiple layers of nested parentheses.
Have you looked at CPAN modules lately? hell look at the majority of javascript even. (Yes "full-stack"programmers are still programmers). Easy to devolve into unread-ability is one of the reasons why most people hate Perl now. (There's a reason why "perlmonks" is literally a thing.).
Braces encourage laziness. How many ajax calls have you seen where it's all crammed in on a single line? I have to deal with that shit every day. If they'd been forced to indent, they would have factored out their nested callback hell ages ago, but here they're content relying on an IDE tracking the number of braces they're inside of.).
Perl is horrible. I don't think braces encourage laziness, at least I've never really seen it. It's not hard to get braces right.
JavaScript is a hack to begin with, even when written well it's making the best out of a shitty situation.
Even when there's call back hell, I still see proper indentation for nested callbacks...
And besides, JS engineers (worth their salt) love their promises, specifically to avoid that. Soooo... only n00b JS coders would have call back hell to begin with, and the worst of the worst wouldn't properly indent it.
0
u/[deleted] Jul 25 '18
[deleted]