29 ms·
Why Python keeps growing, explained
- flohofwoe 4y agoI used Python for the last 10 years or so for all sorts of cross-platform command line scripting stuff, but watching Python3's progress I have the impression that this simple use case is no longer their main focus (I sometimes wonder if there's any focus or vision at all tbh). After having tinkered with Deno for the last 2 weeks or so I must say that this is indeed the 'better Python' (for me at least, and not because of Typescript - the language is more or less just an implementation detail for writing command line utilities - but because of Deno's approach to package management).
- gopisuvanam 4y agoPython has been my favorite for products and scripting. I've been advocating for Python's dominance when the world was after Java. But now I'm more inclined towards JavaScript. And agree with you Deno is taking the right approach (as opposed to nodejs). Having JavaScript in the front end and backed both can reduce resource requirements as well.
- t43562 4y agoI learned Perl first and found it incredibly useful just because of regexps but Perl programs got messy as they got larger. Python regexps are just that bit less convenient and that trivial amount matters but in python I feel that once you get to writing functions and perhaps even classes it accelerates far ahead of Perl and you can write understandable, maintainable large programs in Python. You're not forced to dip into the OO side of things though and I've heard people suggest to me that Python is a language where no rules apply and no structure exists. They feel that they can dive in without the care they would have to take in Java or C++. I think they are very wrong but you can certainly write terrible code if you want and perhaps this "all-things-to-all-people" aspect of it is part of the success.
- gorgoiler 4y agoWell said. The core to Python’s success, for me, has always been its system for containing code inside modules and for importing and exporting symbols between those modules. Understandable code is maintainable code. Abstraction makes comprehension possible — imagine if every call to print were an inline block of assembly instead! — and Python’s modules provide a very quick and easy way to break up large code into small modules.
- gorgoiler 4y agoThe comparison with Java is always a funny one. Consider this: import sys def main( args: list[str], ) -> int: sys.stdout.write(“hi\n”) return 0 sys.exit(main()) Apart from the call to write instead of print everything else there is a standard Python pattern for writing testable, type-safe arg-parsing code! It’s just that you don’t have to write testable, type-safe code if you don’t want to.
- marginalia_nu 4y agoA lot of Java's verbosity isn't so much from the language, but from when the code was written. It happened to come to popularity at a time when big over-engineered Gang of Four-style design was hot. So you get a lot of code written in this over-engineered fashion where half the classes have names that end in DelegateFactoryFacadeMessengerImpl. Some of it is the language too, but modern Java can definitely be reasonably terse. Record classes has done a lot for the language, so has lambdas and streams.
- _glass 4y agoJava is still good for several use cases, which were popular at the time, or let's say much more code was needed. Now in the Enterprise world you have much better no- or low-code tools. But in large teams all of these public/private/protected key words are quite nice. Totally unnecessary for a small codebase. But Java with its great runtime, verbose patterns is great for web server applications in large teams. I would still use it as the foundation for a tech company, but not for the Fortune500 company that needs some customization. Where is no alternative where you can find people, and has the stable properties. Maybe Rust if you have the clout as a company. Otherwise it's too expensive.
- gorgoiler 4y agoProtected data was never as useful to me as package-only data. The former is only relevant with inheritance hierarchies, whereas the latter is more open while also restricting access only to other classes in your com.example.concern package. Extremely useful for keeping big teams on the right track.
- pharmakom 4y agoComparing Python to Java 8 and saying it’s more readable isn’t showing much. And it’s not very portable the second dependencies with native code (which is common since pure Python is too inefficient for many tasks) are used. I think Python is popular for two reasons: - it’s believed to be beginner friendly compared to other languages. I’m not really sure why - maybe the whitespace? - it has an enormous set of libraries available to use In other words, Python has momentum. The language itself isn’t great, but that is a secondary concern to most, if they are even aware of this at all!
- Akronymus 4y ago> - it’s believed to be beginner friendly compared to other languages. I’m not really sure why - maybe the whitespace? I am leaning more towards it looking like pseudocode > - it has an enormous set of libraries available to use I believe that to be the actual reason. I've long held that python is a kinda bad language, but with FANTASTIC libraries
- deafpolygon 4y ago> but with FANTASTIC libraries written in C _and FORTRAN_ ftfy - it's the only way a tragically slow language like Python can keep up. Edit: didn't forget FORTRAN
- dagw 4y agolibraries written in C That is simply not true. Even libraries like numpy, scipy and scikit-learn are majority python code.
- deafpolygon 4y agoMajority python code, being ~60% is mostly wrapper code, with the slowest parts (the parts that matter) written in C. https://stackoverflow.com/questions/1825857/how-much-of-numpy-and-scipy-is-in-c https://stackoverflow.com/questions/1825857/how-much-of-nump...
- 4y ago
- qsort 4y agoEh, they're just a lot of ways to say "path dependence". Scripting languages are basically the same exact technology with respect to each other. In the alternate universe where numpy and scipy are, let's say, numruby and sciruby, wouldn't we be here asking why Ruby keeps growing? That's not a sales pitch for python, it's a sales pitch for the concept of a scripting language; it's like saying "you should really buy a Ford, it comes with four wheels".
- rob74 4y agoI admit I have a blind spot for Python, because I use PHP in my day job, so when I need to do some scripting, I mostly use PHP. But admittedly Python is a lot friendlier than some alternatives (Perl, Shell scripts etc.), and more universal than others (PHP being mostly used for web dev), so that's why people choosing a scripting language for their tool/library tend to choose Python.
- qsort 4y agoI use Python all the time both for my personal stuff and for some side-projects at work, so this isn't a dunk on Python, but honestly it feels like a circular thing: it's popular because it's popular. I wouldn't say it's friendlier than the alternatives, Perl and Shell scripts sure, but not when compared to Javascript, Ruby or Lua. Now, if you're talking about libraries, support, etc. then sure, Python wins hands down, but that doesn't make it a better language in itself. I'd say Ruby and Lua are a little bit better as languages. But then again, I don't care much for the language in itself, so Python is enough for most of my use cases.
- otherme123 4y agoI read "it's popular because it's friendlier". PHP, Javascript or R are popular, but are not friendlier. I find their error messages way worse for the beginner, when you need it more. Third party code is too "clever" for the beginner to read and learn, because it seems to be two languages: the one you are learning in the tutorials, and the other idiom that is used in the serious libraries. As a beginner you are hit with this feeling that you are far, far away from writting an useful thing. In my job I've seen some beginners starting with R, and quickly hating it because they don't feel they can do much on their own, but copy-pasting and then modifying from the examples and the tutorials. And it the changes go too far, everything collapses with cryptic errors. When you show them Python as an alternative, pointing that they shouldn't use it over R for statistics and graphics, they like that they can build ideas from the scratch. That beginner is hooked for life.
- dodgerdan 4y agoAre people going optimistic about the efforts to make Python faster?
- boxed 4y agoIf by "optimistic" you mean "confident we'll get some free wins that are ultimately pretty small for normal apps" then yes :P
- dagw 4y agoOptimistic that we'll see maybe a 2x performance over the next 5 years, yea. Optimistic that python will catch up to any of the 'fast' scripting languages, no.
- pletnes 4y agoPython keeps growing in number of users because it’s easy to get started, has libraries to load basically any data, and to perform any task. It’s frequently the second best language but it’s the second best language for anything. By the time a python programmer has «graduated» to learning a second language, exponential growth has created a bunch of new python programmers, most of which don’t consider themselves programmers. There are more non-programmers in this world, and they don’t care - or know about - concurrency, memory efficiency, L2 cache misses due to pointer chasing. These people all use python. This seems to be a perspective missing from most hackernews discussions, where people work on high performance Big corp big data web scale systems.
- SushiHippie 4y agoYeah, big corp big data web scale systems use python too.
- xaitv 4y agoThere's also the argument that at a certain scale the time of a developer is simply more expensive than time on a server. If I write something in C++ that does a task in 1 second and it takes me 2 days to write, and I write the same thing in Python that takes 2 seconds but I can write it in 1 day, the 1 day of extra dev time might just pay for throwing a more high performance server against it and calling it a day. And then I don't even take the fact that a lot of applications are mostly waiting for database queries into consideration, nor maintainability of the code and the fact that high performance servers get cheaper over time. If you work at some big corp where this would mean thousands of high performance servers that's simply not worth it, but in small/medium sized companies it usually is.
- eska 4y agoIf Python was merely twice as slow then I could agree with you.
- bombolo 4y agoNot all code needs to process terabytes of data. I have code running that reads ~20 bytes, checks the internal status on an hashmap and flips a bit. Would it be faster in C? Of course. Would it have taken me much longer to write to achieve absolutely no benefit? Yes.
- ZiiS 4y agoOdd pitch from a company who use Ruby over Python.
- WoodenChair 4y agoIt's a fine article and makes many of the standard points. But I would expect a slightly more data driven analysis from GitHub given the large amount of data available to them. For example, what percentage of first repositories (new GitHub users) are in Python? What percentage of GitHub Python repositories use a data science library? Etc.
- awelxtr 4y agoThere is a typo on the Java Hello World example hehe
- samwillis 4y agoI have been a heavy Python user now about 15 years, but for me now I'm increasingly reaching for modern JavaScript and particularly TypeScript to do the things I would have traditionally done with Python. ES modules, fat arrow expressions, and all the other nice new syntax and library features have made the language so more pleasant to use. In many ways the ergonomics of TypeScript in particular are far superior to Python now, and I find that really surprising. I haven't yet found a replacement for Django (particularly the ORM/Admin/Forms combination) it is just so incredibly productive to use. So, I don't think I will be moving off it, but it's certainly not the growth language for me anymore.
- leetharris 4y agoIf you're looking for a Django replacement, check out Adonis. Laravel in PHP was heavily inspired by Django but is much better and Adonis is an exact clone of Laravel. I think you'd like it.
- fredley 4y agoI am going this way too. I recently tried to onboard a few contractors with limited python experience. It took several deep sessions to work out why they couldn't get an environment set up. After 10+ years I've never come across the install certificates command. There's still no way to get a dev environment with a specific version of Python working with one command that works reliably everywhere. pyenv isn't even packaged for Linux, you have to install from source. This, plus Typescript's superior type system makes it very tempting for application development. However I'll probably wait until there's a really good Jupyter Notebook equivalent...
- beiecuehdbdu 4y agoNo need to wait, there is a Javascript kernel for Jupyter Notebook: https://github.com/n-riesco/ijavascript https://github.com/n-riesco/ijavascript I used this for interactive debugging AWS API calls using the AWS Javascript SDK. It worked great!
- SiempreViernes 4y ago
- arnvald 4y agoI'm a bit surprised to see this article on GitHub blog, it feels more like something from dev.to - looking at the surface, with little actual insights. Most of the provided reasons behind Python's popularity are true also for other languages - portable, open source, productive, big community. This can be also said about PHP, Ruby, or Perl back in 2000s. Why isn't Perl as popular as Python? I don't think it's all about readability or productivity, but about tools that were built over the last 30 years that have been used in academia and now with the boom in ML/AI/Data Science, they made Python an obvious choice to use for the new generation of tools and applications. Imagine that the boom in ML/AI didn't happen - would Python be #1 language right now?
- _glass 4y agoAs commented somewhere else in this thread, Python was clearly more ergonomic than Python, hand had a lot of mindshare exactly for this reason. I remember when Python was new and the not that professional choice, Perl was at that time for that niche. Now still I don't see a contender for a language where speed doesn't matter. Ruby has some Perlisms that really make it weird, PHP is tight to the web, and equally weird, these $s and @s are really bad for normal people. Python wins clearly when teaching somebody programming.
- AlchemistCamp 4y agoI’d say that Ruby and even Perl are a lot nicer for scripting than Python (due to the extremely low-effort unix interop). Python can do it but it’s a while lot more verbose and difficult for a beginner to learn than “anything inside a pair of backticks is run as a system command and you can interpolate variables”. Python was friendlier for beginners than Ruby the first time I took a real stab at learning to code during a CNY holiday in 2008, but it wasn’t about the language itself. Ruby was harder then because many of the popular libraries and many of the tutorials were written by people who considered Windows support as an afterthought. It’s hard to express how frustrating it was to have my vacation days ticking down, hitting issues in one tutorial after another and having people suggest I install linux on a VM (a process where I hit still more snags). People learning Python and PHP didn’t hit that hurdle. I ended up learning Flash on my Asus laptop a couple of years later and getting my start that way and not coming back to Ruby until six years later when I was a much more experienced dev.
- boxed 4y agoIf the author of this article reads this: you have an error in a heading: > Using Python for and artificial intelligence for what and AI?
- webmaven 4y agoBased on the text that follows, I would guess that the missing term is "machine learning".
- extasia 4y agoFunny enough this sort of sentence, i.e one with a missing word, is a very common ML training task for large language models like Gpt3: the models objective is to predict the correct word from a set of possible answers.
- deleted 4y ago[deleted]
- gostsamo 4y agoThe article assigns significance to the language when the real work is done by the libraries. And many good libraries inspire even more good libraries. At that moment the language no longer matters. But it matters in the beginning when people have to create the initial environment and this is what should've been underscored. Python lets you do so many things in so many ways that minor mistakes do not matter and everyone has the freedom to experiment, achieve results, discover that they've done something stupid, but at that moment you already feel confident to do it again, but better.
- k0k0r0 4y ago5his is right in the spirit of: The Python community is a bunch of people learning programming together. Someone else made this remark once, when the indroduction of type annotations was discussed as the python community discovering the benefits of static typing.
- kajaktum 4y agoWhy haven't Python replaced Make? Its cross-platform and can do pretty much any horrible monstrosities that people do in make and cmake.
- t43562 4y agoMeson is a build system written in python: https://mesonbuild.com/index.html https://mesonbuild.com/index.html Getting python bootstrapped is less easy than getting make bootstrapped, plus python isn't a GNU tool so I don't see them adding a dependency on it to all their packages. GNU Make is really far more sophisticated than people give it credit for and it's not that easy to replace it.
- kajaktum 4y agoI was thinking of using python as a script (duh). > GNU Make is really far more sophisticated than people give it credit for and it's not that easy to replace it. Since its turing complete, it should be able to do everything make can. For example, to compile a C project involves something like: 1. grab all the C files inside `src/`. 2. join the filenames with whitespace delimiter 3. execute `gcc <join result>` It can also be used to figure out the OS, where to find dependencies and what order compilation should happen or whatever. But why doesn't this happen?
- t43562 4y agoWell as I pointed out, it does happen e.g. in Meson. Make doesn't do any of the things you mention - it just works out what targets need to be rebuilt and the code to do it is in the rules that you have to write in a shell language like bash. I admit you can use builtin implicit rules for C and get away with that up to a point but only a fairly low point. python is far harder to use than bash when it comes to running processes and doing things with them and doing the file-system manipulation that is usually wanted when building. There are modules that make it easier but so far as I've seen it's a crap choice plus python takes a long time to start up so there is a cost to running a "clean" environment for every build step but OTOH if you use the same interpreter for the whole build you can introduce all sorts of ordering problems when a build runs on a different machine and doesn't work because it's executing build tasks in a different order. If you really want to build by "writing a script" (groan - because that's the age old horrible solution) why bother with python?
- _glass 4y agoI remember the evolution of Python. When I started with my brand new Ubuntu installation when Ubuntu was also very new, there were two languages, Perl and Python. Because Perl was more popular at the time I check some books in the library, and wrote some scripts. But already then the consensus was, that even though libraries are lacking (!), it is the better, cleaner language. Another big push was the bad enterprise guys, that like static typing, so C, C++, Java, vs. the hipster dynamic language guys. Some tenets were broken, speed is not as important as language concepts, that enabled fast iteration. Agile was new, and Python was very agile. There was no real alternative to Python at that time, that was as sane, and beautiful. That's the reason why we have now such a nice variety of libraries, because it is just a sane language to build on, if speed is not your business. Ruby was a contender, but not that much better in the end. Now Javascript kind of took the edge away from Python, even it wasn't for the browser and the web, Python would dominate much more. Javascript as a language is worse than Python because of its cruft, so I don't see a big rewrite of ML tooling into Javascript. Maybe Typescript.
- t43562 4y agoPerl was very popular and I think Python got its boost from being seen as the more sane replacement to it. At that time nothing else really offered to solve the pain of Perl in the same way except Ruby and Ruby was even slower
- ngrilly 4y agoIt's interesting that people keep claiming that indentation-based blocks makes Python easier to learn and read. I've been teaching programming to students in banking, finance and insurance for a few years, using Python, and my experience with them is the opposite. They have been struggling with that a lot. They didn't pay too much attention to white spaces and tabs, probably because they are "invisible", and couldn't see why a statement was not executed at the end of the block, because it was not indented correctly. For me, it was obvious, because as a professional programmer, I've been trained to pay attention to details. But for most of them, it made no sense. Explicit block markers are much easier to teach.
- thephyber 4y ago> Explicit block markers are much easier to teach. The point of communication is to express something in a way that the listener understands it. Simply expressing something that is comfortable or normal to the speaker is simply not useful for either party of the goal is communication.
- ngrilly 4y agoYou're right. What matters is that explicit block markers are easier to learn (from the student's perspective). Being easier to teach (from the teacher's perspective) doesn't matter as much.
- SiempreViernes 4y agoSure, but without the white space defined blocks it is entirely on you to teach them about the importance of formatting their code to ensure readability.
- ngrilly 4y agoThat's right. That's the other side coin. But I'm not convinced it matters that much nowadays when most languages provide code formatters.
- 4y ago
- blippage 4y agoMy go-to language is C++, although I know and have admired Python for a long time. I had a BMP file which I wanted to transpose and turn into raw RGB 5-8-5 values. Using the Python Image Library made things absurdly easy. That's Python's advantage in a nutshell. Things are just so absurdly easy.
- ThePhysicist 4y agoPython is the ideal glue layer for low-level languages, now mostly Fortran/C/C++ but there are already many projects exposing Rust libraries through Python, which for me is a great combo of performance and usability.
- HarHarVeryFunny 4y agoSure, but that's because there was a good library available, little to do with Python vs C++. If there was an equally good C++ image library available then it would have been equally simple in C++. Of course the thing is that, in general, there may well NOT have been such a C++ library, and this is what makes languages such as Java and Python popular - because of the breadth of libraries available. For C++ image manipulation I've found libvips to be decent, but the point still stands that for a given problem there may not be decent libraries available.
- Lyngbakr 4y agoI think one reason for Python growing popularity is because it's become the default tool in some domains whether it is the best tool or not. This week our Director ordered a total rewrite of two years of work in Python. His rationale: it's what everyone else uses in this space. No reason specific to our use case, just simply to follow the herd. I realise that a large community translates into easy hiring and rich ecosystems, but I despise the mentality as it promotes a monoculture.
- extasia 4y agoThat's a terrible idea for so many reasons
- edwiecron 4y agoIf Python was a market, this would clearly be the top. There was a time when all you had to learn was Java or C++ or (language or tool here). Somehow, this time when we standardize, it will be different.
- heresie-dabord 4y ago... and Python _became_ the default tool because the de facto developer consensus (after years of competing languages) is that an interpreted language should = be usable, and = provide a set of data structures that an educated programmer *expects to find when scripting*. Python literally sucked less than the alternatives.
- deleted 4y ago[deleted]
- kelipso 4y agoPython gets introduced to students, so for many people it's the first language they learn. Half the programming community have less than 5 years of experience. I question their ability to evaluate suckage, lol.
- onphonenow 4y agoWhat are you rewriting from? At director level focus is usually more on things like how easy is it to staff / get support for something. Python is strong here - you can find programmers globally who can do pretty well with it. Can you say the same about your solution?
- DeathArrow 4y agoI think people embrace Python because they think it's easy to learn and use. While that might be true, the real complexity lies not in learning and using a language (unless it's Rust) but in learning the libraries, frameworks, idioms, dos, don'ts, tooling.
- DeathArrow 4y agoI remember when Twitter rewrote the code in Java because Ruby wasn't suited for the task. Probably this will happen to many large Python code bases in the future.
- moffkalast 4y agoEvery codebase will eventually be rewritten in Rust sometime before the heat death of the universe.
- DeathArrow 4y agoAs a divine punishment?
- HarHarVeryFunny 4y agoPerhaps, but it seems the shelf-life of anything AI/ML related (huge part of Python usage) is so short that it'll become obsolete before it ever becomes worth rewriting.
- revskill 4y agoGarbages keep growing, too. It's really hard to trace a Python bug based on codebase, due to its stricly bugly indentation sensitive for space/tabs. I rather work on a JS codebase than a python codebase. But i consider Python coders genius, because they can go deep into rabbit hole really well.
- manuelabeledo 4y ago> I rather work on a JS codebase than a python codebase. That may only prove that you are not proficient in either.
- 3v1n0 4y agoIt's definitely the best language for quick scripting and multi-os tools that requires some code organization, probably not for scaling stuff.
- ByteBandit 4y agoSo impressive to see all trading solutions/bots made with Python! What do you think about Julia in this field: I see it as a viable alternative even if it lacks the huge amount of Python libraries?
- milliams 4y agoThis was already posted at https://news.ycombinator.com/item?id=35000415 https://news.ycombinator.com/item?id=35000415, I don't know why it didn't detect the duplicate. I'll repost my comment from there: This is a strange article. It's got the talking point about Python that we were hearing about 10 years ago - "tired of those pesky curly brackets in Java, try this new language you might not have heard of: Python!". Who reading the GitHub blog has not heard of Python? Also, that snippet used in the "What is Python commonly used for" section is strange: import antigravity def main(): antigravity.fly() if __name__ == '__main__': main() It's overly verbosely written (especially given the example just above about how you don't need main function in Python) and refers just to an insider joke/Easter egg. I can't see that it's going to convince anyone to try Python, only make them feel that they're on the outside of a joke. It then ends with what seems like it might have been the point of the article, an advert for Copilot. It seems the way to get started writing Python is to write a short comment and then spam <TAB> and let the AI auto-complete your project. (Also, and perhaps less importantly, looking at the author's GitHub profile I can't see a single instance of Python there. Though I'm not doing a deep-dive as that feel overly picky and there's plenty of private contributions that could well be Python.)
- Jevon23 4y ago>It's got the talking point about Python that we were hearing about 10 years ago - "tired of those pesky curly brackets in Java, try this new language you might not have heard of: Python!" That was a talking point closer to 20 years ago, at this point.
- steveBK123 4y agoBecause its easy. Because it has an interpreter. Because it has notebooks. Because it has huge set of libraries & easy library import. Because schools are teaching it. Because a lot of cloud native tools support it / prefer it.
- revskill 4y agoNo, because academics or professors don't care about real software enginneering and best practices.
- steveBK123 4y agoWell yes. But if you pump out millions of graduates with almost exclusively python experience, guess what they write in production once they have jobs?
- bluedino 4y agoTry dealing with your corporate security team, who's detecting out of date Python versions. For the most part these update without much hassle, but now you've "broken" your researcher's code. It takes them a while to fix this, and then the security guys find out that Python packages also need updated...
- DeathArrow 4y agoI would take Nim over Python. Better designed, much faster. As readable as Python.
- letmeinhere 4y agoI'm very interested in giving it a try once it has a tree-sitter grammar (already has a Jetbrains plugin and LSP, but I'm trying to be conservative).
- pavlov 4y agoI wish I could wave a magic wand and replace all the Python in the world with JavaScript. The languages are practically equal in terms of features. They're both typeless with layered-on crutches available to make the runaway dynamism less painful. They both have weird footguns and ugly syntax and annoying design flaws, but these are different for each. So if you're forced to use both languages, it's an endless pain in the ass to remember which stupid runtime error can happen in JS but not Python and vice versa. So JS can replace Python... But Python can't replace JS simply because it's unavoidable on the front-end. Since you must have JS code anyway, why use a language that's functionally very similar but different enough in syntax and API that you'll be writing bugs all the time? Just stick with JS and start drinking like me.
- eviks 4y agoIt's easy to avoid JS on the front-end : just wave your wand!
- pavlov 4y agoSince I have an all-powerful magic wand that rewrites history, I guess I could use it to make Python the default language in Netscape Navigator 2.0 and then everything written in JS since 1997 would be in Python instead... But I don't actually want to do that. The Python design philosophy isn't really compatible with loading embedded, sandboxed user programs over the network. A hypothetical Python-Netscape would have crashed and burned with security holes like ActiveX, IMHO.
- thechao 4y agoHere's how out-of-the-loop I am: I'd don't know the command line method for invoking the JS runtime on my computer! What it is? I regularly image my laptop, so I'd like to know what the system JS command line is. (I use Linux & macOS.)
- pavlov 4y agoThe CLI runtime that 99% of people use is Node.js, available via the same package manager where you'd get Python 3. Its dependency management story is not great, but in general better than the horrible mess on the Python side. On macOS there's a system runtime called JavaScriptCore.framework. It's actually a very good and useful engine. If you're writing native code, you could link to that. But of course it doesn't provide any of the Node.js API, just the JS standard library which is tiny. So the most typical use case would be to embed a JS API into your application.
- CE02 4y agoOne thing I’d add to this conversation, though I’m certain it’s already been stated: As many have mentioned, there is a large subset of the user base that uses Python for applied purposes in unrelated fields that couldn’t care less about more granular aspects of optimization. I work as a research assistant for international finance faculty and I would say that compared to the average Hackernews reader, I’m technologically illiterate, but compared to the average 60-80 y/o econ/finance faculty member, I’m practically a Turing award winner. Most of these applied fields are using Python and R as no more than data gathering tools and fancy calculators. something for which the benefits of other languages are just not justified. The absolute beauty of Python for what I do is that I can write code and hand it off to a first year with a semester of coding experience. Even if they couldn’t write it themselves, they can still understand what it does after a bit of study. Additionally, I can hand it off to 75 year old professors who still sends Fax memos to the federal reserve and they’ll achieve a degree of comprehension. For these reasons, Python, although not perfect, has been so incredibly useful.
- blensor 4y agoI hate to admit that I very often start the python repl to just do some simple calculations. I always have multiple terminals open so instead of opening a calculator I just use python in one of the terminals.
- faizshah 4y agoI also use a python repl as an alternative to excel or SQL. I find myself just downloading the data as a CSV and then quickly cooking up some pandas to get a graph or aggregate some stats, it’s just so much quick easier imo.
- cauthon 4y agoI’ve migrated to the tidyverse for most of my EDA and plotting - I’ve found dplyr and ggplot to be noticeably more expressive. Pandas always added a ton of friction for me. It’s still my choice for quick and non-graphical analysis when I’m on a remote.
- epgui 4y agoPython’s “simplicity” and “beauty” are always so over-emphasized. Maybe compared to something like C or Fortran or R… But it’s a pretty messy, complex language. Try a lisp instead.
- transfire 4y agoPython is the new BASIC. That pretty much says it all.
- theloco 4y agopeople love python. i never learned it but i figured the python indenting instead of bracketing thing would have spread more by now
- agentultra 4y agoI'd been in the Python community for around 10 years, spoke at several conferences, wrote libraries; contributed to CPython, Openstack, and others. I've been a technical reviewer for a book on distributed computing in Python. A big part of my career was built on this language, its community, and ecosystem. I'd say a big part of Python's slow-and-steady success is its community. Going to Pycon US, Pycon CA, and Pycon's around the world -- the user groups that the foundation funds with Pizza money and mentorship programs: it's a fairly unique experience. Another major factor is how it serves as a glue language in the scientific community. Python provides a relatively simple programming language that powers complex, powerful libraries like NumPy, SciPy, PyTorch, SymPy, etc. It's like a scripting language for engineering and scientific computing tools, sort of like what Javascript does for browsers, Node, and Deno, etc. I don't do much Python programming these days but I owe it a huge debt! May it continue to flourish and grow.
- ravenstine 4y agoThe syntax, I think, is also the least likely to scare off newbie programmers. Personally, I came to really dislike the Python syntax, but it reads rather well, is very unintimidating, and easily supports the kinds of things that newbies will be doing. Not to rag on Python, but I found the indent-sensitivity of Python can make it challenging to do the sort of basic things that C-family languages make fairly simple. Lambdas in Python suck in contrast to how lambdas and anonymous functions work in other languages. But yeah, Python has proven itself to be a great language for a wide variety of applications. It makes a lot of sense for the scientific community probably because things like heavy object orientation matter a lot less in those cases. The community doesn't discourage people from just writing functions, unlike other communities that are hellbent in making everything a method of some class structure and being explicit about that.
- photochemsyn 4y agoThey don't mention that Python makes it really easy to interoperate with other languages via the subprocess module. So you can run Javascript web code via node, wait for it to finish, then move on to something else. Or you can launch a C++ process that's can do real parallelism and wait for the results, avoiding many issues with the Python GIL. Also, Python makes it easy to work in different programming paradigms, it's as easy to write functional-type code as it is to write object-oriented code, both approaches are supported. This makes it a great prototyping system if you want to rewrite the code later in some other language like C++ to get some performance improvements.
- marcosdumay 4y ago> Python makes it really easy to interoperate with other languages via the subprocess module Launching processes and interacting with them through stdin and stdout is a bare minimum, and really a flag against the few languages that make it hard, instead of a relevant feature. > Python makes it easy to work in different programming paradigms As long as you stay in imperative, non-pure, structured with optional OOP and first classes functions. Again, that's not much in multi-paradigm. This is the set of things that work well with the imperative model.
- cozzyd 4y agoWhat languages make it difficult to spawn other processes?
- HarHarVeryFunny 4y agoIs the popularity due to Python itself, or due to the explosion in use of AI/ML that all but mandates use of Python ? It'd be interesting to see an attempt to assess the growth in use of Python outside of AI/ML.
- ur-whale 4y agoPython is really nice. Easy to learn yet powerful. Easy to read yet very concise. Anytime you need something complicated, it's a pip and an import away. Couple of downsides though: - slow - does not handle multiprocessing nicely. If the python team ever manages to fixes these two (not easy or it would have happened a while ago) to bring it to - say - the level of Go, Python would be the absolute killer language.
- leetrout 4y agoTangent: Something interesting (and frustrating) ... I went to the LinkedIn assessments to take the Python assessment and over half the questions were specifically about Numpy, it's API and matrix math. Which for me and what I generally do has nothing to do with "Python" and I was quite surprised to find that in the questions.
- wussboy 4y agoIn my search for a senior Python developer I have encountered dozens and dozens of resumes whose Python experience consists almost exclusively of Numpy and data entry. Not at all the skill set I’m looking for.
- OJFord 4y agoAre you calling the job 'senior python developer'? I haven't used any other language (as the primary one anyway) professionally (and I'm open to that remaining the case) but I probably wouldn't even open such a job description.
- albrewer 4y agoAs a pretty experienced python dev who has never worked professionally with Django / Flask or Numpy, I have a hard time finding job postings without those seemingly hard requirements.
- wussboy 4y agoI'm curious as to what you've worked on in your career? I mainly ask because we are 100% Django/Flask. :)
- albrewer 4y agoIt's been split between three areas - writing mathematical code that wouldn't really benefit from numpy, at least not at first (think engineering design codes - step-by-step calculations where the output has to be verifiable by a human; charts and graphs aren't the focus (I'm not at this company anymore)), writing testing infrastructure for a legacy client/server application that was designed around the time Ethernet was invented (well before I was born), and writing library code for my QA team to write tests for said application. Most of these domains are sort of document-oriented - for the math stuff, the hard part is just defining the model, and there is only one "thing" to operate on. For testing, the units of work are test cases and steps, which _could_ be database entries, but work better in practice as a document that a non-technical QA team member could edit by hand. Results are fed to a SaaS that keeps all the historical test result data. Not that I couldn't pick up either one of these tools and use them (I'm a mechanical engineer by training and got into Python because I didn't like using Matlab/Octave), I've just never needed them professionally. But that doesn't get me past the resume filters :(
- bandrami 4y agoIt's a cool language, but it meeds a system for packaging and distributing libraries.
- stcroixx 4y agoI’ve seen replace a lot of tasks that used to be done with Excel - non-programmers programming tool of choice.
- willseth 4y agoAnd yet, GitHub seems to be in no rush to support Python in GitHub Packages https://github.com/orgs/github/projects/4247/views/1?filterQuery=pypi https://github.com/orgs/github/projects/4247/views/1?filterQ.... This has been TBD status for years. Frustrating for anyone needing to manage private libraries and tools. And baffling, since Python is now the most popular language on their platform by most metrics https://madnight.github.io/githut https://madnight.github.io/githut
- Existenceblinks 4y agoI dig a bit but not found how the percentage is from. Is it F(#LoC, #download, #repo, #active-in-past-x-year) something? What's the calculation here?
- JohnFen 4y agoI just wish that I enjoyed using it. I've been doing a fair amount of Python work over the years because it's been required by my employers, but to be honest, I kind of hate it. I think the thing I hate the most about it is that white space is significant. It's like we travelled back in time to the early days, and picked up one the bad things about them and brought it back. I find that makes it more difficult for me to read, and more difficult for me to write (from a mechanical type-in-the-code point of view). I have other niggling issues with it, but if the white space thing weren't an issue, I doubt the other issues would bother me enough to complain about them.
- mixmastamyk 4y agoSlashdot called and want their comment back, haha! Whitespace blocks significantly reduce redundancy and are quite elegant imnsho. If you’re having trouble with them, use a programmer's editor with indentation guides like notepad++ or geany. These are considered basic features these days. Other simple things which reduce Python annoyances are tools like pyflakes and the blue formatter.
- JohnFen 4y agoWe disagree about whitespace blocks. That's fair. > If you’re having trouble with them, use a programmers editor with indentation guides like notepad++ or geany. Yes, of course. Python makes that pretty much essential, which is one of my complaints about Python. A language that requires a special editor is a language that is deficient, IMO. There are a ton of other, more minor, aspects of Python that makes it unpleasant for me. It's not just the whitespace thing. That's just the one that grinds my gears the most, because it's the one that slows me down the most. But note what I haven't said here -- I haven't said that Python sucks. I only said that I hate using it, despite being pretty fluent in it and having used it for years.
- mixmastamyk 4y agoIt’s not required to use a basic editor from the early 90s, no… but it can help on a big codebase. Why handicap yourself? I make patches once in a while with nano/micro without issue. Maybe your functions are just too long, dunno. A lot of folks can’t survive today without a giant ide awhile you advocate not to use something downright tiny in comparison. Do you hate working with jpeg or blender files because they require software? Rather move bits with a magnetic needle and steady hand? Admit I was put off by it for an hour or so as well. One spring day in 2001? That afternoon I realized it as a masterstroke and didn’t write another line of c, perl, or java by choice for almost two decades. Two ways to delimit blocks is redundant. Either one indents already or the project is a disaster.
- deleted 4y ago[deleted]
- kilgnad 4y agoThe growth is actually too fast. I was a python expert. Now it's not a big deal any more because the language is so easy. I've hit interviews where they DIDn't want me to use python because it's too easy. I branched out to C++ and other languages to stay above the curve. Python is becoming like english, required to know, and not really a deep skillset employers are looking for now.
- shpx 4y ago$5 says this post was generated by ChatGPT.
- wwilim 4y agoDare I say, the article is quite a shallow take... but maybe that's all there is - the apparent ease and the few industries that have been built on top of it?
- huggingmouth 4y agoI switched to python last year because it has an excellent builtin library. No more having to download random crappy libraries that download even more crappy libraries.
- xcombelle 4y agodid you switch from nodejs?
- mlboss 4y agoHow difficult it would be to transpile python program into a more performant language using a LLM ? This would solve so many issues. Write a code in python and convert it into C++/Rust/Assembly for performance.
- deleted 4y ago[deleted]
- dragonwriter 4y ago> How difficult it would be to transpile python program into a more performant language using a LLM ? It'd be a lot easier (and more reliable) just to use a traditional compiler, rather than an LLM imitating a compiler. The problem is maintaining the full scope of Python semantics there is usually no advantage to this. Compiling parts of a python codebase, with restricted semantics, can give you significant gains in some use cases, and there are tools (in Python!) that do that already.
- aflag 4y agoI think the idea is that a person can read a project in python and re-implement it more efficiently in C++. The LLM could do the same thing. However, I don't think LLMs are quite that powerful.
- xyzelement 4y agoPython has a dual benefit - it's "easier" to approach from the bottom of the skill level - ie easier for a new dev to pick up compared to what C++ But even as someone who knows C++, most of the stuff I do doesn't require it - and python is often easier and terser to express the concepts.
- 11235813213455 4y agoit's strange to me, because JS has so many advantages over Python, only remaining thing could be converting more scientific libs like scikit in JS
- qwery 4y agoGithub is primarily a website for developers, right? Who is the blog for? This article is garbage. It reads like SEO trash and I'm not sure why Github feels the need to publish it. It's just a list of common Python talking points. Points that the author displays a poor understanding of. The article doesn't really attempt to explain why python keeps growing but the facts listed vaguely suggest that it "keeps growing" (not sure when it was supposed to die) because it is Good and Popular. Which makes sense, I guess. If the title was '10 Cool Facts About Python (a Programming Language!)' I would probably find it a little bit funny.
- kyawzazaw 4y agoMarketing to those who are new to coding. Seems like a good business decision on GitHub's part.