39 ms·
Python Is Eating the World
- fratlas 7y agohttps://outline.com/4zf4Dd https://outline.com/4zf4Dd
- deleted 7y ago[deleted]
- umvi 7y agoIf only its package management were as easy as its syntax... I wish pip worked the same way as npm: -g flag installs it globally, otherwise it creates a local "python_modules" folder I can delete at any time. And optionally I can save the dependency versioning info to some package.json... Instead, pip is a nightmarish experience where it fails half the time and I have no idea where anything is being installed to and I'm not sure if I'm supposed to use sudo or not and I'm not sure if I'm supposed to use pip or pip3, etc.
- jbay808 7y agoUse Conda envs!
- tachyonbeam 7y agoI feel uncomfortable with the fact that people feel a third-party solution is the best way to solve this mess. It can also get messy when packages installed with pip, pip3, conda and apt are all entangled with one another in various ways.
- adamson 7y agoIt’s unfortunate that it’s third party, but conda has the unquestionable advantage of being the only Python-centric packaging system that has a reasonable shared binary library story
- geofft 7y agoI'm curious, do you not find wheels + manylinux reasonable? I agree that until recently, Conda definitely had that advantage, but now that you can `pip install scipy` and have that get you a working library and not try to compile things on your machine what does Conda offer beyond that? I guess one thing Conda has that the pip ecosystem doesn't is that it supports installing non-Python shared libraries like libcurl on their own. Is that an advantage? (We absolutely could replicate that in the pip ecosystem if that was worth doing, and it's even not totally unprecedented to have non-Python binaries on PyPI.)
- jbay808 7y agoDoes pip allow version number dependencies? Conda is able to upgrade/downgrade packages to resolve conflicts, whereas pip just seems to check if a package exists and shrugs when there's a version conflict.
- geofft 7y agopip does handle versioned dependencies and ranges, and know enough to upgrade existing packages when needed to resolve an upgrade. Its resolver isn't currently as complete as Conda's - see https://github.com/pypa/pip/issues/988 https://github.com/pypa/pip/issues/988 . (On the other hand, the fact that Conda uses a real constraint solver has apparently been causing trouble at my day job when it gets stuck exploring some area of the solution space and doesn't install your packages.... so for both pip and conda you're probably better off not relying too hard on dependency resolution and specifying the versions of as many things as you can.)
- tachyonbeam 7y agoI think it would definitely be great if pip could install non-python dependencies. One problem right now is that many projects will tell you to just pip install xyz. You execute that, things start building, and the process fails partway with some cryptic message because you're missing an external dependency. You figure out which one, you install it, start again, and another dependency is missing. Rinse and repeat. It's definitely not a turnkey solution, and this issue trips up newcomers all the time. With respect to versioning, I think pip should be way more strict. It should force you to freeze dependency versions before uploading to pipy, not accept "libxyz > 3.5", but require a fixed range or single version. That would make packages much less likely to break later because newer versions of their dependencies don't work the same way anymore.
- krapht 7y ago... the same thing happens if you mix stuff in your usr/bin directory that isn't managed by your system package manager. The solution is: don't mix your package environments. Use a conda environment. Just like in Linux, you'd use a container. If you wait for the Python steering committee to fix pip you'll be waiting a long time.
- sidlls 7y agoConda doesn't really solve the packaging problems of python. It can make them worse if conda doesn't have a package you need.
- KaiserPro 7y agoplease no. As someone who has to look after a bunch of servers used by researchers, conda is the biggest cause of things failing for everyone. conda installs stuff all over the place and its very easy to install conflicting stuff in the same place. I just wish that either venv was automatic, or at least the second thing you learn in python.
- jbay808 7y agoAre you sure you're talking about Conda's virtual envs? Everything gets installed into the folder /envs/my-env-name.
- dangom 7y agoIs there any particular bottleneck towards getting this to work with Python? Would not a simple pip wrapper be enough for the task?
- deleted 7y ago[deleted]
- gilad 7y agoPackaging is definitely recognized as an issue; e.g. here: https://cecinestpasun.com/entries/where-do-you-see-python-in-10-years/ https://cecinestpasun.com/entries/where-do-you-see-python-in...
- kingbirdy 7y agoThat's what virtualenvs are for. Admittedly they're not a perfect solution but the tooling is quite good nowadays.
- sametmax 7y agoUse virtualenv. Always. Python 3 comes with it as "python -m venv". Once in the virtualenv, you don't have to worry about the various pip forms and effects, you can just pio install. You can get fancier than that of course, but that's what works with stock python, on all OS.
- geofft 7y agoHere's a simple but less-than-completely-documented way to keep Python package management under control: 1. Don't install anything globally. Don't pip install --user, definitely don't sudo pip install. 2. For each project you want to work on, create a venv. Yes, there are tools for this, but the base venv tool is totally fine. (venv should be included in your Python, but a few distributors like Debian put it in a separate package - install it from them if needed.) Use python3 -m venv ~/some/directory to create a venv. From here on out 3. As a first step, upgrade pip: ~/some/directory/bin/pip install -U pip. 4. Install things with ~/some/directory/bin/pip install. 5. Run Python with ~/some/directory/bin/python. Slightly advanced move: make a requirements.txt file (you can use .../bin/pip freeze as a starting point) and use .../pip install -r requirements.txt. That way, if you get any sort of package resolution error, you can just delete your venv and make a new one. (Downloads are cached, so this isn't super annoying to do.) A "project" can either be actual Python development, or just a place to install some Python programs and run them out of the resulting bin/. (Edit: Yes, I know about activate, see the replies below for why I don't recommend it. With these rules, you get to say "Never ever type pip, only .../bin/pip", which is a good safety measure.)
- nexuist 7y agoHerein lies my problem. If I want to start a Node project I run `npm init` and then `npm install --save` to my heart's content. If I somehow manage to mess it up I just delete node_modules/ and install again. If I want to start a Python project I have to set up venv and remember to put relative paths in front of every command or else it'll run the system version. Sounds simple, but it's still something to always remember.
- rootusrootus 7y agoJust source the activate script and it'll prepend the correct path so that you don't need to do anything else.
- odonnellryan 7y agoYou have to use something like anaconda. It's basically the same as npm_modules (sorta).
- cfors 7y agoWhat you are describing is a virtualenv and a requirements.txt file. There are tons of other options for Python that do the same thing.
- gedy 7y agoI agree but is it intentional? Seems like a lot of folks rail about how npm works (not just because of the "micro package" philosophy)
- fredthomsen 7y agoI couldn't agree more with this. I was forced into doing some UI coding and although I could never full embrace js, the package management aspects (esp having the sane default of not installing packages globally) were definitely superior to python.
- _hardwaregeek 7y agoExactly. NPM gets a lot of hate but lockfiles and local install by default is great. The default mode should not be global installation. Also imo virtual environments aren't amazing. Having some mode you have to remember to flip on that changes essentially the semantics of your pip commands seems a little brittle. Tools that work on top of pip and venv like Pipenv or Poetry seem a lot better.
- yawaramin 7y agoThe default should actually be a shared cache that is symlinked to local projects, like pnpm does.
- vonseel 7y agoMeanwhile, all the python developers who have started doing any Js work are saying “I wish npm worked as easy as pip/virtualenv”... It really isn’t that difficult, it’s just different. Different always seems wrong, at first.
- odonnellryan 7y agoI haven't seriously JavaScript'd in a couple of years but my problem with it then was different versions of node or npm. Nice thing about python virtual environments is that problem never exists (can make environments with whatever version you want).
- vonseel 7y agopipenv really solves the Python version problem, IIRC. I don't actually use pipenv, myself, since I haven't had time to thoroughly figure out the new magic and I prefer to know exactly what's going on with my Python's. npm doesn't solve the duplicating of deps any better than python/pip, as far as I know. The react-native app I'm currently working on has a node_modules folder at 960Mb. That's probably bigger than nearly every virtualenv I've ever seen. A react-native node_modules on a bare project with `--template typescript` is at least 350Mb (created one a few minutes ago). I'm using nvm for node version management. No problems so far.
- j88439h84 7y agoJust use Poetry. https://poetry.eustace.io https://poetry.eustace.io
- michaelmrose 7y agoMan that looks fantastic. It looks so useful that it ought to be an official part of Python.
- rleigh 7y agoThis isn't even the start of the problems with pip and pypi. If I install pylibtiff, it embeds a copy of an old libtiff which is binary incompatible with the libraries on my system. I have to build it from source, then it works just fine. But I can't inflict this level of brokenness on my end users. This applies to many packages embedding C libraries, including numpy, hdf5 and all the rest. There has been minimal thought put into binary compatibility here, meaning that it's a lottery if it works today, or will break in the future.
- emersonrsantos 7y agoDefinitely EVE Online's MMO secret weapon is Python: https://www.eveonline.com/article/stackless-python-2.7 https://www.eveonline.com/article/stackless-python-2.7 - as well as its numerous ecosystem utilities like Pyfa, Evernus, used by tens of thousands per day.
- krapht 7y agoI would not use Eve-Online as an example of performance. Once it gets to a few thousand concurrent users they have to drastically slow down the server tick rate. It's like playing a turn-based strategy game at that point. *Disclaimer: I quit Eve awhile ago.
- pbreit 7y agoConsidering Python can power the largest web sites (Netflix, Instagram), I don’t understand why there’s so much use of much more complicated platform/languages (eg java, .net)? Note: I am an amateur which is likely the reason for my ignorance.
- paxys 7y agoJava and .NET are no more or less "complicated" than Python or PHP or any other language/stack. The most suitable language for any app/service is what the founding team knows very well.
- brightball 7y agoYou can do anything in anything. Everything boils down to trade offs for the problem or company at hand. I can say with Java and .NET shops, it's usually because the company has heavily invested in Java and .NET infrastructure, process, automation, tooling, monitoring, etc. If there are certifications involved, I also know for a fact that Microsoft feeds big discounts on expensive products (SQL Server) depending on how many employees you have with Microsoft Certifications. It becomes a self feeding system. You're already invested so much in the stack that the choice of using something else is far more complicated than language comparisons. It's one of the reasons that there are so many language options available that run on the JVM that can take advantage of all of that investment without forcing the devs to write raw Java (Groovy, Scala, Clojure, Kotlin, etc).
- RhodesianHunter 7y agoIt isn't just the company's heavy investment, it is the community's. The availability of good, tested, performant OSS libraries available in Java is unparalelled. People talk about languages like Python being "faster" to develop in because they're easier to write. This is true until you need a solid concurrency friendly loading cache or a DB connection pool that works at scale and in Java that's just adding a dependency that you know you can trust.
- brightball 7y ago
- fredthomsen 7y agoFunny that I seen a few articles titled somewhat like this in reference to javascipt.
- nineteen999 7y agoJavascript might be eating the world of web development, but there are a whole lot of other scenarios outside of web programming that Python is more likely to be used in, IMHO.
- RappingBoomer 7y agoyoung people are conformist and sheepleistic
- systems 7y agoPython and JavaScript Ease of use trumping advanced features every time
- daenz 7y agoWRT to Python at least, the skill range is more impressive than the low bar. High-skill programmers can do some pretty advanced things with it, and those advanced things can still be easy to use by lower skilled programmers.
- mopsi 7y agoEase of use and advanced features are not polar opposites. I do a lot of geospatial work and Python bindings for GDAL [1] are godsend. In 10 lines of code, I can read shapes stored in different projections and file formats; load, reproject and merge them into an in-memory SQLite database; do all sorts of complex geospatial operations on them using spatial extensions, and save results to a file. I'd spend half a day writing C++ code that Python abstracts away into very few commands. It's a joy to work with, and I struggle to see any downsides. [1] https://en.wikipedia.org/wiki/GDAL https://en.wikipedia.org/wiki/GDAL
- liuliu 7y agoI've come back from Ruby as the default scripting language to Python. Over the years, the accumulated Python scripts are much more consistent and easier to read than aged Ruby script. Ease of use, sure. But the language itself I would argue is much better thought-out and consistent. Now, only if it has better type and dependency management ...
- _bxg1 7y agoBoth have plenty of advanced features; it's constraints that dynamic languages struggle with.
- ssivark 7y agoPython's success is richly deserved. The fact that it has been a long time coming (Python is almost 30 years old!) is an indication of the amount of sheer effort involved, and should give heart for all those working on building up the next generation of languages. Since this forum is likely to have some folks looking towards the future, I found interesting a couple of talks by Python veteran Armin Ronacher [1, 2]. Watching that presentation makes me wonder whether I should think of this in the context of "Worse is better". That said, Python's runtime introspection is such a killer feature that it's difficult to explain how empowering it feels for someone who is relatively new to programming. [1]: How Python was Shaped by leaky Internals -- https://www.youtube.com/watch?v=qCGofLIzX6g https://www.youtube.com/watch?v=qCGofLIzX6g [2]: A Python for Future Generations -- https://www.youtube.com/watch?v=IeSu_odkI5I https://www.youtube.com/watch?v=IeSu_odkI5I
- blaisio 7y agoPython has a lot of problems that really slow down development, but they are all fixable. The biggest issue, in my opinion, is in dependency management. Python has a horrible dependency management system, from top-to-bottom. Why do I need to make a "virtual environment" to have separate dependencies, and then source it my shell? Why do I need to manually add version numbers to a file? Why isn't there any builtin way to automatically define a lock file (currently, most Python projects just don't even specify indirect dependency versions, many Python developers probably don't even realize this is an issue!!!!!)? Why can't I parallelize dependency installation? Why isn't there a builtin way to create a redistributable executable with all my dependencies? Why do I need to have fresh copies of my dependencies, even if they are the same versions, in each virtual environment? There is so much chaos, I've seen very few projects that actually have reproducible builds. Most people just cross their fingers and hope dependencies don't change, and they just "deal with" the horrible kludge that is a virtual environment. We need official support for a modern package management system, from the Python org itself. Third party solutions don't cut it, because they just end up being incompatible with each other. Example: if the Python interpreter knew just a little bit about dependencies, it could pull in the correct version from a global cache - no need to reinstall the same module over and over again, just use the shared copy. Imagine how many CPU cycles would be saved. No more need for special wrapper tools like "tox".
- brainless 7y agoI understand what you are saying but "Python has a lot of problems" is not really a list of "only" dependency management issues. Once your project is setup, dependency management is what you do once in two weeks perhaps. Rest is just writing code.
- pietroglyph 7y agoHaving such a basic part of a programming language be awful is inexcusable. It's not just that it takes a lot of time; even if it took no extra time, you're still wasting extra space on your computer, risking breakage on external updates, and compromising security because you can't even tell what code you're running.
- spenrose 7y agoBest thing I have ever read on Python's history. Really fine work.
- melling 7y agoAre there any good cloud solutions for developing in Python? I’ve been using Pythonista on the iPad but it doesn’t support numpy.
- audiometry 7y agoI use pythonanywhere. Seems to work well enough and isn’t expensive. Main problem I have with it is I cannot use Altair-viz in a Jupyter notebook because their notebook server is out of date.
- Zanni 7y agoThere's Python Anywhere: https://www.pythonanywhere.com/ https://www.pythonanywhere.com/
- mattkrause 7y agoIt does now: http://omz-software.com/pythonista/ http://omz-software.com/pythonista/ (just below the blue bar).
- mark_l_watson 7y agoSome good news for you: Pythonista absolutely supports numpy, I followed advice on the web a few months ago to install it, and I just tried it to make sure it still works.
- lozenge 7y agoAnvil?
- mlwhiz 7y agoI have been a Python guy for 10 years now switching from another profession - I was a mechanical engineer. I tried to learn other languages like Java ,C and was partially successful too. But I don't remember creating anything useful in those languages. Everything was so verbose that I got drowned in the syntax rather than the logic behind the program. For me, Python signifies ease of development and fast iterations and as such is suited for any young developer.
- mantap 7y agoIn general JavaScript is eating the world. Python still dominates in numerical computing and JavaScript hasn't been able to make a single dent. Because nobody wants to write a.mul(k).add(b) rather than k * a + b or a.set([i,j], b) rather than a[i,j] = b JavaScript's lack of operator overloading is keeping Python alive. Python also has integers that feel part of the language, rather than being segregated from normal numbers in case anybody uses integers by accident.
- medecau 7y ago> JavaScript's lack of operator overloading is keeping Python alive. right... - https://www.scipy.org/ https://www.scipy.org/ - https://news.ycombinator.com/item?id=20661311 https://news.ycombinator.com/item?id=20661311
- mark_l_watson 7y agoTensorFlow.js is actually very nice to work with: it seems to be well supported and comes with many quality examples.
- langitbiru 7y agoYes, Yes, Yes. I remember when I translated Bitcoin Python code to JavaScript, I was frustrated. Operator overloading is not available in JavaScript. By default JavaScript only supports 32 bit number. You have to use BigInt or use 3rd party library like big-integer. There is no default support for module exponentiation. And many more.
- nahtnam 7y agoYou’re spot on… As someone who uses Node/JS for most of my projects, I was actually surprised at how easy math is in python. I was given a homework assignment with the ability to use whatever language I wanted, so I picked JS. After hours wasted trying to do math with large numbers, I switched to python because others seemed to have success with it. Needless to say, I finished the assignment an hour or so after that. (Note, I would still use Node over python for an API any day of the week, personal preference)
- 6gvONxR4sf7o 7y ago
- brainless 7y agoRemember NOT to jump into Python for your new product if don't know Python. If you are developing for a young startup, have time crunch, then stick to what you know. IF you do not have a language, or know Python a bit, then pick Python. Here are some of the reasons why I stick to Python (young startup/web APIs): - OOPs is not too strict (might give a headache to some folks) - Mixins, lambda, decorators, comprehensions - Pythonic ways make me feel productive easily - Create a data Model, drop into a shell, import and try things - Can do that on a live server - Do the same with Controllers, or anything else actually - really nothing fancy needed - Command line processing, SSH, OS integration, etc. has so many great libs - Python Dict someone looks like JSON (this is purely accidental but useful) - Debugger support even in free IDE like PyCharm Community Ed is great - Integration to a world of services is so easy, even ones you do not commonly see - Documentation - many libs have consistent structure and that helps a LOT - Really large community, perhaps only smaller than Java - The even larger group of people using Python in all sorts of domains from Biotech to OS scripts What I would like improved in the language would be an even longer list. Every language has a list like that, but when you are focused on being scrappy and building a product, yet making sure that software quality does not take a big hit, Python helps a lot.
- zik 7y agoI know it's only a one off anecdote but two developers in my team who previously didn't know python used it for a small time-critical project and it was a brilliant success.
- brainless 7y agoThe main point I am trying to make is that not all of us are language experts. I absolutely know the vital role that language experts play and that we need to solve the issues. But companies need to build in the meanwhile. Python is easier to learn, this is why it is such a popular language in Universities. I am not a high IQ person to even grip some of the nitty-gritty underpinnings of a language. But should that stop me from building a product? In the end, I need a language that is easy to pick-up, be productive, has its heart in the right place. A young Python programmer can web scrap easily or plug into Ansible or so many other things. If you know of another language that would make more practical sense and still be easy to pick-up, I would switch.
- dehrmann 7y agoThere ware a time when I wondered if I should learn Ruby or Python. These days, unless I'm going to be a Rails dev, hands-down Python.
- burlesona 7y agoRuby is a nicer language for general scripting, ie “better bash,” as that’s what it was originally designed for. It’s also a bit faster, and has a vastly better / simpler package management system. Python does have great scientific / math libraries, and is worth knowing. One nice thing is the two languages are so similar that it’s pretty easy to switch between them and use whichever fits the bill.
- kccqzy 7y agoThere was a time (more than a decade ago) when I wondered if I should learn Perl or Python. Unfortunately I picked Perl, subsequently forgot it and learned Python instead.
- jes5199 7y agoI was a Ruby programmer for a long time, but I think the world has moved on. Nowadays, I want a language with some type checking, and Ruby is extremely hostile to any kind of static analysis. Rails was pretty exciting as a replacement for how we built websites in the perl/php era, but now that React has taken over, Rails feels weirdly bloated. I would probably choose Typescript for basically everything now.
- lwansbrough 7y agoRecently was trying to convert Python to C#... there are few things that are as absolutely incomprehensible as a Python programmer being clever with numpy. I gave up on the conversion. Perhaps this is a point for Python’s flexibility, but I’d say it’s just a waste. Here’s the code. Try to convert this to any C style language. mins = X.min(axis=0) maxs = X.max(axis=0) idxs = np.random.choice(range(self.dim), self.dim-self.exlevel-1, replace=False) # Pick the indices for which the normal vector elements should be set to zero acccording to the extension level. self.n = np.random.normal(0,1,self.dim) # A random normal vector picked form a uniform n-sphere. Note that in order to pick uniformly from n-sphere, we need to pick a random normal for each component of this vector. self.n[idxs] = 0 self.p = np.random.uniform(mins,maxs) # Picking a random intercept point for the hyperplane splitting data. w = (X-self.p).dot(self.n) < 0 # Criteria that determines if a data point should go to the left or right child node. return Node(X, self.n, self.p, e,\ left=self.make_tree(X[w],e+1,l),\ right=self.make_tree(X[~w],e+1,l),\ node_type = 'inNode' )
- adrianN 7y agoTry converting typical Matlab code to a C-style language and you'll run into similar problems. That's just what you get when your base language isn't all that fast but you have a fast numerics library that allows you to do clever things with arrays and matrices.
- TheDong 7y agoYour challenge isn't possible because the code snippet isn't complete. It doesn't include the definition of 'make_tree', 'Node', or the broader context. That being said, I have no doubt that C++ with Boost would look quite similar to that. The boost libraries have very powerful numeric constructs and can easily handle matrices, uniform random distributions, dot products, and trees.
- lwansbrough 7y agoWell, yeah. My point is the syntax itself is very (too) clever. This syntax is probably possible in C# but you’d be a monster to write it (lots of operator overloads.) The whole implementation is from an implementation of an extended isolation forest. It’s easy enough to find on GitHub if you’re interested.
- KirinDave 7y agoReading this got me thinking and I wonder if other people feel like me about this, so I'm going to share it. This is not serious, but not entirely unserious... I try to be a good sport about it, but every time I write python I want to quit software engineering. It makes me angry how little it values my time. It does little for my soured disposition that folks then vehemently lecture me about the hours saved by future barely-trained developers who will ostensibly have to come and work with my code. Every moment working with python (and that infernal pep-8 linter insisting 80 characters is a sensible standard in 2019) increases my burnout by 100x. I try to remind myself that we're trying to make the industry less exclusive and more welcoming to new developers and "old" isn't necessarily "good" (in fact, probably the opposite), but damn I just don't understand it. It used to be that I could focus on other languages (Erlang, Nemerle, F#, Haskell, Ocaml, even C++) and sort of balm myself. But now, I can't even overcome the sinking feeling as I read the Julia statistics book that I'm going to be dragged back to Python kicking and screaming in the morning, so why even bother? And frustratingly: it's one of the few languages with decent linear algebra libraries. And that means it's one of the few languages with good ML and statistics support. So it's very hard not to use it because when you want to cobble together something like a Bayesian model things like PyMC or Edward actually give you performance that's obnoxiously difficult to reproduce. This is what the industry wants and evidently a lot of people are okay with it, but to me it's misery and I can't work out why people seem to like it so much.
- aaron_m04 7y agoI write python professionally and honestly, who cares about the 80 character limit? Just ignore it! :)
- KirinDave 7y agoI've never worked at a place where the prevailing python culture wasn't to set the linter on kill and just let go wild.
- futureastronaut 7y agoWell that sounds like a personal problem and it has nothing to do with the language. As a counter-anecdote, I've been working on Python projects for over a decade and have yet to experience the draconian linter settings you described.
- simula67 7y agoIn my opinion, the biggest problem facing Python is still concurrency. The mitigation efforts still look to me like Perl's 'bolted on' implementation of object orientation. Python should have gotten rid of the GIL during the 2 to 3 transition. It may have also been an opportune moment to introduce optional typing and maybe even optional manual memory management, making it useful to develop almost all kinds of software. Write a WASM backend and it could have even been used for front end development.
- jnwatson 7y agoThe 2 to 3 transition was already too difficult. It now has optional typing.
- sien 7y agoNow there is Julia that has concurrency. Julia, because it's much newer also seems to have dependency management built in as well. Surely a lot of people who write numerical software are going to either look at or switch to Julia for these reasons.
- lozenge 7y agoThere have been attempts to replace the GIL with locks on individual lists, dictionaries etc but they came out a wash performance wise. Perhaps this can change with gc.freeze and the new dictionary structure.
- victoray 7y agoIt's not flexible as PHP does, but I guess it's faster than PHP.
- pjmlp 7y agoActually no, given that PHP uses a JIT nowadays, and PyPy is still barely used on the Python world.
- stunt 7y agoWhen it comes to raw performance, PHP7 is much faster than Python. PHP is more flexible when it comes to building web applications. But in some areas Python just have better libraries (computer vision, matrices, high-level mathematical functions). I remember reading that PHP is going to add FFI and I believe FFI will have a big impact in PHP world.
- RcouF1uZ4gsC 7y agoPython is not eating the world so much as becoming the new Excel. It has a pretty easy learning curve for people who are not programmers. It has pretty good built in tooling. A domain expert, who is not a programmer, can put together pretty impressive models and visualizations relatively quickly. However, like with Excel, there are serious issues regarding reproducibility, performance, and long term maintenance.
- medecau 7y agoOne who writes a program is a programmer irrespective of being a domain expert or not. If you write code in Excel you are an Excel programmer.
- vcolano 7y agoThat's all good and fine until you want this model you built with tooling you barely understand to be deployed. Then your gross data scientist spaghetti code gets handed off to some one who actually has the skills to turn it into a robust deployable code base. I love that Python has brought a lot of people into programming and that it makes it relatively easy for domain experts to do advanced analytics. However, another side of me wishes that there were a less user friendly language being used for data analysis so that it would force all of these people to actually learn to code half-way decently.
- sakesun 7y ago"I was very disappointed in how the people who disagreed technically went to social media and started ranting that the decision process was broken, or that I was making a grave mistake. I felt attacked behind my back," May I ask who did he mentioned about ?
- DonHopkins 7y agoI don't know the answer to that question, but this post from February 10, 2006 captures some of Guido's frustration with the way certain contributors would insist on changing Python in ways in which they might be able to win an argument about syntactic disambiguousity and technical implementability, but at the expense of that ineffable sense of essential Pythonicity. https://www.artima.com/weblogs/viewpost.jsp?thread=147358 https://www.artima.com/weblogs/viewpost.jsp?thread=147358 All Things Pythonic Language Design Is Not Just Solving Puzzles by Guido van van Rossum, February 10, 2006. Summary An incident on python-dev today made me appreciate (again) that there's more to language design than puzzle-solving. A ramble on the nature of Pythonicity, culminating in a comparison of language design to user interface design. Some people seem to think that language design is just like solving a puzzle. Given a set of requirements they systematically search the solution space for a match, and when they find one, they claim to have the perfect language feature, as if they've solved a Sudoku puzzle. For example, today someone claimed to have solved the problem of the multi-statement lambda. But such solutions often lack "Pythonicity" -- that elusive trait of a good Python feature. It's impossible to express Pythonicity as a hard constraint. Even the Zen of Python doesn't translate into a simple test of Pythonicity. In the example above, it's easy to find the Achilles heel of the proposed solution: the double colon, while indeed syntactically unambiguous (one of the "puzzle constraints"), is completely arbitrary and doesn't resemble anything else in Python. A double colon occurs in one other place, but there it's part of the slice syntax, where a[::] is simply a degenerate case of the extended slice notation a[start:stop:step] with start, stop and step all omitted. But that's not analogous at all to the proposal's lambda <args>::<suite>. There's also no analogy to the use of :: in other languages -- in C++ (and Perl) it's a scoping operator. And still that's not why I rejected this proposal. If the double colon is unpythonic, perhaps a solution could be found that uses a single colon and is still backwards compatible (the other big constraint looming big for Pythonic Puzzle solvers). I actually have one in mind: if there's text after the colon, it's a backwards-compatible expression lambda; if there's a newline, it's a multi-line lambda; the rest of the proposal can remain unchanged. Presto, QED, voila, etcetera. But I'm rejecting that too, because in the end (and this is where I admit to unintentionally misleading the submitter) I find any solution unacceptable that embeds an indentation-based block in the middle of an expression. Since I find alternative syntax for statement grouping (e.g. braces or begin/end keywords) equally unacceptable, this pretty much makes a multi-line lambda an unsolvable puzzle. And I like it that way! In a sense, the reason I went to considerable length describing the problems of embedding an indented block in an expression (thereby accidentally laying the bait) was that I wanted to convey the sense that the problem was unsolvable. I should have known my geek audience better and expected someone to solve it. :-) The unspoken, right brain constraint here is that the complexity introduced by a solution to a design problem must be somehow proportional to the problem's importance. In my mind, the inability of lambda to contain a print statement or a while-loop etc. is only a minor flaw; after all instead of a lambda you can just use a named function nested in the current scope. But the complexity of any proposed solution for this puzzle is immense, to me: it requires the parser (or more precisely, the lexer) to be able to switch back and forth between indent-sensitive and indent-insensitive modes, keeping a stack of previous modes and indentation level. Technically that can all be solved (there's already a stack of indentation levels that could be generalized). But none of that takes away my gut feeling that it is all an elaborate Rube Goldberg contraption. Mathematicians don't mind these -- a proof is a proof is a proof, no matter whether it contains 2 or 2000 steps, or requires an infinite-dimensional space to prove something about integers. Sometimes, the software equivalent is acceptable as well, based on the theory that the end justifies the means. Some of Google's amazing accomplishments have this nature inside, even though we do our very best to make it appear simple. And there's the rub: there's no way to make a Rube Goldberg language feature appear simple. Features of a programming language, whether syntactic or semantic, are all part of the language's user interface. And a user interface can handle only so much complexity or it becomes unusable. This is also the reason why Python will never have continuations, and even why I'm uninterested in optimizing tail recursion. But that's for another installment.
- winter_blue 7y agoThis makes feel a bit sad/somber, because a lot of people are missing out on the exhilarating power of using advanced powerful type systems. I wish the ML community had picked up a few notes from Python, and built an Ocaml-like language with beginner-friendly Pythonic syntax (Reason comes close). I wrote about this here in the past (https://news.ycombinator.com/item?id=15549101); https://news.ycombinator.com/item?id=15549101); quoting myself below: I'm a big fan of strong static type systems. I believe type-safety increases code quality significantly. I used to think several years ago, that the main benefit of strong static typing was code safety / eliminating a whole class of bugs. But I've changed my opinion. I now think the biggest benefit is that it makes the code a lot easier for other people to read and understand. I mean I have multiple personal projects where I've used Python (which is a dynamically typed language), but these are small one-off projects. But I think when working in a team, especially a large team, having types becomes a huge thing. Having types for objects is especially useful. Having types forces you to think more clearly about the structure of your data. It's really sad when I see `foo(bar)`, and I have no idea what the type of `bar` is, and if it's an object, I have no idea what fields `bar` has. I have to simply guess the structure of the various implicit types by looking at the code (sigh). It makes the code difficult to read, and rather unpleasant to work on. Not to mention, all the multitude of bugs that come from duck/dynamic typing. I don't think good statically typed languages are hard to use at all. Type inference has spread everywhere that the old argument of having to repeat your types doesn't hold anymore. TypeScript, Flow (JavaScrpt), Haskell, languages from the ML family are really good at type inference. Even the `auto` type inference in C++17 was better than I'd expected. If dynamic typing continues to grow in popularity, I don't want to even begin to fathom the number of large projects that are going to built, which will suffer from a avalanche of TypeError-class bugs that could have easily been avoided with static typing. One encouraging sign I've seen in the Python world is that optional static typing is reluctantly being adopted in many circles. There was mypy for a while, and now, there's a new type checker called Pyre (written in Ocaml). I find hope in these little things.
- altmind 7y agoCan totally agree that python is eating the world, while in the same time being too opinionated on certain things and lacking in certain points. I would rather see lua more adoption - its the language designed right - minimal and logical, easy to comprehend quickly for anyone who got any exposure to other C-like languages. Easy integrations as a bonus.
- DonHopkins 7y ago>"In the past, it had always been clear that if there were a decision to be made about a change in the language or an improved feature, a whole bunch of core developers would discuss the pros and cons of the thing. Either a clear consensus would appear or, if it was not so clear, I would mull it over in my head and decide one way or another. With PEP572, even though it was clearly controversial, I chose 'Yes, I want to do this', and people didn't agree to disagree. This is a characteristically practical, effective Dutch attitude, known as the "Polder Model". The United States currently suffers from the opposite problem of extreme partisanship and gridlock. https://en.wikipedia.org/wiki/Polder_model https://en.wikipedia.org/wiki/Polder_model The polder model (Dutch: poldermodel) is consensus decision-making, based on the acclaimed Dutch version of consensus-based economic and social policy making in the 1980s and 1990s. The polder model has been described as "a pragmatic recognition of pluriformity" and "cooperation despite differences". It is thought that the Dutch politician Ina Brouwer was the first to use the term poldermodel, in her 1990 article "Het socialisme als poldermodel?" (Socialism as polder model?), although it is uncertain whether she coined the term or simply seems to have been the first to write it down. [...] Other uses The term polder model and especially the verb polderen (to polder) has been used pejoratively by some politicians to describe the slow decision-making process where all parties have to be heard. The model flourished under the "Purple" governments of Dutch prime minister Wim Kok, a coalition including the traditional rivals the Labour Party (a social-democratic party, whose colour is red) and the People's Party for Freedom and Democracy (right-wing liberals, whose colour is blue). In the declining economic climate of the early 21st century the model came under fierce attack particularly from right-wing politicians and Pim Fortuyn in his book entitled De puinhopen van acht jaar Paars ("The wreckage of eight years Purple"). Historical background [...] A third explanation refers to a unique aspect of the Netherlands, that it consists in large part of polders, land reclaimed from the sea, which requires constant pumping and maintenance of the dykes. So ever since the Middle Ages, when the process of land reclamation began, different societies living in the same polder have been forced to cooperate because without unanimous agreement on shared responsibility for maintenance of the dykes and pumping stations, the polders would have flooded and everyone would have suffered. Crucially, even when different cities in the same polder were at war, they still had to cooperate in this respect. This is thought to have taught the Dutch to set aside differences for a greater purpose.
- pc2g4d 7y agoIt's such a great language, and so incredibly slow :-/
- hnarn 7y agoProbably a kind of premature optimization on my part, but this is why I chose Golang over Python as my primary language. Maybe one day Python will have its own compiler without having to drop into writing C, who knows? For know I think the features of Go are just more attractive than those of Python.
- asperous 7y agoPython has a compiler without dropping into C (cython).. but it's mostly used these days for glue code between c and Python, or for small bits of code that need extra optimization. There is also Rpython and pypy
- pjmlp 7y agoWhile true, their adoption suffers due to them not being the way that 90% of the community deals with Python.
- yesenadam 7y agoI do most of my programming in Cython these days, mainly maths/graphics-related, but all kinds of stuff. It's great for that! I do the intensive calculation parts with typed C variables, structs, arrays, at C speeds, while doing the once-only stuff like loading and saving images in pure Python. I guess it's weird floating between C and Python from line to line in a program, but I like it a lot. (Not having to type semicolons and curly braces anywhere is no small benefit also.)
- deltron3030 7y agoWhat I find baffling is that almost every program I'm interested in as a creative power user has a Python API for scripting, from type and graphic design to 3D modeling, rendering and music making. I'm a bit into web design/frontend as well, and was thinking about either learning JS and Node more deeply, or add some other "backend language" like PHP or Ruby, and learn their frameworks like Laravel or Rails. Should I pick Python, Django or Flask instead to cross the gap to my creative hobbies?
- _bxg1 7y agoThe data synergy of Node + Web is hard to beat, and JS is very elegant for writing asynchronous code. Also, I've found the web (canvas, svg, webgl with Three.js) to be an amazingly hackable creative platform. Just my two cents.
- rhodysurf 7y agoFlask is pretty easy to get started with, Django is a batteries included monster.
- DonHopkins 7y agoIt's so refreshing to not see anyone here whining about Python forcing them to indent their code properly. The kind of people who think that's a PROBLEM instead of a FEATURE really should not be ever writing any new code, and instead should be punished by forcing them to maintain other people's code written with that same lazy misguided attitude, until they recognize how self indulgent, inconsiderate, and disrespectful that is not just to other people who have to read their code, but also to themselves. The same kind of people criticize Lisp for having too many parenthesis, then go on to write unintelligible shell scripts, Perl and C++ code chock full of skewbald menageries of sigils and punctuation bound together with a towering inferno of precedence rules, terribly worse than Lisp's "too many parenthesis".
- johnydepp 7y agoAnd by mentioning it your ruined the pleasant reading.
- kazinator 7y agoThe best, brightest and most informed/experienced people who do not think it is a good idea for significant whitepace to be the determiner of syntactic nesting do not hold that position because they would like to inflict badly formatted code on their maintainers. You've invented a stupendously silly strawman.
- DonHopkins 7y agoThat's a stupendously anonymous appeal to authority you've made there, and it's unclear what argument you're actually saying without some explicit parenthesis around all those deeply nested phrases, or some kind of grammatical diagram. Can you please restate how we disagree in a few simple sentences? Are there any names or links or citations or concrete examples you could add to support your argument and help us respect your authority? Speaking of best, brightest and most informed/experienced people: Have you ever used Dave Winer's outliner based scripting language, "Frontier"? Since the syntax of the scripting language is actually a structured outline, it's impossible to indent your code improperly. It's not that white space is significant, it's that no white space or brackets or begin/end keywords are even necessary, because your code is simply an outline. https://news.ycombinator.com/item?id=20425970 https://news.ycombinator.com/item?id=20425970 After the success of MORE (an outliner and slide renderer for the Mac), he went on to develop a scripting language whose syntax itself (for both code and data) was an outline. Kind of like Lisp with open/close triangles instead of parens! It had one of the most comprehensive implementation of Apple Events client and server support of any Mac application, and was really useful for automating other Mac apps, earlier and in many ways better than AppleScript. https://en.wikipedia.org/wiki/UserLand_Software#Frontier https://en.wikipedia.org/wiki/UserLand_Software#Frontier http://frontier.userland.com/ http://frontier.userland.com/ Then XML came along, and he integrated support for XML into the outliner and programming language, and used Frontier to build "Aretha", "Manila", and "Radio Userland". http://manila.userland.com/ http://manila.userland.com/ http://radio.userland.com/ http://radio.userland.com/ He used Frontier to build a pioneering fully programmable content management system, blogging and podcasting platform, with a dynamic HTTP server, a static HTML generator, structured XML editing, RSS publication and syndication, XML-RPC client and server, OPML import and export, and much more. He basically invented and pioneered outliners, RSS, OPML, XML-RPC, blogging and podcasting along the way. Frontier certainly had its problems, but it was enormously successful. I think it's a good idea to learn from Dave Winer's experiences successfully designing and using practical powerful scripting languages. Dave Winer's second outliner screencast: https://www.youtube.com/watch?v=mgUjis_fUkk https://www.youtube.com/watch?v=mgUjis_fUkk Dave Winer's the many lives of Frontier screencast: https://www.youtube.com/watch?v=MlN-L88KScw https://www.youtube.com/watch?v=MlN-L88KScw Dave Winer on The Open Web, Blogging, Podcasting and More: https://www.youtube.com/watch?v=cLX415mHfX0 https://www.youtube.com/watch?v=cLX415mHfX0 >UserLand's first product release of April 1989 was UserLand IPC, a developer tool for interprocess communication that was intended to evolve into a cross-platform RPC tool. In January 1992 UserLand released version 1.0 of Frontier, a scripting environment for the Macintosh which included an object database and a scripting language named UserTalk. At the time of its original release, Frontier was the only system-level scripting environment for the Macintosh, but Apple was working on its own scripting language, AppleScript, and started bundling it with the MacOS 7 system software. As a consequence, most Macintosh scripting work came to be done in the less powerful, but free, scripting language provided by Apple. >UserLand responded to Applescript by re-positioning Frontier as a Web development environment, distributing the software free of charge with the "Aretha" release of May 1995. In late 1996, Frontier 4.1 had become "an integrated development environment that lends itself to the creation and maintenance of Web sites and management of Web pages sans much busywork," and by the time Frontier 4.2 was released in January 1997, the software was firmly established in the realms of website management and CGI scripting, allowing users to "taste the power of large-scale database publishing with free software." https://en.wikipedia.org/wiki/RSS https://en.wikipedia.org/wiki/RSS https://en.wikipedia.org/wiki/OPML https://en.wikipedia.org/wiki/OPML https://en.wikipedia.org/wiki/XML-RPC https://en.wikipedia.org/wiki/XML-RPC
- peter303 7y agoPython is a prototyping language, but not a serious software engineering languagebfor large and fast projects.
- flyinglizard 7y agoI feel like the world has gone insane when it comes to Python. Or have I gone insane? Python is an incredible waste of time. No types, IDEs that suck (a side effect of not having types), very partial validation with linting tools that are an afterthought to the language, indentation is a mess (good luck moving files between different editors and environments or through clipboards), slow, agonizing deployment (pyenv? Come on). I’ve been doing C# these past two years and it is laughably effective in comparison, almost like cheating. Standard libraries covering almost anything, tooling that couldn’t get any better, runs everywhere, lighting fast builds. Most importantly, in C#, due to the incredible tooling and language design, if it’s built successfully then there’s a very high chance it’ll do what I want it to right out of the bat. In C/C++, much less so. In Python it’s almost guaranteed not to do anything but crash unless I’ve ran everything through in depth coverage testing and I’d still take the C# build checking every time. My Python is pretty good, and I’ve known it for more than 15 years now. I’m not taking this position out of ignorance. For the love of god, go learn a proper language. It can be C#, which I think is as perfect platform/language as anything, or Rust or Go or even Java. I see young devs on their vim or Sublime editors developing Python and I want to shout to them, that’s not how it’s done. You’re missing out on decades of industry evolution and know how in things like the Visual Stdio and .NET or even Java and JetBrains/Eclipse. You’re using stones to start fires where you could just use an oven. I still use Python, but it’s always for very short and specific programs. It’s just a bad tool for more than that. If you are unable to resist the temptation of using Python for that short program, just make sure it never ever has a chance to grow. Regrettably the ML world lives on Python, fine; let them have it.
- pjmlp 7y agoThere is hope still. I hope that Julia eventually makes such a hit that performance gets taken more seriously as part of Python devs (yeah there is PyPy, but gets seldom used in the field). I am like you though, my introduction to Python was version 1.6, and due to my experience with its performance, I never used it for anything beyond shell scripting on steroids. As proven by Smalltalk, Dylan, Common Lisp and JavaScript, dynamism doesn't need to be slow.
- 6gvONxR4sf7o 7y ago
- ashishb 7y agoI find Python to be a great alternative to writing bash scripts. I did that with this semi-popular Android tool (https://github.com/ashishb/adb-enhanced https://github.com/ashishb/adb-enhanced). Python is close enough to be a language but straight-forward enough to be a shell script. For the Python haters here. No, Python is not as good as GoLang or Kotlin for maintenance but IMHO, it is better Javascript/Typescript/C++ for writing non-performance critical code.
- coleifer 7y agoWhat stood out to me: online bullying (dressed-up sometimes as concern/outrage) is what led to Guido stepping down. Python is great, but it will never be perfect. But the outrage stuff, the entitlement stuff, essentially anything that happens on Twitter... Python seems like a victim of it's own success. Once it got popular, it couldn't scale the checks that might have stopped this runaway train of shit-tweets and bickering on the mailing list. Personally I don't like a lot of the things that have happened in 3 (asyncio, type whispering, fstrings). I can't help but wonder if, again, this is due to becoming too popular too fast. I say that because aesthetically these features seem to go against the Zen of python. May you never have users, but if you do, may they not have Twitter accounts!
- FranzFerdiNaN 7y agoI dunno, R is also exploding in popularity but it seems to be able to manage itself really well. To the point of successfully creating an environment that attracts women and other underrepresented groups towards it.
- wil421 7y agoWhat’s wrong with fstrings? I use JavaScript at my day job and leaning python for Raspberry PI projects. Fstrings looks like it’s better than .format or + concatenating + a bunch is strings. Especially large strings.
- neya 7y agoI am currently writing Python based software for a client on serverless architecture. Honestly, I really feel like myself and a lot of people I know use Python only because it has some useful libraries like Pandas compared to other languages. In addition, the effect of 2.xx and 3.xx fiasco can still be felt during development. These days, I really wish I could write my stuff in Elixir, but too bad its data science eco-system isn't as strong as python's. In the very least, even Ruby as a fallback is much much better to write code with since its philosophy is drastically different from Python's - "Optimize for programmer happiness (Ruby) vs Fuck the programmer and optimze for computers (Python)".[1] [1] https://rubyonrails.org/doctrine/ https://rubyonrails.org/doctrine/
- Daishiman 7y agoThis a complete misrepresentation of the Python philosophy and a cheap troll.
- neya 7y agoWhat makes you think it's a cheap troll? Please read the doctrine on how drastically different Python's philosophy is. The interpretation - It's my opinion. Take it or leave it.
- Daishiman 7y agoZen of Python. There are good reasons why a lot of the language is the way it is and it optimizes for developer happiness exactly by not letting you do everything under the sun. Some languages take this to an extreme with its type systems or coding guidelines. For a lot of people Python is a very happy medium for a large subset of a lot of software written out there.
- agumonkey 7y agoSaying this again, is this a cover effect ? I'm strongly thinking that python reign just peaked, and that either python will change drastically into a more solid static core or people will go Julia..
- TekMol 7y agoTwo things I don't like about Python: 1: No seperator sign like ";", so you cannot express everything you want in one line. Oneliners are often so useful that I don't want to live without them. 2: By default, it caches the bytecode on disk. This is slow and spills those files into the filesystem. I prefer PHP in this regard, which caches the bytecode in memory.
- Maledictus 7y agoAnybody else sad that this is not Ruby?
- randomsearch 7y agoAccording to people who work with a lot of programmes teaching coding, the reason python is so appealing to new coders is the syntax. Particularly the lack of braces, the indents, the nice keywords, that make reading code much easier to a newcomer. Having taught both python and JavaScript, I can tell you that the former is far far less confusing to newcomers than the latter. Imagine explaining the problem with equality comparison or prototypes in JS to someone who just learnt what an IF statement is. The reason I agree that python will dominate programming for decades to come is the batteries included and pythonic approach that enables people to do cool things with just a few lines of code. As a result of the above, the ecosystem has reached critical mass. For most tasks there’s a library that does that, and it’s good, and it’s easy to use, and the developer of the library usually doesn’t expect you to understand their opinionated philosophy to use it. I love the python convention of putting a minimal example on the homepage of a library. You’re not going to get your average developer to appreciate the beauty of Lisp or the value of static typing. They want their ML to work, or their graphics to display, that’s all. Ends not means, almost entirely, for most people who aren’t full-time programmers. Let’s not hate on a language that opens up programming to the world, unless we want to be gatekeepers. If you want to maintain an air of superiority, just learn Lisp or Haskell or C++ and write code that’s “deeper” into the tech labyrinth. Programming will probably specialise into “end user programming” and “Service and system programmers”. Embrace the democratisation of coding.
- reallydontask 7y ago> Particularly the lack of braces Since most of my professional experience is with C like syntax languages, I don't get how the lack of braces is an advantages, quite the opposite in my limited experience with Python. Braces define scope unequivocally, they are easy to visually parse and don't care whether you are using tabs or spaces or even if you, loud gasp, mix them. Furthermore, you can copy and paste, say for loop from a method to another method and it will work. In Python you might have to faff about with spaces (I'm sure there must be IDEs that solve this problem but it was no fun on vim or even notepad++)
- retube 7y ago
- mixmastamyk 7y agoOne thing very interesting about Python is how gradual the ride up has been. Perl dominated then sputtered. Java shot up and hit the ceiling. C# is mostly limited to Windows, JavaScript mostly to the web. Ruby stole the spotlight for a few years and then faltered mysteriously. Others found their niche. But Python just keeps chugging along slowly gaining ground almost everywhere like a tortoise to multiple hyped-up hares.
- xxxpupugo 7y agoThe part that Python really bothers me, as someone who had write Python for almost 10 years, and right now doing it professionally, though personally I don't consider myself a Python developer rather than a Python senior user, is actually obvious to nail down, and frustratingly, difficult to handle. SLOW. The sin of all. I don't want to make other arguments with people who just come to repeat 'Oh you can make it fast, you are doing it the wrong way'. Sorry, I have heard that 100 times, now is sounds like bug-as-feature excuse to me. Sorry, but Python is just slow. All the stuff people might bring up is just trying everything to bypass Python itself. Multiprocessing is hell to work with, buggy and unpredictable. Cython is OK but it is not Python. Python's slowness is like cancer, and terminally so. Down deep, it is because its overtly flexible/loose type system, the never-going-away GIL, and prematurely exposing of C-API makes it almost impossible to optimize without breaking the existing compatibility. And most importantly, I don't think it is solvable, truth is the patches are so integrated, people already forget what problem they tried to fix in the first place and just live with it. But it will haunt Python in long term though, people will be struggling with Python in performant production until they start reimagining a world that without Python. Maybe a better Python in that sense.
- metroholografix 7y agoSame here. I've used Python daily or almost daily for the last ~10 years (thankfully I've used other languages too). I've architected reliable systems on top of it but it was obvious to me almost from the get-go that Python is a terrible language. I credit my previous years of programming in Lisp that trained my mind to see through the Python mirage. One issue is that veneer of Python user friendliness that lures people, usually those who are new to programming or don't have extensive experience with _multiple_ languages, in. The major issue for me is that Python lacks internal consistency and is based on a inverted-design (meaning, no design really) that accumulated over the years and stinks. This makes it really easy for people to use Python and write unmaintenable code but also very hard for them to find out how to write good code. The hallmark of a terrible language is making good code hard to write. As far as specifics, I think the module system is a joke, the packaging even worse, the REPL is not really a REPL (in the Lisp sense), ctypes is bad and has 100 different ways you can hang yourself with, there are tons of gotchas in the language and standard library that if you haven't memorized [usually by running into them], they will bite you hard, the GIL ties my hands, iterator/generator obsession makes for really bad code messes if people take it seriously and start poorly designing their APIs around it, absence of proper lexical scope, statements are not expressions and led to gross hacks like PEP 572... I could keep going for days. Python is really the PHP of the 2010 generation.
- paulcarroty 7y agoSwitch to JS was like obtaining new home, don't want to write Python code anymore. Also "Eating the World" isn't correct anymore, 'cause Python popularity decreasing last ~5 years according to Github stats.
- Agentlien 7y agoWhat stood out to me, reading the comments, is how among the first few comments I read there were 4 comments from people with decades of experience writing python professionally. Each stating their dislike for the language and citing entirely different parts of the language as its biggest problem. Personally, I'm primarily a C++ programmer with about a decade of professional experience in C++. I also used to do daily work in C# for a few years. For me, python is a language which I use for making simple command line tools, for processing input and clobbering together different tools. I use it to build interfaces which streamline certain workflows. Essentially, I use it as a more powerful replacement for bash or batch. For that purpose, I find that the language works wonders and is quick and easy to work with.
- mantap 7y agoThe problem is that when they did the big Python 3 transition they didn't fix the real pain points (with the exception of string types), many of the things they fixed were not a problem, or worse they removed things that were actually useful. Such as the infamous print statement. So now they can never fix the real problems, because everybody is so traumatised by the Python 3 transition. I'll also say that the rate of development of Python is incredibly slow, slower than even JavaScript's TC39 if that's possible. I waited my whole Python career to get format string interpolation.
- moosethemucha 7y agoI've been told that my choice of python was poor numerous times. 'Do java/.net' etc. is something I've heard all throughout my career. I use python because it doesn't work against me - It's not the best language but I think its definitely the most versatile. I love python and it will be around for another decade I guarantee it.
- hajderr 7y agoI've not written that many heavy applications in Python (Java mostly). I do like the dynamic nature of it. I find myself leaning more towars dynamic these days, appreciating Javascript today as well. I like the v.env side of Python. Many languages have this plumbing to get a project started and Python is the most comfortable of them all. Python is smart. Python is easy to teach also.
- cryptica 7y agoThe number of views of questions on Stack Overflow is a bad metric to measure language popularity. This metric combines popularity and complexity/unintuitiveness. If a language is half as popular but twice as complex (or unintuitive) as another language, then it will get the same number of questions and same number of views. If the language is becoming more fragmented; more different kinds of frameworks and tools then it will translate to more questions on stack overflow. Fragmentation of the language is not necessarily a good (or bad) thing but it has nothing to do with the popularity of the language. But definitely the JavaScript ecosystem is pretty homogeneous at the moment (ReactJS or VueJS on the front end and Node.js on the backend).
- lucb1e 7y agoFor what it's worth, I have none of the issues the currently top voted comments describe. Dependency hell (apt does that for me), closer to burnout any time I work with it, would rather work with C++ (a language with a completely different purpose)? If the author of the article had written this, people would fall over themselves to say how wrong they are. Nearly everyone who tried Python loves it. From this thread you'd think we're talking about Visual Basic for Applications. There is a reason Python is one of the most popular languages. PHP was popular because it's quick and dirty, but Python is popular because people love working with it. The arguments in this thread are beyond me. (They're also unsubstantiated, but if I ask for substantiation I'm sure someone can rationalize some reasons to dislike any language, so that's pointless.)
- newbie578 7y agoInteresting article, I would love to read one regarding Java and Kotlin, or if even someone here would share some knowledge with me, I would be grateful. Is Java dying, what is its future? Where is Kotlin heading, currently it is the hottest language for Android development, can it also compete with Python in some branches?
- rainygold 7y agoJava moved to a six month release cycle and it has breathed new life into the ecosystem as a whole. Its one of the most robust and important languages out there. Java will likely never truly die because of legacy applications. It's also still firmly set in the market and that is not looking likely to change in the future. Its also the king of microservices with Spring Boot. Kotlin could well take over the mobile space. Many of the touted benefits of Kotlin are slowly being added to Java itself. Java itself may decline as a language, but I'm near certain that the JVM will be with humanity forever. Someone will be programming in a JVM language somewhere. Whether it's some future language or Java 532.
- Jerry888 7y agoI have used all code from c+, java, php, javascript, ruby and more and found python is the easiest and simplest to use (you do not have to setup 5 classes to declare 1 variable) the only thing i hate about python is there is no built in parser to handle formatting. Which is a simple but big design flaw for me.
- ragerino 7y agoI would argue that Pythons biggest issue is performance, which translates in large applications directly into costs. You will need more machines to scale and you will need more power per operation compared to other programming languages. see here: https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/python.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... I think Python makes sense for prototyping and stuff like Jupyter Notebooks. But once mature and going into production I recommend porting stuff to something faster like Java or even Javascript nowadays.
- zuuow 7y agoLet's count the minutes until someone comes saying "but you can just write C and bind it to Python", completely missing the point.
- Ensorceled 7y agoHoly Crap! What a lot of irrational, hyperbolic hate for Python. I think everybody should spend their first couple of years working in Fortran IV on IBM TSO/ISPF. No dependency management because you had to write everything yourself. Or maybe [edit: early 90's] C or C++ development where dependency management meant getting packages off a Usenet archive, uudecoding and compiling them yourself after tweaking the configure script. I'm not saying Python is perfect, but if it's causing your burnout/destroying your love of programming/ruining software development you seriously need some perspective.
- einpoklum 7y agohttps://conan.io/ https://conan.io/ https://vcpkg.readthedocs.io/en/latest/ https://vcpkg.readthedocs.io/en/latest/ You were saying about C/C++ package management?
- rpedela 7y agoHistorically, that is a relative newcomer to the C/C++ world. You completely missed the parent's point.
- vkazanov 7y agoYes, pls, go on and tell us how it's a default package management tool for C/C++... It is a step forward, sure, but it's a far cry from Python's pip or Rust's Cargo or even Dlang's dub.
- einpoklum 7y agoPython's PIP? Or do you mean Anaconda? Or VirtualEnv? Or Poetry, which someone here has pointed to? Also - you're moving the rhetorical goalpost. First you claimed there was no package management system, no you're complaining about the lack of default.
- foldr 7y agoGiven that OP was talking about getting C/C++ packages "off a usenet archive", I think it's clear that they were talking about what coding C and C++ was like two or more decades ago.
- captainbland 7y agoI wonder what the consequences of this are given Python's apparently very poor energy consumption profile: https://thenewstack.io/which-programming-languages-use-the-least-electricity/ https://thenewstack.io/which-programming-languages-use-the-l... It appears to consume over 17x more power than JavaScript, 40x more power than Java or 75x more than C/Rust. The only language which performed worse than it in terms of pure power consumption was Perl. While I'm sure these results aren't exactly indicative of day-to-day usage as they're based off of benchmarks which are not exactly representative of day to day use cases it nevertheless raises the question of whether Python is an appropriate choice of language where the application itself is likely to see a high level of total use. I suspect the answer is "more work needs to be done" on the subject to truly assess the impact and a big part of the answer is "depends on how you're using it". It'd be good to see some standardised tests of web frameworks. For instance, load testing a standardised server side version of the TodoMVC project to determine what happens for each framework there, along with what happens when you stick a cache in front of them and so on. It'd also be interesting to attempt to estimate how much power consumption and hence CO2 generation each given programming language is responsible for given their marketshare and typical usage profiles - although I suspect in practice this would be quite difficult given the diverse usage profiles of modern programming languages. And obviously the fact that machine learning libraries, for instance, will naturally be quite energy intensive - it's probably the case that Python actually does quite well there because most of its popular libraries for that are just wrapping C or similar rather than being pure Python code. Given the success of V8 and PHP7 in terms of boosting the performance and presumably energy efficiency profile of their respective languages it'd be nice to see the mainline CPython interpreter undertaking a similar kind of transformation. Obviously we have things like PyPy but it seems to me the Python community needs to be united around a solution to this which forks simply are not going to be able to drive.
- mixmastamyk 7y agoFind the hot parts of your app with a profiler, then augment them with Cython to boost efficiency 10-100x.
- Dowwie 7y agoWhile I use more than just Python in my work, it remains my go-to toolset for a range of tasks. For instance, Python offers the best interactive programming experience of any language today. You can step through code flow and inspect values with great ease. This is particularly valuable during prototyping, as you are getting a handle on interactions between your application and third party dependencies. Further, as designs take shape, you can quickly assemble a proof of concept and learn how to address a problem or design. Python can be used with little or any inheritance. Adopt a compositional style. You can assign types. You don't need to use all of its bells and whistles if you don't want to. This allows you to use Python in a way that streamlines it for porting to a strongly typed, high performance language such as Rust, should the need or desire to do so ever arise. The Python community is truly global, hosting local events in hundreds of countries. So many talented, helpful people have been dedicated to the language and community over a very long period of time. Look at its ecosystem on GitHub to get an idea of how that manifests. Questions about how to solve a problem are often a single search away from being answered on Stack Overflow, Google groups and countless channels on Freenode IRC. Python conferences are a great place to learn and connect.
- mobilefriendly 7y agoThis is wrong in terms of the web space. With the modernization of PHP and the emergence of Laravel, and continued evolution of Drupal and Wordpress, I don't think PHP has ever been this dominant in the web stack. Django is an also-ran.
- jasoneckert 7y agoI recently gave a Python book to a co-worker that wanted to experiment with deep learning. Co-worker: Wow - this book is like 900 pages long! Me: Don't worry, it's mostly whitespace. And that is one of my favorite features of Python - easy to trace and code!
- sunaurus 7y agoAm I correct when I assume that most of the people hating on Python here are using it for medium or big projects? I feel like the dev community figured this out ages ago: Statically typed languages are easier to read, harder to write, dynamically typed languages are easier to write, harder to read (and also harder to refactor). For small projects (scripts, prototypes, etc), you don't care about readability, you just want it to be as easy to write as possible. Python really shines here. For bigger projects, using Python is painful, but that's also the case with pretty much any other dynamic language..
- mixmastamyk 7y agoLooks like a lot of folks are using the wrong tool for the job. Reminds me of that onion article about chastising a dog for being a dog. Found it: https://www.theonion.com/dog-chastised-for-acting-like-dog-1819566352 https://www.theonion.com/dog-chastised-for-acting-like-dog-1...
- ryuukk_ 7y agoold languages decided backward compatibility should be maintained, result is: bloated runtime and you have python, decided to drop compatibility with previous version and is now still #1 .net / java / c++ they are diying because of their bloated and heavy nature
- ModestasJ 7y agoI think the growth of Python is mainly due to it being a popular beginner language. Like they have a graph in the article that shows the number of question view per month and Python is dominating. But, of course, it will be. For Python to eat up the world, it needs to start being the primary language for real world programming languages, but it is not.
- GnarfGnarf 7y agoDynamic typing does not scale.
- cztomsik 7y agoI like a lot of things in python, but unfortunately, everytime I happen to use anything which uses python, there's a good chance it won't work on my environment. And so I'm very surprised how python can be so successful if it doesn't actually work. I literally fix my env for some tool A, only to make it incompatible with tool B. And I can't believe I'm alone.
- mark_l_watson 7y agoWell, I could be put in the ‘Python hater’ category: I do love Python for short programs using TensorFlow, the SpaCy NLP library, PyTorch, etc. I really hate using Python for large applications. Everyone gets to choose their own favorite languages, and for me that would be Common Lisp, Haskell, Java, or Scala for working on large projects. Each to their own though.
- vincent-toups 7y agoIf you ask me the world only needs two programming languages, Scheme and OCaml and it would be better if OCaml had s-expressions as syntax.
- AnimalMuppet 7y agoThere are more things in the computer programming universe than are dreamed of in your philosophy. (With apologies to William Shakespeare...)
- vincent-toups 7y agoThat is why we have syntax-case.
- AnimalMuppet 7y agoNon sequitur? (That is, your comment does not seem to follow whatsoever from mine.)
- vincent-toups 7y agoSuppose there are more things in the programming universe than are strictly represented in (say, R5RS) Scheme. Because Scheme has things like continuations and syntax-transformations, we can put them into the language.
- blumomo 7y agoReading all the comments here I have the impression that there are 2 groups of programmers: There's one group that uses Python regularly and which is getting their stuff done right now. And there is the other group which has time to complain about Python.
- safgasCVS 7y agoI cant comment on general software engineering but in the data science domain coming to Python from SAS / SPSS feels like being given free superpowers
- pelasaco 7y agoMaybe it's right for the data analysis world, since jupyter, pandas, matplotlib and anaconda form a better stack than R.. however for the web development, if you don't go with rails you will start to ask yourself: why python is better than Go, Node.JS, etc" ?
- C1sc0cat 7y agoThe comment "Meanwhile, the Unix shell had different problems -- it offered a suite of utilities for common tasks, but ran so slowly it couldn't handle complex logic." This doesn't make sense and also why the F is the " Dutch national research centre for math and computer science. " using c and nor Fortran
- zer0faith 7y agoYou can't deny Python is versatile language with a moderate learning curve and packages that will do almost anything. These things have made me more productive programmer and allowed me to get stuff done in a reasonable amount of time.
- lame88 7y agoPython’s killer feature - and perhaps reason for its popularity- seems to be it’s nice-looking syntax, which is only the most superficial of qualities. Below that surface, the semantics and its standard libraries are all very irregular, and always leave a bad taste in my mouth. I now avoid touching it if i can.
- zettaquark 7y agoI love Python but.... I would not go to the lengths that this article proposes. The dev world recreates itself every year with dozens of new high level languages and task specific support libraries. Every developer has their favorite language (Everyone is comfortable with their personal preference) That being said, I enjoy Python and it provides a quick, easy script to accomplish task in my space but I would not go as far as the article in saying that it is the end all be all for everyone. Use what you like, and understand that all languages have strength and weaknesses for task.
- chrisfinazzo 7y agoIs there a reason people don't choose Perl much anymore? It's a fine scripting language and supports the UNIX C API almost full stock. ^ Another Siracusaism, who's still - by his own admission - a Perlhead.
- mixmastamyk 7y agoIt doesn't scale to multiple developers, even more poorly than Python.
- blargmaster33 7y agoUsing whitespace for indentation is dumb.
- Tehchops 7y agoWow. uBlock registers at least 50 unique blocks, and my laptop still churns trying to load all the extraneous ad content ZDNet tries to jam down the pipe. ZDN stopped being journalism long ago
- kamyarg 7y agoIf you hate python, just write whatever your hearts desires. There is no use in saying "oh python does not let me know when a variable I expect to be list is string", well yes, it is a dynamically typed language, please learn the difference between dynamically and statically typed languages before hating on any language. As a bonus, you can check if a value is list or string and throw your own error, python is versatile, although it probably would be an antipattern and you should go back to writing C. If you love the good old days of Fortran, then I am sure many Financial Institutions and Aerospace industry or old school mathematicians would love to have you.
- higherkinded 7y agoAnd that's a sad thing to hear. Before my death by thousand downvotes, I'd like to tell you why do I feel that way. Back in the day when I was way more inexperienced than I'm now, I was a die-hard Python fanboy. To me, it seemed like a best option available due to it being way more concise and readable than JS/PHP, not to mention that it was way more powerful and dense. I didn't really bother with type safety at the time and I wasn't exposed to any real criticism of it at the time, as it happens often when you're just too new, and I was more than fine with it. Time mercilessly marched forward since then. I worked with different codebases, changing tech stacks and languages a bit, learning new stuff and so on. With some experience, lots of self-education and a vast amount of different workflows to compare with, I've realized one important thing. While Python may be better than some languages that are considered trash by industry consensus, it's also a trashcan language to ones with sound and flexible type systems, not to mention that, across dynamically typed contenders, it's nowhere near as powerful as literally any solid Lisp. That said, I feel bad for the industry that "dives into Python" more and more over the last years. While it may seem like a pretty easy and cool-ish language to write in, you will inevitably have large problems at scale, it just doesn't have what it takes to be easily scalable, and most importantly, it's just tedious to refactor when it's big, even though the language itself is mind-numbingly easy and even your grandma can jump right in. In a conclusion I'd like to say that you'll be better off without using Python as your project's main driver. Yes, it's simple to write it and the developers supply is abundant. It's easy to start. It'll just be a major pain to scale it and support it later on. Edit: Made a pun.
- joshuamorton 7y ago> sound and flexible type systems Python has a more powerful type system than any mainstream language except for C++ (templates). No other mainstream language has support for explicit marking of variance of arguments, nor does any other language support literal (dependent) types, except for typescript.
- higherkinded 7y agoAnd how's it helping you verify the correctness of your codebase at compile time (it still compiles the source to byte-code before evaluation)? Last time I checked, it didn't care too much about type annotations, and it didn't type-check anything before execution without additional shoehorning. >No other mainstream whatever C#, Rust. Notice that I don't even mention my man Haskell or Scala while the latter one is really big. >literal (dependent) types Uh, even Java has dependent types, anyway. Read the docs. >templates Yes, that's parametric polymorphism. No, it's garbage in C++ to the point where you can't guarantee the soundness of a template. It's done in Java, Kotlin, C#, TypeScript, for the most mainstream ones, not to mention that (and how exactly) it's done in Haskell and Scala. Edit: How do you feel about type-level programming, anyway? ;)
- seisvelas 7y agoI really hoped Julia would become a major player in scientific computing and data science, but it looks like ever less probable. I like Python, but for science I like Julia more.
- sgt101 7y agoIt's easy to get going on it, it's productive for writing scripts and experiments. It's dreadful for programming in the large, but only in comparison to languages designed to take account of the lessons learned about large code bases and team working. Most programmers have never encountered these and have very little idea of what they are missing.
- amelius 7y agoIs it fair to say that Python is the new BASIC?
- karl11 7y agoI am just happy to see that debates on whether some programming language is awesome or the worst are still popular on HN.
- rafaelvasco 7y agoA joy to write and read. But a pain to debug and maintain. Coded a big project in Python once. When the project was still small everything was perfect. When the project grew it became unsustainable. Of course I was an already experienced C# dev, just getting started with Python but the problem is there. A whole lot of errors spilling to runtime is a big pain. But that's a problem with every dynamic language at variable levels.
- mixmastamyk 7y agoTools, tests, and logging are the cure to those troubles. I've not experienced substantial problems with projects large or small. If a project is known to be huge up front and/or some developers will be inexperienced choosing a language with additional guardrails would be prudent.
- enginaar 7y agoNever had the chance to use python but what I hear most about Python is that it's easy to develop/saves developer time. Is it still true when maintaining a project vs developing from scratch?
- breatheoften 7y agoIt’s really terrible that python should be growing. It’s a bad language and a bad ecosystem ... The knowledge exists that we shouldn’t be encouraging systems to be built with the patterns/tools commonly advocated in the python world — at what point do we acknowledge that the forces promoting this kind of ecosystem are essentially propaganda-like mind viruses ... so much future suffering that will not be prevented ...