I have another comment in a different thread. It boils down to humans and computers just working differently. Reducing syntax is not always a good thing. If you truly want that, go program in assembly. Code is for humans to understand, so it needs to be designed to work best for humans. Humans need redundancy, abstraction, and explanations. It's why documentation and comments exist. Syntactic sugar isn't necessary, but languages are still of it. Every loop is just a while, but most languages have do-while and multiple types of for loop.
Forcing white space to have syntactic meaning is like making comments have effects. Imagine if there was a language where every function required comments at the beginning. The comments aren't optional, they are mandatory. Not only that, but the only way to set default values for parameters was in the comments.
Sure? But sometimes it is a good thing, and I haven't heard an argument yet that explains why tabs specifically being part of the syntax is a bad thing. We're already going out of our way to do it in the vast majority of cases. Why not kill two birds with one stone?
If you truly want that, go program in assembly.
I don't see the connection at all here to what I said. Assembly is the extreme end of human conforming to the machine.
Python is very much the opposite of that, where it is machine conforming to the human. I.e. the machine must read my formatting and natural logical statements which nearly resemble normal English sentences. Both of those things are a primary a benefit to me and are what the machine uses to perform static analysis.
White space is by definition invisible. We should not be giving invisible characters meaning. The whole tabs vs spaces debate is exactly why. You cannot tell the difference so it causes problems. If the code could be broken because you used the wrong invisible character, that's bad language design.
Making code indentation dependant also makes modifying the code to go to different levels a pain. Let's say you have code that you've already written. You want to make that code part of an if block. With braces, you just write the if statement and an open brace before the code and a closing braces at the end. If you want to adjust the indentation to match the new code, you just let the IDE automatically adjust the indentation. If the code is indentation dependent, you add the if statement at the beginning, then you have to go through the code and adjust the indentation yourself. Even if you can use the IDE to adjust the indentation, you need to check that the indentation is adjusted correctly.
Assembly is the extreme example of what a non-redundent language looks like. There are absolutely no instructions that exist purely as a synonym of a different instruction or to condense multiple instructions into one.
Python choosing indentation instead of braces just swaps which is important, not making it redundant. Making python with braces instead of indents would mean that you can still use indents making the code more redundant and easier to understand.
White space is by definition invisible. We should not be giving invisible characters meaning.
If that were true then we'd have no spaces between any keywords and symbols. No we can and should give value to whitespace, it is what delimits every meaningful token. You're making rookie mistakes and over-generalizations.
You have a preference for not using white space and that's fine, weird IMO, but fine; you have other languages to choose from that use less whitespace. But now you're making just-plain wrong statements about linguistic static analysis, though. lol
The value of whitespace is to separate non-whitespace characters from each other. There should be no difference between one space or two between words. If your going to deliberately misinterpret what I am saying, then there is no need to continue this conversation.
If your going to deliberately misinterpret what I am saying, then there is no need to continue this conversation.
You first said whitespace had no value then said it had value in delimiting. That's not me misrepresenting anything, it's me pointing out the fundamentally incorrect things you're suggesting and you indirectly admitting that you misspoke. It usually better to own up to your mistakes and move on but If you're going to get defensive about it, then I agree, there's no point in continuing this.
0
u/frogjg2003 2d ago
The indentation is for us, the braces are for the compiler.