Hacker News new | ask | show | jobs
by tyre 21 days ago
I felt the opposite, because Python isn’t a great language. It won because of Google, fast prototyping, and its ML interop (e.g. pandas, numpy), but as a language it’s always been subpar.

Indentation is a horrible decision (there’s a reason no other language went this way), which led to simple concepts like blocks/lambdas having pretty wild constraints (only one line??)

Type decoration has been a welcome addition, but too slowly iterated on and the native implementations (mypy) are horribly slow at any meaningful size.

Concurrency was never good and its GIL+FFI story has boxed it into a long-term pit of sadness.

I’ve used it for years, but I’m happy to see it go. It didn’t win because it was the best language.

5 comments

> lambdas having pretty wild constraints (only one line??)

I will never understand why people are upset about this.

You HAVE multi-line lambdas. They're called functions.

Yeah, I know you want a function that's only used once to be able to be defined in-line, but tbh I've always found that syntax to be pretty ugly, especially once you're passing two functions to a single call, or have additional parameters AFTER the function (I'm looking at you, setTimeout/setInterval).

once you use any language that lets you fluently inline a multiline lambda / closure you can never use Python again without it constantly irritating you
I find programs with lots of anonymous functions to be bloody irritating so I think that's just another matter of personal preference.
> there’s a reason no other language went this way)

Except of course for those that did, Haskell, Fortran for example.

F# as well, and that tends to exist in parallel with some degree of C# written by the same devs… the indentation enables cleaner, smaller, simpler code function by function.

It’s pretty ok in Python, but meaningful indentation is amazing with a proper type system and compiler. Clean, consistent, efficient, and ensures working code is easily read and standardized.

I’m unaware of anyone accepting improperly formatted C# as ‘done’, and would reject any such PR out of hand because of the potential for legibility issues to hide bugs. So: if it were done when 'tis done, then 'twere well it were done by the compiler to save line noise.

I’m always baffled when language complaints come down to syntax
That’s exactly how I think, too. But at the same time, I like indentation in Python, because I would logically indent in every other language as well. In fact, I find all those semicolons and similar things at the end of each line completely redundant (why should I repeat myself for something the compiler should do) and I hate them. And that’s despite having experience with Modula and 10 years of C++. But when I look at Rust, I find the syntax simply awful. From an ADHD perspective…
fellow ADHD here. Rust feels like 'oh come on you want me to type all that?' I find Raku great, though
Not ADHD but 100% agree on rusts syntax. It's totally repulsive to me.
I'm baffled how you think syntax doesn't matter. Syntax affects how hard something is to understand when you read it, how hard it is to physically input, how hard it is to make mistakes, how hard it is to parse, interpret or compile.
Have you never tried to read someone else's Perl code? Syntax matters.

But complaining about indentation is silly. Other languages' compilers don't require it like python does, but the humans using those languages all absolutely require proper indentation. Why not make it part of the language?

Lambdas are intentionally kneecapped in python because Guido van Robson doesn't want to make a functional language. (As in "functional programming", not that it doesn't work.)
Guido van Rossum didn't oppose functional programming, but he wanted to keep the language (and the interpreter) simple.
"I didn't envision Python as a functional language" https://python-history.blogspot.com/2009/04/origins-of-pytho...

"I don't think it makes much sense to try to add "functional" primitives to Python, because the reason those primitives work well in functional languages don't apply to Python, and they make the code pretty unreadable for people who aren't used to functional languages (which means most programmers). I also don't think that the current crop of functional languages is ready for mainstream." https://developers.slashdot.org/story/13/08/25/2115204/inter...

If he kneecapped an advancement for the language intentionally, then, well, yikes! It's a tautology to say that it isn't bad because the creator said it shouldn't be there. That's not what you want to see from leadership.

Ruby has `do … end` blocks that are readable and greatly improve the language, without turning it into a "functional" language.

Sigh. You clearly don't remember the year 2003, when your choices were basically C, Perl, bash, php, or Python. C is not a language for quick scripts or dealing with strings like web apps do. Perl was so fun to write, but impossible to read. Bash actually requires you to know bash, awk, sed, grep, and to if you think Python is slow you've never written and used a 2000 line bash program. php was pretty readable and writable, but so full of security pitfalls for Web apps, and was also slow. Python was an amazing breath of fresh air compared to them all!