laurent.orseau
2021-3-8 08:42:30

Lexical(?) indentation is pretty useful for writing short imperative pseudocode in papers though :grin:


sschwarzer
2021-3-8 17:35:20

From 20 years experience with Python I’d say that “missing space screwing things up mysteriously” is extremely rare. In my experience, even if you make a whitespace-related mistake, it usually results in a SyntaxError, not wrong behavior.


sschwarzer
2021-3-8 17:38:57

I suspect in almost all cases, the criticism about syntactically relevant whitespace comes from a suspicion from people who have very little experience with Python, if any experience at all. This is also similar to people saying that dynamic typing will unavoidably result in lots of bugs you’d prevent with static typing. (Don’t get me wrong, I appreciate the additional checks by static typing, but it plays a lesser role for bugs than many people think.)


sschwarzer
2021-3-8 17:42:07

For the record, so far I’m fine with s-expressions. :slightly_smiling_face:


rokitna
2021-3-8 21:28:42

For the past 10 years, I’ve preferred language that don’t use significant whitespace because I’ve been concerned about what will happen when someone needs to share code in an underpowered Web comment field that collapses all their whitespace.

In 10 years, I think the number of times I’ve had to share code somewhere that didn’t already have a preformatted code block feature has been 0. And while it might still affect beginners who aren’t experienced with the interfaces for formatting code blocks, the number of Python or Haskell users I’ve seen reporting experience that those languages make it too hard for beginners to post readable code blocks is also 0. I do see a lot of people say that they personally avoid languages with significant whitespace, or that they really dislike the significant whitespace in the languages they’ve used, and I respect that, but I’m starting to think my own reason was mostly a convenient talking point I happened to take to heart.

…Well, I’ve also faced some situations where I had to do really deep nesting of code, and I have concerns about how well I could express that nesting in Python. But I’m not so concerned about expressing it in Haskell, since Haskell’s do notation and $ make it easier to keep CPS indentation and parens in check. So this concern of mine is more practical, but it also seems solvable regardless of the presence of significant whitespace.


jcoo092
2021-3-8 22:15:24

Luckily, we don’t (usually) have a computer attempt to parse that - just humans who might not even spot the difference :slightly_smiling_face:


jcoo092
2021-3-8 22:17:46

Yes, much of the time a missing space etc will cause a syntax error or similar, but even in those instances in my experience actually finding the root cause tends to be a nightmare. The error messages frequently are worse than useless when it happens.


cadel.watson
2021-3-9 04:28:51

@cadel.watson has joined the channel


casparpopova2023
2021-3-9 05:54:18

@casparpopova2023 has joined the channel