It’s probably more prone to mistakes like that, true. But in practice I really never witnessed this actually being a problem. Especially with tests and review.
It’s probably more prone to mistakes like that, true. But in practice I really never witnessed this actually being a problem. Especially with tests and review.
Yeah, that’s definitely a good point. But it’s a minor thing. Adjusting indentation takes 2 keystrokes in vim, I barely notice it.
So I’m going to say what I always say when people complain about semantic whitespace: Your code should be properly indented anyway. If it’s not, it’s a bad code.
I’m not saying semantic whitespace is superior to brackets or parentheses. It’s clearly not. But it’s not terrible either.
As someone who codes in Python pretty much everyday for years, I NEVER see indentation errors. I didn’t see them back when I started either. Code without indentation is impossible to read for me anyway so it makes zero difference whether the whitespace has semantic meaning or not. It will be there either way.
Hey, I’ve been really careful with my words to NOT say that. I was just wondering and I acknowledge that it might be nonsense.
US has a huge influence on the entire world. Could it be that it started (or got amplified) in the US due to poor healthcare and then spread out to the rest of the world? I’m not trying to put all the blame on US of course, but it doesn’t sound that unreasonable that it could be partially responsible.
Man, I’m just chilling and relaxing after a week of SE work and this resonates with me very deeply
I’m not sure about the exact percentage but I don’t think it’s necessarily that far off. I spend a lot of time reviewing code, designing, documenting, reading documentation. Actually writing code is a cherry on top.
A vast majority of the code in question is the code I’ve written for my work projects with multiple active contributors and refactoring is very common too. We all like to shit on Python for various reasons but no one in my environment ever complained about whitespace.
Like I said, I don’t think whitespace is perfect as a part of syntax but I’m much more likely to forget a semicolon than a proper indentation and this applies to any language. I guess it’s not universal tough, because you can often see code with messed up indentation on online forums etc. TBH this is just unthinkable to me, indentation is absolutely necessary for me to be able to read code and reason about it. When I’m thinking about blocks and scopes it’s not because I counted semicolons and braces, it’s 100% indentation.
Yup, IMO Python is so much better with type hints that I can’t help but think they should just be part of the language. Which is kinda stupid because of the “original philosophy” as you said. But on the other hand things like third party static type checkers and type stubs, or just untyped libraries can be a real PITA .
Also, I acknowledge that the lack of typing can be an advantage for some people in some circumstances, even though I use typing even in the simplest and shortest scripts myself. Why would I want to figure out the types every time I look at the function if I can just write it down?
It’s also important to acknowledge how different is prototyping from writing production code which has to be extendable and maintainable for years by multiple developers.
Your take isn’t even very hot when we are talking about prototyping 😉
Meanwhile here I am thinking about pivoting my career from Python to Rust because I’ve grown to hate Python’s lack of typing. I also religiously write unit test even for minor personal projects.
Genuine question: why? What makes, say a semicolon, so superior to the the newline or tab characters?
To be clear: I don’t think whitespace as a part of syntax is an awesome idea which should be more popular. It’s definitely a bit more error prone in some ways. It’s not perfect. But it’s okay.
I’ve written a lot of Python and I don’t think I have ever seen a syntax error caused by incorrect whitespace. I’m not exaggerating. I regularly forget semicolons in other languages but I never type out incorrectly indented code. Maybe that’s just me though…
Of course, but when indentation has a syntactic meaning the formatter often won’t be able to fix it.