7 ms·
I hate Python and I'm onboard with putting it down in many ways, but significant whitespace isn't weird in a first programming language. It's only weird if you'
by Chinjut 22d ago
I hate Python and I'm onboard with putting it down in many ways, but significant whitespace isn't weird in a first programming language. It's only weird if you've absorbed from some other language the convention that whitespace shouldn't be significant.
- YuechenLi 22d agoOh, by "significant whitespace" I meant whitespace sensitive indentation, which I think Python and YAML are the only languages that has that feature.
- Chinjut 22d agoHaskell, Lean, and Agda too. But even if Python were the only one, it wouldn't be weird to someone for whom this was their first programming language. It would just seem the way programming languages are. There's nothing intrinsically weird about indentation being significant. It's quite visibly part of the code you write and read.
- toast0 22d ago> There's nothing intrinsically weird about indentation being significant. It's quite visibly part of the code you write and read. The idea is fine, I guess, although I certainly don't care for it. Where it gets most nasty is that whitespace that looks the same (in your editor) might not be equal and will cause you pain.
- xigoi 22d ago> Where it gets most nasty is that whitespace that looks the same (in your editor) might not be equal and will cause you pain. This is why idiomatic Python only uses spaces for indentation.
- zahlman 21d ago> Where it gets most nasty is that whitespace that looks the same (in your editor) might not be equal and will cause you pain. First off, what editor could I end up using in 2026 that makes this a realistic problem? Even the most basic editors I know of have options to convert tabs to spaces automatically (and any responsible teacher will tell the student to indent with spaces), and to continue the previous line's indentation automatically. Second, modern Python is stricter about this, and also gives clear error messages.
- YuechenLi 22d agoHmm. Learned something new today. Thanks.
- rmunn 22d agoF# as well.