12 ms·
Breaking up with Python
- anigbrowl 4y agoI don't fully agree with these arguments, but they all have some validity. I really felt his point on the documentation - it's great that it's reference-complete if that's what you're looking for, but it's maddening if you are coming to something to find out what it does.
- 63 4y agoI often find myself typing python3 import some_module dir(some_module) rather than trying to find functionality on the docs sites anymore
- bogwog 4y agoLately i've been using ChatGPT for that instead and it's phenomenal. Previously, I'd just open up my site-packages folder in a dedicated Sublime window and just search the source code for what I wanted to know.
- heavyset_go 4y agoIf you haven't already or aren't aware, install IPython, use ipython3 as a replacement REPL and use the '?' or '??' operators to open the docs/definitions of the object you want to inspect. ipython3 import some_module some_module? # or some_module?? You can also type the object's name and hit tab to get a drop-down menu that will list its methods and attributes, like dir() with a better UX. Modules are objects, too.
- dragonwriter 4y ago> If you haven’t already or aren’t aware, install IPython, use ipython3 as a replacement REPL and use the ‘?’ or ‘??’ operators to open the docs/definitions of the object you want to inspect. you can read the docs in the standard REPL with help(object). And, of course, IDEs (or editors with decent Python support plugins) will do it on hover.
- samuell 4y agoDevDocs (https://devdocs.io https://devdocs.io) is a great interface to the existing (content-wise wholly OK) Python docs.
- primeblue 4y ago[dead]
- rihegher 4y agoI have just started getting into python as I'm experimenting with pytorch and after a lot of googling I'm still trying to figure out how to use conda properly. Could anyone point me to the best way to manage python environments and packages?
- samuell 4y agoTried tons of ways, and finally found peace of mind with poetry: https://python-poetry.org/ https://python-poetry.org/ It encourages to set up project specific definitions which are saved in the local pyproject.toml file. Keeping everything local and project specific, including the env definition, turns out to be a fantastic boon to reproducibility and sanity of mind.
- shadycuz 4y agoI always recommend the hyper modern guide to python. https://medium.com/@cjolowicz/hypermodern-python-d44485d9d769 https://medium.com/@cjolowicz/hypermodern-python-d44485d9d76...
- rihegher 4y agoThanks!
- the_af 4y agoI don't think there is a "best" way, in my biased opinion package management for Python is terrible. It works for trivial cases but if you do anything serious it will get unmanageable fast. Everyone will tell you of the "best" (i.e. their favorite) way to handle packages and dependencies. Usually mixed with some sandbox framework. Everything will be broken in some way: nonstandard, convoluted, too slow, cannot handle corner cases, or just way too difficult to understand. Even those labeled "for humans". Everyone will agree the situation is a mess "except for this one way that works": never trust that way, it doesn't really work past trivial cases. Of course this is just my experience. But I feel after years of battling with Python and trying different things, I've earned the right to say this.
- maxerickson 4y agoPretty amazing success for the Python standard library to be labeled as barebones.
- paganel 4y agoYeah, that caught me off-guard, too. I agree, though, the urllib module that he links to it's not the best thing ever when it comes to Python, and I say that as a guy who has written Python code for a living for 17 years now. But other than that I find the standard library more than ok. The only thing that I can agree on is the slowness, but even that is relative, as we're not all writing speed-critical code. The type annotations never took off because they were, and are, basically un-pythonic, trying to force types on Python's throat, so to speak, is definitely un-pythonic. Unfortunately the "types are a silver bullet"-hype is all too real, so there's also that. He should have also learned to love dir()-ing stuff.
- baq 4y agoDisagree on typing. Modern types, as evidenced by typescript, are very helpful and don’t incur significant verbosity cost. They are expensive in large projects during linting. My personal recommendation is to use typing and mypy in all new code, coming from somebody who was celebrating new-style classes in 2.2.
- da39a3ee 4y agoIMO Python typing really became good with the advent of Microsoft's type checker in VSCode, and probably PyCharm too, although I've never used it. Typing with mypy during development never quite cut it because it's optional (unlike e.g. Typescript), and the editor support just didn't quite make it effortless the way VSCode/Pylance did. (I'm talking about development, not CI.)
- pdonis 4y ago> the urllib module that he links to it's not the best thing ever I think the reason it (and the http modules in general) has never been improved is that even when Python was young, there were better third party packages out there, but no single one of them ever got to the point where the Python devs would consider making it part of the standard library. Particularly when it comes to servers, there have always been multiple third party frameworks with significant market share. For clients, we might be getting to the point where the requests library is common enough to be a candidate for the standard library.
- brundolf 4y agoI'm at a point where I think I would turn down any job offer that required me to do anything with python (even just the occasional change). I don't have the time or energy to fight with my tooling and environment that much It's really a shame that data science, ML, and notebooks are so wrapped up in it. Otherwise we could jettison the whole thing into space
- brrrrrm 4y ago> It's really a shame that data science, ML, and notebooks are so wrapped up in it. Otherwise we could jettison the whole thing into space Although I personally feel Python has its place, I contribute to a project that hopes to diversify the ML/scientific computing space with a TypeScript tensor lib called Shumai: https://github.com/facebookresearch/shumai https://github.com/facebookresearch/shumai
- devmunchies 4y agoSame. I was at an AI startup that used python for everything and it was so bad. Even worse since it was AI engineers writing a lot of the main app code too.
- iamjk 4y ago> Python’s standard library sucks Maybe for production ready microservices, but I've always thought Python's std lib was pretty expansive.
- Ekaros 4y agoAnd I'm not entirely sure it would be good idea for general purpose language. Knowing the history servers. Which likely will anyway have some critical design or security issue at one and probably many points in their life.
- heavyset_go 4y agoThere's the adage that the standard library is where modules go to die, which seems to ring true in Python's case. Having a big standard library can be great, especially for things and designs that have been settled years ago, but inclusion into the standard library means iterating upon those modules will receive pushback from maintainers looking out for consumers of the standard library who need it to remain stable for potentially decades.
- beardog 4y agoDon't forget how much of a pain packaging apps for end users is. There are helpful tools out there for it, but nothing that comes close to the ease of Go's default static builds that I have found.
- kcartlidge 4y ago> the ease of Go's default static builds that I have found Seconded. These are examples [1] of the scripts that I use on Linux, MacOS, and Windows for producing cross-platform builds. Run the one for the platform you're on, and it will produce stand-alone builds for all the targets (Linux, Windows, MacOS Intel, and MacOS ARM). And the builds are small enough that in many cases for simple tools I commit them straight into the repo for easier usage. [1] https://github.com/kcartlidge/ng/tree/main/src/scripts https://github.com/kcartlidge/ng/tree/main/src/scripts
- wpnx 4y agoI agree with some of the sentiment here, but at the end of the day i’m not sure i’d be able to make a clean cut like OP suggests. Python is used in so many places that’s it’s part of the lingua franca of programming. I’ve worked at multiple ruby shops over the last few years and pythons still been there in force for data applications. I much prefer other languages (Ruby, Kotlin), but at the end of the day i need to be comfortable with the language that will be spoken for years to come.
- thaumaturgy 4y agoI've been recommending Python to the occasional aspirational young programmer. Is it already passé? What would you recommend instead for a starter language? Looking for beginner-friendliness, widespread use, and longevity. edit: to be clear, I hope this won't devolve into a language flamewar. I'm sincerely interested in other devs' opinions, and hoping that either Python is still a good recommendation (which seems to be the consensus so far) or that there's a better alternative.
- heavyset_go 4y agoNo, it isn't passe, this developer just has some personal gripes with it that can range from understandable to "you'd complain if we did it any other way" with regard to their question about why type annotations were implemented the way they were.
- mgkimsal 4y agoI have, for the life of me, never understood the 'beginner friendly' argument for python. Java, PHP or JavaScript for 'widespread use and longevity'. None of these are going anywhere, and I think you'd find more resources for beginners to advanced users for those 3. Yes, of course there's others - everyone has their faves. And Python will continue to kick around as well, but I've just never understood the 'beginner friendly' bit.
- baq 4y agoJava the language used to be so simple that it needed significant library usage to accomplish anything at all. It aimed for ‘safe C with classes’ and succeeded… in the enterprise where management was making technical decisions. After feeling the heat from C# it managed to catch up, mostly, to modern realities. Not a good beginner language, despite the simplicity. PHP was not designed at all. It took a decade to make it more than a template processor. The biggest, by far, selling point was ease of deployment: ftp and done. Good if you want to display something in a browser. Learning programming, not so much. Javascript is starting to become a sane language with ES6. It’s an accident of history that became an industry standard due to sheer power of will of browser companies. Tooling complexity in its ecosystem rivals, if not exceeds, that of C++. Recommending js s as a language to learn programming on has been until last couple of years irresponsible. Python was designed to be beginner friendly, it was the next iteration of other beginner-friendly languages that had some academic research done about, you guessed it, beginner friendliness. It is not an accident it’s recommended for newbies! Due to that and a decade of 1) numpy for biological computing 2) django/flask for web services it’s ubiquitous in two very loosely connected domains, giving birth to jupyter and tensor libraries, and here we are. Turns out a batteries-included standard library makes packaging not a priority for too long.
- kens 4y agoThe article mentions using JavaScript in place of Python. I use JavaScript a lot for browser stuff but can JavaScript be used for the random command-line scripts that I implement in Python? (Genuine question, not rhetorical.)
- fndex 4y agoYep.
- brnewd 4y agoI use Node.js/TypeScript for all my scripting needs. Together with pm2 which can auto-generate a systemd service if it needs to run as a service on boot. Coming back to a strongly typed project / script is actually really beneficial to refactor or extend.
- baq 4y agoNode is an interpreter just like Python, gives access to OS features like sockets, file systems and processes, so yes, you can. However I’d rather not if you value your sanity and want to use typescript, because then you introduce packages and compilers and the whole npm ecosystem which makes building C++ look easy and sane.
- pjmlp 4y agoIt is the first time I see gyp being called easy and sane.
- baq 4y agoTo build what I’m currently working on it is required to use docker, pnpm, npm, nx, tsc, corepack and nvm. I think. Not sure at all. I haven’t built some parts of the project. There’s more involved to run most tests. Something went off the rails at some point.
- deleted 4y ago[deleted]
- 4y ago
- Lyngbakr 4y agoI'm getting stuck into Go at the moment and thoroughly enjoying it, but can it really fill the same niche as Python as the article suggests? (Sincere question.) Doesn't the absence of an out-of-the-box REPL hinder quick scripting? As I say, I'm new to Go so would love to hear about people's experience using it in this context.
- debatem1 4y agoI use go and python pretty heavily, and I probably write twice the amount of functionality and three times the number of bugs in python in a day as go in a day. I take that to mean that they're good at different things, and therefore probably aren't quite as interchangable as the author makes them out to be.
- c7DJTLrn 4y agoWith `go run` it can be effectively used as a scripting language.
- Lyngbakr 4y agoBut that runs the entire script/program rather than a single command, so it's not the same experience as a REPL, right?
- agolio 4y ago> Python’s documentation sucks I can't agree with this. I have always had a very good experience with python documentation. One can use the built-in "help" function which works seamlessly with the docstring feature of the language. The complaint in the blog post seems to refer to the UI of the website missing a table of contents for functions. Yeah sure they could add that but I don't see it as a big point. > Python’s package management sucks Hmm, it has some weaknesses but I wouldn't really say it sucks. Going deeper -> > Every project seems to use a different tool and it’s a massive headache. Off the top of my head there’s ... Don't all of these use pip under the hood? I personally use the lower-level pip and virtualenv tools, but some others enjoy the convenience of poetry. That's a bit of personal preference. It's a bit more akin to an IDE choice than a feature of the language. None of conda, poetry, etc. are core Python features. > Python’s standard library sucks I have to disagree again, I think it is pretty well designed and minimal on purpose. The community additions of numpy, etc. are by design not part of the core language to reduce bloat. > Python is slow OK sure, it is slower than compiled languages like C++, that is a concession we make when opting for the ease of readability, writability, usability, etc. > Python is huge, the python:3.9-slim Docker image is 118MB Hmmm. 118MB isn't really that big anymore. The docker image would presumably be cached and reused in a deployment pipeline. > Python syntax sucks. This one I can't even understand the reasoning for. The python syntax is what people love about it. I personally dislike the walrus operator, f-strings, and some of the other newer features (did they add the switch statement yet?) but those are my only gripes. And they are more pet-peeves / personal preferences than complaints.
- pjmlp 4y ago> The python:3.9-slim Docker image is 118MB Still smaller than most Go binaries. Had to play with compiler flags to reduce trivy to a proper size (it was 300MB with default flags), and that was only the binary, without any containers. And the dependency story is hardly any better than Python.
- brrrrrm 4y agoI feel similarly. However, Python has - reference counted objects with predictable scoped destruction. this keeps the maintenance of huge resources quite simple and memory usage steady - operator overloading (infix, like +/*-) I really wish other languages (like JS/Go) had this stuff.
- igtztorrero 4y agoI tried python in 2010 because looks easy, but Go came on stage, and changed backed tools. Go is the way to better backend, CPU and memory optimized. I read an article that Dropbox save thousands just by change from Python to Go. It's difficult, especially handling shared variables in go routines, but it's worth it.
- Atlas22 4y agoI'm not sure go should be compared to python as they are designed for very different things. Go is more fairly compared against modern c++ or rust in my mind. Python is not designed to be lightweight or fast (although it has been consistently improving with each release) but favors expressability and run time flexibility instead.
- dragonwriter 4y ago> I’m not sure go should be compared to python as they are designed for very different things. Go was pretty expressly aimed at the spot where, at the time, Python was seen as too inefficient but C++ was seen as too much complexity.
- samuell 4y agoMy solution to the docs problem (which the OP describes well btw... The problem is how everything is on miles long pages), is to use: https://devdocs.io https://devdocs.io It does excellent fuzzy search-as-you-type, and is typically a pinned tab in my browser most of the time.
- macNchz 4y agoI have gripes with some things in the current state of Python, package management particularly, but choosing JavaScript because Python's standard library is "barebones" doesn't really make any sense to me. I've always found the Python standard library to have tons of useful stuff, and when I'm doing something in JS I often feel like I'm missing my toolbelt or something. Then I install a single npm package to do something simple and it winds up having 350 dependencies.
- cldellow 4y agoYes, it was bizarre to see: - Python is too big - Python's standard library is too small - therefore, you should use JavaScript It made me wonder if I was hallucinating, so I went and checked... my `node` execurtable is 78MB. Thanks to its robust standard library, my node_modules folder is only 884 MB.
- c7DJTLrn 4y agoI never said "you should use JavaScript." The post is my own justifications for avoiding Python and I'm not even saying JS beats it on all of these points. The better performance and adequacy of npm/yarn just barely tips the scales in favor of it for me.
- onatrain 4y agoMeanwhile, it was the most used language to solve the advent of code, and the language the winning solutions tended to be written in. > my go-to language for a quick bit of scripting where another language might feel too heavy duty So this article is not from someone who has used Python full time professionally...
- decasia 4y agoThe thing is, every language has serious issues, whether usability issues, documentation issues, performance issues, community issues, standard library issues, dependency issues, whatever. And for every issue, there are some people who just don't feel affected by it (or disagree that it is even an issue), and others who feel it deeply, to the point of outrage. So even if you ever get a consensus on what the issues are, there's even less of a consensus on how much they matter and what to do with them. Some people can live with certain problems and others are really distracted or bothered by them. It depends hugely on the context and environmental constraints too (can your org switch languages? when? on what terms? etc). I think there's something deeply path dependent about how software people go through languages and fall in and out of love with them. Python was the first language I ever used professionally. It was amazing at the time compared to Java. But I haven't touched it in years now and don't especially want to. It's not that I "broke up" with it -- I just went elsewhere and it wasn't used there. You usually have to speak the local language wherever you go... At a certain point, I think a lot of us give up on the idea of "loving" or "not loving" the language we use. They are all just tools. Some professional software people still have love affairs with their tools. That's cool I guess, but I have to say, I've written useful software in horrible languages (PHP) and I feel good about that too, and about not caring about the lovability factor (so to speak) of my professional toolkit.
- zeroCalories 4y agoPeople joke that Python programming is 'pip install solution', but it's honestly not too far from the truth. Until Go, Rust, or whatever fancy new language can match the wealth of well maintained libraries that Python has, I don't see it ever getting replaced for the quick scripting that the author talks about.
- c7DJTLrn 4y agoAuthor here. The Go ecosystem is extremely rich. Are you familiar with it? I would say it is at least as rich as Python's, if not more.
- soganess 4y agoI'd like to see the receipts on your statement. Easy examples I use every day: ML and Quantum Computing libraries. There is a depth to the Python ecosystem that can't be matched anywhere else. Honestly, I'm sure I will get a ton of flack for this, but I really dislike Python. I use it every day and have for years and not only has it failed to grow on me (like most languages do), I've learned to dislike it more with each year. That said, I'm locked in. Outside of Python the libraries available are abandoned research projects or hobby tools, at least when it comes to my areas of focus.
- cedws 4y agoThose are really exceptions because researchers love Python. Outside of those areas, there's really nothing special that Python's ecosystem brings to the table. I'd really like to see machine learning stuff in languages other than Python so that there's less friction in experimenting. I know that would require prying it from researchers' cold dead hands though.
- zeroCalories 4y agoThose aren't exceptions, those are the norm. Yeah Go has really slick libraries to support your favorite protocol, but that's the easy part of programming. If I want to hack together something using computer vision, do some amature data science, or use cutting edge scripts written by security researchers, that's gonna be Python. Pretty much all code that I would wanna steal for my project is written in Python, or has Python bindings as its main way of using it.
- atomicnumber3 4y agoI don't disagree with any of his points, actually, and agree with almost all of them. The standard library has some holes - though I think that's true everywhere. I don't know that eg Ruby or java don't have holes either. I do think the packaging Story in python is nuts. Why does gem just work for Ruby but python's story is such a disaster? Though imo my modern advice is "just use poetry and ignore everything else". Pythons main draw for me is some combination of: Type hinting is good enough. It has a big escape hatch to be able to do C stuff if you need to. Numpy. The language is still straightforward enough that beginners can approach it and the experienced can wax reasonably eloquent with it. And it's pervasive. So when I sit here and I'm like "ugh I need a thing to sit here and hit an api and dump it to a file every day in a cron job, and I don't want to spend a whole day writing this". I go for python. And while go and java and rust etc would be just fine, I still end up taking longer than I'd like. Somehow python is just the shortest, sanest route to just getting a small to medium sized doodad out the door and running reliably in a small footprint of time without needing to remember boilerplate (java) or think way lower level than I'd like to (go/rust). Python just lets me do it with low cognitive overhead. Sometimes while I'm half-listening to a meeting I'm in! Honestly my biggest gripe with python is it's really hard to tell early enough when your program is on a trajectory to be too big for python. And I don't mean from a perf perspective or anything, I just mean when it goes from being "easy python" to "oops it's spaghetti now." There's a tipping point and I think even seasoned people end up well past it by the time they pause and rub their eyes and think "ugh I wish this were in java."
- pdonis 4y ago> I do think the packaging Story in python is nuts. That is one of my three big gripes with Python. The other two are the horrible way the 2 to 3 transition was managed and the GIL. But none of those has driven me to switch to another language, nor do I expect it to. Go seems to be this author's alternative of choice; perhaps if my one goal in life was to write a production network backend without using any dependencies, I might agree, but it isn't, and having done some work with Go I find it gets in my way much more than Python does. I have the same problem with other languages.
- 4y ago
- the_af 4y agoLast time I argued, like the TFA does, that Python's typing system is both too complex for casual users and useless for power users ("it doesn't do anything" is about right), and that this makes it hard to evangelize its use to other devs who aren't sold on type systems ("but this doesn't do anything!"), I got into a 30-level nesting flame war with some HN regular who just wouldn't let go. So that's still my line of thought, but I'm already regretting typing this on HN.
- Atlas22 4y agoYeah, I think I agree with you. I still find it curious that the python language server is quite capable of inferring types from unannotated code yet most of the type checking tools for python seem to explode as soon as they encounter an very popular yet untyped library. I guess typing is more of an afterthought than a priority for most dynamic language developers so it doesn't get much love.
- kcartlidge 4y agoSounds like an opportunity for a type checker that uses the language server.
- dragonwriter 4y ago> Sounds like an opportunity for a type checker that uses the language server The language server itself uses a typechecker, so you'd just be building a typechecker that uses another typechecker by a roundabout route.
- kcartlidge 4y agoIt's turtles all the way down. Though in seriousness I'd presume it would be bad type checker uses language server which uses better type checker, which may help with the problem.
- dragonwriter 4y ago> I still find it curious that the python language server is quite capable of inferring types from unannotated code yet most of the type checking tools for python seem to explode as soon as they encounter an very popular yet untyped library. There are multiple python language servers, but if you mean the Microsoft one, well, that just incorporates one of the best of the Python static typecheckers (Microsoft’s pyright)
- dijit 4y agomy friend made a write up before about the inadequecies of python: https://dustri.org/b/friends-dont-let-friends-write-production-software-in-python.html https://dustri.org/b/friends-dont-let-friends-write-producti... Personally, I’ve been pretty happy with python, I think it works wonderfully as a glue language (like bash); I.E: you shouldn’t write a lot of it, you should use it for plumbing. Its fantastic for that.
- pdonis 4y ago> my friend made a write up before about the inadequecies of python To be honest, this seems like even less of a balanced criticism than the article this overall discussion is based on. A more balanced summary of the valid points might be: "Python has issues that you will probably trip over in certain kinds of applications". Which is true of every language. > I think it works wonderfully as a glue language It also works very well as an application language, just not for all types of applications. Which, again, is true of every language.
- 323 4y ago> For years, Python has been my go-to language > ... > Python sucks. I mean the syntax itself. So author notices that syntax sucks afters years of usage?
- mgaunard 4y agoJust some guy whining on the Internet. Python remains the most popular programming language worldwide.
- sidlls 4y agoIt's rich that the author unfavorably compares python's docs to go's. Go's documentation is barely more than API auto-doc level documentation: and many if not most of the open source projects using it have followed suit. It's some of the worst documentation out there, in my opinion.
- Ekaros 4y agoOn other hand that is often the part of documentation with Python I would love to have. And for a while I have missed with many python things.
- TylerE 4y agoPython doc peaked for me with the 1.x “library index to keep under your pillow” https://docs.python.org/release/1.5.2/lib/lib.html https://docs.python.org/release/1.5.2/lib/lib.html
- dragonwriter 4y ago> Python doc peaked for me with the 1.x “library index to keep under your pillow” I can see why that’s nice, but I find it odd to be described as a peak. While the details of the standard library it documents have evolved, I don’t see how the current version (linked from the main docs site with the same “keep this under your pillow” line) of the same portion of the docs is any worse: https://docs.python.org/3/library/index.html https://docs.python.org/3/library/index.html
- TylerE 4y agoBecause it’s so much more readable without being littered with numerous examples and footnotes all over the place. It just gave you exactly what you needed to know and otherwise stayed out of the way. Remember l, this was from an age when online doc didn’t really exist… I certainly never used the html version. When you’re on dialup a local, quickly searchable version was very valuable.
- sigmonsays 4y agoThere is no reason to start a new project in python IMO. Existing ones should be deprecated. the packaging ecosystem alone is enough to make anyone mad. I maintained a production system in python for a few years a while back and code refactoring was extremely painful. I hope I'll never touch python again.
- Atlas22 4y agoWhat do you use instead now? Its been a long time since I used npm but it was horrific last I did.
- molly0 4y agoI don’t agree with anything in this rant except for “Python is slow”.
- college_physics 4y agoIf you try to please everyone you end up without personality. Python has plenty of flaws but it feels also as a very distinct way of solving a vast range of problems. But its longevity will depend on how well its community can address legitimate complaints (which do not require it become all things to all people)
- iainctduncan 4y agoWhat is such low effort post doing here? I use Python way less than I used to, but this is just unfounded whining. And imagining js is better on those points... omfg.
- cedws 4y agoJust for the record, I'm the author and didn't post it to HN specifically because it's opinionated and whiny.
- pwinnski 4y agoAs well as inaccurate, along with many of your comments on this page.
- jgb1984 4y agoI came here to say the same. The author clearly has only a very superficial knowledge of python (and a large distaste for it). Throughout my studies and career I've written c, c++, java, javascript, perl, bash, python and a little bit of go. Python for me is by far my favorite and most productive language. Expressive syntax, an unmatched wealth of useful libraries and most importantly: when I come back to code I wrote months ago I can easily read and understand it! Which can't be said of my old perl code. I also love how python has been picking up steam lately, 3.6 - 3.11 have been splendid releases with plenty of goodies in each one.
- cedws 4y ago>The author clearly has only a very superficial knowledge of python (and a large distaste for it) I wouldn't make assumptions like that. I've worked with production Python codebases. In fact, until recently I was working as a DevOps Engineer in a hedge fund building much bigger, more complex systems than a typical CRUD backend. I worked hands on with some of the Python repositories and it was extremely painful simply because of the nature of Python.
- Euphorbium 4y agoOut of all of that only packaging criticism is valid, it does suck. But poetry almost solves that.
- kissgyorgy 4y agoThis is a very weak rant, dude having a bad trying to get off on Python. Why is this on front page? So lame.
- th3o6a1d 4y agoJavaScript as a more coherent alternative to python?!?!
- Atlas22 4y agoTime to resurrect the bizzare behavior of JavaScript article again.
- zmmmmm 4y agoAgree with syntax and slow, the others not so much. But my bigger reason for avoiding Python when I can is I just think the days of dynamic languages are behind us. Which is to say, we are past the tipping point where the ergonomics of adding typing are less costly than the benefits, and that applies even for short scripting use cases (in part because so many short scripts grow their way into real production code that needs to be maintained). I went down the rabbit hole of adding type hints but at the end of the rabbit hole it was a lot of work and the value realised was still only 50% of that from having a real type system. Vast numbers of type errors still not getting caught in my editor, autocompletion stymied at shallow points where the type system gets lost, and as the weight of the project grows the tools like MyPy getting slower and slower as they have to process massive amounts of the dependency tree just to infer the type of the single line you are typing. These days even for short scripts I am preferring to write them in languages like Groovy which get me all the benefits of Python from the dynamic language point of view but built on a foundation of a real type system which means I have a pathway to grow the code into full static typing using any of the JVM languages if I want / need to. And it also largely solves the problem with performance.
- theLiminator 4y agoPython is the shittiest option, but the only one for a wide variety of tasks. Everyone loves to hate it, but you gotta use it. I disagree about the documentation/syntax/std lib gripes, but everything else is a pretty reasonable issue.
- northisup 4y agopython is terrible, but it's the best language we've got.
- pdimitar 4y agoOh yeah, "every language has issues", or "if you just invest a little effort you'll get it", sure. But those languages that I use don't prevent me from installing a CLI tool and have me fighting with its half-witted package manager to do so. And they don't (or they very rarely do) mandate me to learn idiosyncrasies so I can do basic activities. The only thing that keeps Python alive and well is the fact that many people don't know anything else -- and never will know anything else -- and that's one of the reasons it's widely taught in universities. The AI/ML stuff can be replaced with its underlying C/C++/Rust libraries in a week so that's not an argument in Python's favor at all. I wish people stopped pretending Python is OK. It very much is not. It's a collective delusion kept alive by network effects.
- baq 4y agoThe argument is that it can be … but isn’t. It hits a sweet spot. It isn’t your sweet spot, but it is for a lot of folks.
- version_five 4y agoThis was awfully generic. Not necessarily wrong, but certainly not a meaningful blow against python that's going to show anyone the light and give them tangible thoughts about using another tool. (Especially given the breath of what python is used for. Does it suck at everything?) What are we supposed to get out of this?
- joromero 4y agoDoesn't JavaScript suffer from most of the same issues the author raises about Python. > Documentation JavaScript wins here thanks to MDN, but it's not the official documentation. > Package Management I agree that Python's package management has its issues, but JS is insane in this regard > Standard Library JavaScript's standard library is definitely smaller than Python's > Slow This is clearly a win for JS > Size When comparing the slim official Python docker image with the equivalent NodeJS image, Python wins in size > Syntax This is the most subjective point. I prefer Python's syntax because it's less noisy, but JavaScript's syntax is more consistent. Regarding type annotations they don't do anything at runtime, but they are extremely useful for IDEs.
- heavyset_go 4y agoIt does, which surprised me when the author said they preferred JS over Python given the reasons they stated. There are a lot of reasons to like or not like Python that will become evident after using it in a significant fashion. I was hoping for some of that insight, both to commiserate and celebrate the horrors and joys that I've experienced using the language and its ecosystem for some time. This article was not that.
- polotics 4y agoI do not understand the incentive structure that would lead anyone to believe such a low effort blog post brings anything to anyone. The points raised are very standard, have reasons and counterpoints, and finally just invoking Go and JS without any details is so meh...
- BenGosub 4y agoIf you chose JavaScript over Python for backend scripting, sounds like you want to hurt yourself. If JavaScript is your goto language, then ok. But, otherwise, Python is the most used language for writing backend scripts, so it's pretty good at this, but also there's a lot of material online.
- zhenyakovalyov 4y agofeels very emotional, which means that it’s not too rational. why discuss someone’s emotions?
- taylodl 4y agoSure. If you've done nothing significant with the language then a breakup is easy. Easy come, easy go. If you've spent years, or even decades, building a portfolio with Python then the breakup is going to be much harder, just like in human relationships. Some things will make sense to leave in Python until end-of-life. Other things will be worthwhile to migrate to Go. Of course your new greenfield projects can start off using Go. Just know this - you're going to go through this again in another 10-15 years, if not sooner. I've been writing software now for 40 years, that's just the way it goes.
- Dove 4y agoI want to break up with Python, too. The one-size-fits-all philosophy that runs through the language from end to end leaves me feeling like I'm typing with three fingers. Sometimes its Right Way really is okay or even right, but sometimes I'd really, really, rather use something else. I worry about a generation of programmers for whom this is the first, main, and possibly only thing they've learned. I worry about them being brain damaged. But where would I go? I clicked through hoping to find a good suggestion, and found none. Python has become the lingua franca of programming, in many contexts, in many fields. You don't have a choice. You have to be able to read it, if you want to read what people are doing. You have to be able to write it, if you want people to read your stuff. It's where the libraries are. It's where stuff is happening. For better or for worse, Python won. Even if I don't care about any of that, I really don't know where to go. I really loved perl. I loved the powerful expression and conciseness. I miss it. But perl 5 is old, and it shows -- a lot of good ideas have come along in the last couple decades, and a lot of things that seemed like good ideas at the time really haven't worked out. A decade or so ago, I was excited about perl 6, but it doesn't seem to have worked out. I don't like python. But I don't know what to replace it with. Javascript and Ruby seem like the serious options to me, and it's hard to take the one seriously, and the other is so niche that that itself feels like a serious drawback. I want a general purpose scripting language that can do small scripts well (Messes allowed! Shortcuts encouraged! Power in a small space!) and grow to large projects well (Thoughtful object system! Good package management! Good support for alternative paradigms!) I just can't figure out what that would be.
- 411111111111111 4y agoThat question can't be answered without knowing what kind of programs you're writing. You got a lot of options if you're thinking about websites/apis, almost none if it's machine learning and basically everything is better if you're thinking about GUI applications.
- Dove 4y agoYou know, I hadn't thought about it that way before. Perhaps the dream of a general purpose language was always incoherent. Perhaps the mess you get when perl tries to offer options to do everything well, and the suffocation you get when python tries to do everything the same way, are inevitable. Maybe using one language for small and large projects was never going to end well -- maybe either the language or the programmers were always going to do it wrong. I suppose I have been assuming that the best policy is to do as the Romans for a long time now. Windows apps are C++ (or is it C# now?) because that's how things are over there. Android is Java, or Scala if you must -- at any rate, you hardly get to pick. Iphone requires learning Objective C. Jquery for frontend, or whatever the cool kids are doing; PHP on the back is good enough for most of the web, and it's good enough for you. And as you say, in ML, Python is not optional. And as I think about it, I've been using specialized languages in specialized contexts for a long time. It seems the knowing the underlying language is only ever part of the problem -- you have to learn the specialized language for what you're doing, whether it's GL for graphics or your web framework's way of doing things, or MFC or .NET, or . . . Yeah. Small tools for specific purposes, and follow the local ecosystem. Things have been going that way, and it's probably a good answer. When in Rome, then. I like that answer. Thanks.
- isitmadeofglass 4y ago[dead]
- haaryball 4y agoFor me the greatest pain point with Python is that you are never sure about what any line of code does, because basically everything can be redefined. It might not be a big issue in a small script, but as soon as you get a biggish codebase, with mixins or magical utilities written a couple of years ago by a developer who in the meantime left, it takes hours just to track the control flow in the mess of patched methods, dunder stuff calling nested supers, etc. To say nothing of big frameworks like DRF. There isn't even an agreed-on way to mark methods that are overridden from a base class. Plus, simply changing the order of imports can violently change the semantics of the exact same code. A fetish for hidden magic, state everywhere, and basically global coupling of code vastly override the supposedly simple syntax: it might be easy to read, but it is impossible to understand, locally.
- pjmlp 4y agoTrue of any dynamic language. The only way to avoid such gotchas is with static typed languages. But only those without any means of indirect calls via function pointers or reflection.
- emrah 4y agoEvery language that's been around long enough has issues. Python has its own of course, and the ones the OP listed are real. But none of them are show-stoppers or as big a deal as to stop coding in Python. Here is my take on what the OP is actually trying to say: "I don't want to code in Python any more (because there are newer cooler languages like Go?) and here is my list of reasons for rationalizing my rather irrational decision"
- smitty1e 4y agoThe package management riff is a fair cop. It would be swell if rationalizing the packaging story were a priority for 3.12.
- cutler 4y agoPython's lambda sums up everything that sucks in Python. It's a crippled, half-assed implementation of something which is considered a basic requirement for any programming language aiming for mainstream adoption. Even Java 8 did a better job after realising it wasn't too late in the day. Python's virtualenv requirement is also another admission of failure, IMHO.
- fargle 4y agoThis is garbage. It typifies a kind a drive-by rant disguised as a rational opinion that is basically insulting to the intelligence of everyone, regardless of language preference. The level of narcissism and pettiness is high, and the level of rational discourse is low. Entitled spewing of garbage. > Python’s documentation sucks Dead giveaway. Well, it doesn't suck. It's pretty great, pretty comprehensive. OH... Wait, ot isn't formatted with a index pane. that's why it sucks. The author probably has problems with the font-kerning too. > Every project seems to use a different tool and it’s a massive headache Um, no. Everything really uses pip. I don't even really like pip, but everyone uses it so I use it. You know why? Because it's never, ever a pain in anything at all. It just works. > Python’s standard library sucks What? is this satire? > Python is huge This has got to be satire. Author prefers "go". Nothing wrong with go, but nothing wrong with Python either. > Python syntax sucks. Nuts! this guys is legit insane. The only really controversial thing is the whitespace-indent vs. delimited thing. Guess what? I really dislike the indentation scheme. You could have a reasonable debate over that relatively unique syntax scheme. But the entire syntax as a whole is cleverly regular, predictable and tidy. > Python is slow Well, as the author said, "Python has been my go-to language for a quick bit of scripting". Slow is a perfectly acceptable trade-off there. And you could certainly come up with a different set of trades that also make sense. To say "SUCKS" implies it's just stupid and sub-optimal everywhere; a lose-lose-lose-lose. Which it isn't. > It’s like everything under the kitchen sink has been jammed in. I though you said that the standard library "sucked"; is there too much sink or too little? "let that sink in" The author seems to be infatuated with javascript and go (at the moment), but neither is really in the same niche as python. That doesn't make any of those other choices "suck". Larry Ellison and his company and products suck. Software patent trolls suck. Python does not "suck" because you like other things at the moment.
- oliwarner 4y agoI'm all for people finding better programming languages and explaining why they're better for them… But without that context, without any context, this feels like they're scraping the barrel to make a point to somebody with no discernable reason why. Python has plenty of issues, but it's still great for a huge pile of use-cases. I've built a career on Python and Django. Even as my frontend work migrates into thick assemblies of javascript, I can't imagine using anything else for the backend for complex systems, but who knows what the next 20 years holds.