dontlaugh 3 days ago

I have the opposite opinion, having written Python for many years. Dynamic typing is almost never better or necessary, but significant whitespace makes for excellent syntax with no downsides.

3
ab5tract 2 days ago

Significant whitespace is a divisive enough choice that a non-zero percentage of programmers won't even consider the language unless forced to do so by economic circumstances.

It might not be a highly visible downside, but it's there nonetheless. It's better to be honest about that than pretend there is no cultural tradeoff that comes with making such a (IMO) terrible design decision in a language.

There are plenty of people that feel the same way about sigils (like `$foo` in Perl) and semi-colons. I've never understood it -- and likely never will, at this point -- but I don't pretend that there isn't a real demographic effect that these choices bring with them.

const_cast 3 days ago

> but significant whitespace makes for excellent syntax with no downsides.

Biggest downside: copying and pasting code breaks in a lot of apps.

Jira, Teams, and probably some others, eat whitespace for breakfast. So if a coworker gives me a code snippet they have to manually edit it (often not even possible) OR I have to, or it won't even run. And since the whitespace is significant, it can't be auto formatted.

Whereas with C# you can copy the most fucked up snippet, put it in your editor and boom - auto-formatted and compiles.

pansa2 3 days ago

There’s at least one downside: only having lambda expressions instead of full anonymous functions.

Python’s grammar works great for expressions-inside-statements (and expressions-inside-expressions), but it can’t do statements-inside-expressions. Every attempt to support the latter turns out really ugly, at least in corner cases.

sinisterMage 3 days ago

Yep, W++ lambdas are statement-level on purpose My high school teacher once told me lambdas are “university-level,” so I made them the default function syntax in W++. It’s my way of saying: “nah, these aren’t scary — they belong in scripting too.”

That said, I totally agree that full anonymous functions would be useful (especially for more complex logic). Might explore adding those later, but I love the message the current model sends.

dontlaugh 3 days ago

It works just fine for F#, for example. It’s doable, but it’s too late for Python.