<- Back
Comments (119)
- Revanche1367A lot of Python design decisions have felt weird and off to me but they’ve long justified it by saying that it’s those little ugly design choices that make the language so usable and effective in practice compared to more well-designed languages that hardly anybody uses. I’m not enough of an expert to clearly say if that’s really true, but imo, there’s a repeated pattern of slightly weirdly designed languages becoming super popular: Python, Javascript, perhaps C as well. Or, maybe we only notice the weirdness because these languages are used so much and get nitpicked to no end.
- YuechenLiPython is just such a weird language in general despite its popularity that I honestly cannot recommend anyone who starts programming to choose Python as their first language, contrary to popular sentiments. I mean, I was one of the first person to start using Python when I was in grad school almost a decade ago when everybody else in my field was still using Matlab for their lab code, for the simply reason that Numpy was less awful than Matlab and I needed something that can easily print graphs to PDFs.The only thing good I can say about Python nowadays is that it's easy to get started for the first five minutes, and then you'll have to deal with all of its weirdness: significant whitespace, truthiness, duck typing, GIL, distribution/packaging, etc, etc.I was a big fan of Julia as the potential replacement for Python for science for such a long time and I had evangelized it a lot previously, but recently I've been more and more convinced that JIT/multiple dispatch was only good if you already know how to program well to begin with, which for a lot of academics who are not working in computer science, they write quite horrific code. I think it may be better off to skip Python altogether and write your code in a statically typed language to begin with.
- zahlmanPast: https://news.ycombinator.com/item?id=49284392 (with my comment), https://news.ycombinator.com/item?id=49250370 .Nice to see it get attention this time.
- nneonneoThe __debug__ constant is really weird - any block of code guarded with `if __debug__:` will be entirely omitted from the bytecode under PYTHONOPTIMIZE=1. This and `assert` are the only two examples of real “conditional compilation” in Python. This is also the reason why you cannot assign to __debug__: doing so would make it possible to invalidate the compiler’s assumption about `if __debug__:` statements.
- jherskovicPython has some absolutely kick-ass libraries, even without C. It has Django, for those of us who like developing web apps but never could fall in love with Ruby on Rails. And Django is amazing. I've also yet to see a better language for writing quick ETL scripts and pipelines. Also, an 'I need a script for $SYSADMIN_TASK but I want to be able to read it later.' Anything dominated by external latencies (web, databases, etc) will be fast enough for many uses in Python.Sure, it's not a language to write a web browser or game engine in. And it is slow. But it has some very strong niches outside of ML/Data science. Personally, I love it. To each their own.
- gucci-on-fleekIf you count pre-release versions, there are actually 7 pre-declared constants, since Python 3.15 (planned for release in November [0]) adds a new constant "TYPE_CHECKING" that should behave like "Ellipsis" and "NotImplemented" do right now [1].[0]: https://peps.python.org/pep-0790/#schedule[1]: https://peps.python.org/pep-0781/#backwards-compatibility
- neillyonsI remember reading that in early versions of Python there was no built in True and False. Each user would implement this themselves asTrue = 1False = 0then later these got added to the language. In Python 2 you could still reassign and swap them so that 'if False' was actually true!True, False = False, TruePython 3 you could no longer reassign them.
- hmokiguessPython is awful. There are so many one offs in libraries, none agree on a style, it’s slow, and it’s way too easy to do the wrong thing. I often work with data scientists and have to productionize their jupyter notebooks which is pure suboptimal hell. I guess it must be a good easy learning curve for research/scratchpad
- xg15Isn't "..." then also behaving like True, False and None, i.e. being a lexical token that rewolves to a hardwired value during parsing?
- persedesLove the investigation and write up.Took me down some rabbit holes, but interesting to see the chatter about the fix here:https://github.com/python/cpython/issues/80233Initially you could reassign True,False but that was verboten with the switch to python 3! The walrus operator was the one simply an oversight.https://python-history.blogspot.com/2013/11/story-of-none-tr...Explanation from Guido himself
- numpad0> True, False, and None are keywords. they aren't identifiers, they're just straight up their own lexical tokens.Could this be so that the interpreter don't inadvertently manipulate them or pass them to a function? param=None and param="" can be very different.
- snittyPython is three scripting languages in a trench-coat.
- LucasoatoWow, I wish to understand the internal details of Python implementation that makes it behave in such a way :)
- throwaway314155Queue the hoards of Python haters apparently.
- jMylesI made a constant library for python which I liked some years ago. I wonder if any of my ideas made it in:https://github.com/nucypher/constantSorrow/blob/master/tests...
- echelonI used to like Python in the 2010s when it felt like a breath of fresh air relative to PHP and Perl.Now it feels like a weird PHP itself that is slow, brittle, and dangerous to write code at scale in.The loose typing, potluck standard library, and horrible package manager (insofar as the community does not know how to package code) all feel so dated.
- denislexic[dead]
- moomoo11just my 2c but py is honestly one of the worst languages and ecosystems i’ve used in my life.for all the hate js used to get, py is at least a few magnitudes worse.my opinion ofc. don’t get mad xD