News for hackers. Stuff that matters.
Re:Why Python keeps growing, explained by amelius on Friday March 03, 2023 @05:07AM (#35007748)
There are also programmers who are tired of chasing pointers and simply want to get stuff done.

E.g. people who once wrote "robust" code in Rust but were "outcompeted" left and right by coworkers who churn out shiny new things at 10x the speed.

Re:Why Python keeps growing, explained by a4a4a4a4 on Friday March 03, 2023 @07:21AM (#35008566)
Or there are programmers who write both. Something that I want to write once, have run on several different platforms, handle multi-threading nicely, and never have to think about again? Rust. Writing something to read in some data to unblock an ML engineer or make plots for management? Definitely not Rust, probably python. Then you can also churn out things at 10x the speed, but by writing the tricky parts in something other than python, you don't get dragged back down by old projects rearing their ugly heads, so you outpace the python-only colleagues in the long-term.
Re:Why Python keeps growing, explained by jamincan on Friday March 03, 2023 @08:37AM (#35009408)
Programming is secondary to my primary duties and only a means for me to get other things done. I'm in constant tension between using Python and Rust.

With Python I can get things up and going very quickly with little boilerplate, but I find that I'm often stumbling on edge cases that I have to debug after the fact and that these instances necessarily happen exactly when I'm focused on another task. I also find that packaging for other users is a major headache.

With Rust, the development time is much higher for me, but I appreciate being able to use the type-system to enforce business logic and therefore find that I rarely have to return to debug some issue once I have it going.

It's a tough trade-off for me, because I appreciate the velocity of Python, but Rust likely saves me more time overall.

Re:Why Python keeps growing, explained by temp2022account on Friday March 03, 2023 @07:26AM (#35008616)
> coworkers who churn out shiny new things at 10x the speed

Sounds like a classic web-dev perspective, my customers hate when we ship broken tools because it ruins their work, new feature velocity be dammned. We love our borrow checker because initially you run at 0.5x velocity but post-25kSLOC you get to run at 2x velocity, which continues to mystify managers worldwide.

Re:Why Python keeps growing, explained by intelVISA on Friday March 03, 2023 @08:52AM (#35009626)
Feature factories give web dev such a bad rep, it doesn't have to be this way..
Re:Why Python keeps growing, explained by FlyingSnake on Friday March 03, 2023 @09:15AM (#35009889)
This is not just a web-dev perspective.

People use Python in financial applications, Data Engineering and AI/ML pipelines, infrastructure software etc and the 10x speed can be real.

Re:Why Python keeps growing, explained by rich_sasha on Friday March 03, 2023 @07:29AM (#35008648)
I use mostly Python, and a bit of Rust.

With Python, testing, good hygiene and a bit of luck you can write core that is maybe 99% reliable. It is very, very hard to get to (100-eps)% for eps < 0.1% or so. Rust seems better suited to that.

Anything else, especially if there isn't a huge premium on speed, meh - Python is almost always sufficient, and not in the way.

Re:Why Python keeps growing, explained by wiz21c on Friday March 03, 2023 @07:37AM (#35008736)
I use the same combo: lots of Python to analyse problems, test algos, process data, etc. Then, once I settle on a solution but still need more performance (outside GPU's), I go to rust.
Re:Why Python keeps growing, explained by stevofolife on Friday March 03, 2023 @12:03PM (#35012204)
Genuinely curious, why do you need Rust?
Re:Why Python keeps growing, explained by wiz21c on Monday March 06, 2023 @07:15AM (#35040122)
I'm simulating an audio speaker in real time. So I do the data crunching, model fitting, etc. in python and this gives me a godd theoretical model of the speaker. But to be able to make a simulation in realtime, I need lots of speed so rust makes sense there (moreover, the code I have to plug that in is rust too, so one more reason :-)). (now tbh, my realtime needs are not super hard, so I can avoid a DSP and a real time OS :-) )

I don't need rust specifically. It's just that its memory and thread management really help me to continue what I do in python: focusing on my core business instead of technical stuff.

The less I code the better I feel :-)

Re:Why Python keeps growing, explained by otabdeveloper4 on Friday March 03, 2023 @08:13AM (#35009111)
> at 10x the speed

Is a coping canard invented by programmers who can't into more powerful programming languages.

By far the slowest language for developing is PHP, it's even worse than plain C in that regard.

Re:Why Python keeps growing, explained by CipherThrowaway on Friday March 03, 2023 @08:22AM (#35009225)
At some point, every engineer has heard this same argument but in favor of all kinds of dubious things such as emailing zip files of source code, not having tests, not having a build system, not doing IaC, not using the type system, etc.

I'm sure Rust was the wrong tool for the job in your case but I find this type of get shit done argument unpersuasive in general. It overestimates the value of short-term delivery and underestimates how quickly an investment in doing things "the right way" pays off.

Re:Why Python keeps growing, explained by djbusby on Friday March 03, 2023 @08:28AM (#35009284)
The business owner (whoever writes the checks) prefers get shit done over "the right way". Time to completion is a key factor of the payoff function of the devs work.
Re:Why Python keeps growing, explained by CipherThrowaway on Friday March 03, 2023 @08:54AM (#35009661)
The entire point of doing things the right way is that you end up delivering more value in the long term, and "long term" can be as soon as weeks or even days in some cases.

Business owners definitely prefer less bugs, less customer complaints, less support burden, less outages, less headaches. Corner cutting doesn't make economic sense for most businesses and good engineering leadership doesn't have much trouble communicating this up the chain. The only environment where I've seen corner cutting make business sense is turd polishing agencies whose business model involves dumping their mistakes on their clients and running away so the next guy can take the blame.

Re:Why Python keeps growing, explained by airtag on Friday March 03, 2023 @09:19AM (#35009926)
Try the travel/event booking business (where I'm in) - and no, people don't dump their mistakes on the next guy here - to the contrary, the "hacky" Python solutions are supported for years and teams stay for decades (allthough a decade ago we had not discovered how great Python was)

What business owners actually don't like at all is how long is takes traditional software development to actually solve problems - which then don't really fit the business after wasting a few years of ressources... and the dumping and running away is worse in Java and other compiled software. With Python you can at least read the source in production if the team ran away...

Re:Why Python keeps growing, explained by ElectricalUnion on Friday March 03, 2023 @01:12PM (#35013107)
> the dumping and running away is worse in Java and other compiled software. With Python you can at least read the source in production if the team ran away...

Java (and dotnet, the two big "VM" languages) is somewhat of a strange example for that; JVM bytecode is surprisingly stable and reverse engineering is reasonably easy unless the code was purposely obfuscated - a bad sign on any language anyways.

Re:Why Python keeps growing, explained by ubercore on Friday March 03, 2023 @09:02AM (#35009750)
Using Python vs Rust is in no way in the same league as not having tests.
Re:Why Python keeps growing, explained by CipherThrowaway on Friday March 03, 2023 @09:18AM (#35009919)
Totally agree. That's why I clarified:

> I'm sure Rust was the wrong tool for the job in your case but I find this type of get shit done argument unpersuasive in general.

Unless you're working on a fire-and-forget project with a tiny time horizon get shit done arguments are blatantly short-termist.

Re:Why Python keeps growing, explained by cwyers on Friday March 03, 2023 @10:28AM (#35010843)
The thing is that the short term is much easier to predict what you're going to need and where the value is, and in the long term you might not even work on this codebase anymore. Lot of incentives to get things done in the short term.
Re:Why Python keeps growing, explained by airtag on Friday March 03, 2023 @09:08AM (#35009816)
Totally depends on the business you're in.

If you're dealing in areas with short time limits then Python is great, because you can't sell a ticket for a ship that has sailed.

And I've seen "the right way" which, again, depending on the business may result in a well designed product that is not what's actually needed (because people are really bad at defining what they want)

What's brilliant with Python compared to other hacky solutions that it does support test, type hints, version control and other things. It just doesn't force you to work that way. But if you want to write stable, maintainable code, you can do it.

That means you can write your code without types and add them later. Or add tests later once your prototype was been accepted. Or whenever something goes wrong in production, fix it and then write a test against that.

Oh and I totally agree you should certainly try to "do things the right way", if the business allows it.

Re:Why Python keeps growing, explained by osigurdson on Friday March 03, 2023 @10:11AM (#35010600)
It is hard to believe that Python is objectively that much more productive than other languages. I know Python moderately well (with much more real world experience in C#). I like Python very much but I don't think it is significantly more productive than C#.
Re:Why Python keeps growing, explained by zeku on Friday March 03, 2023 @10:39AM (#35010992)
Python is out of this world more productive in the Science space and Data space.

The only thing that can compete with it for productivity in the science space is R.

Re:Why Python keeps growing, explained by cjalmeida on Friday March 03, 2023 @04:19PM (#35015161)
This. C#, Java or even newcomers such as Kotlin/Go are even in the same ballpark due to the REPL/Jupyter alone. Let alone when you consider the ecosystem
Re:Why Python keeps growing, explained by kyawzazaw on Friday March 03, 2023 @04:30PM (#35015296)
If you are in a lab (natural science lab) or anywhere close to data, I bet you it is much more productive, even more so when you have to factor in that the code might be exposed to non-technical individuals.
Re:Why Python keeps growing, explained by jimbokun on Friday March 03, 2023 @10:05AM (#35010512)
> It overestimates the value of short-term delivery

For an early stage start up this is almost the only relevant factor for success.

Re:Why Python keeps growing, explained by CipherThrowaway on Friday March 03, 2023 @12:10PM (#35012303)
From the other half of that sentence:

> underestimates how quickly an investment in doing things "the right way" pays off.

What time horizon should a startup optimize delivery for? Minutes, hours, days, weeks? Say you're a startup dev in a maximalist "get shit done now" mindset so you're skipping types, tests, any forethought or planning so you can get the feature of the week done as fast as possible. This makes you faster for one week but slower the week after, and the week after, and the week after that.

Say a seed stage startup aims for 12 months runway to achieve some key outcomes. That's still a marathon. It still doesn't make sense to sprint the first 200 meters.

Re:Why Python keeps growing, explained by rootusrootus on Friday March 03, 2023 @09:48AM (#35010275)
My most successful career epiphany was realizing that everyone -- my customers, my boss, etc -- was happier if I shipped code when I thought it was 80% ready. That long tail from 80-100% generates a lot of frustration.
Re:Why Python keeps growing, explained by osigurdson on Friday March 03, 2023 @10:13AM (#35010625)
Can you clarify this comment?
Re:Why Python keeps growing, explained by rootusrootus on Friday March 03, 2023 @11:38AM (#35011816)
You mean the bit about frustration?

It's just an application of the Pareto principle. That last 20% of work to make perfect software costs a lot of time. Customers (and by extension, management) do not care how pretty your code is, how perfect your test coverage is (unless your manager is a former developer, then they might have more of an opinion), they care most that you ship it. Bugs are a minor irritation compared to sitting around waiting for functionality they need, as long as you're responsive in fixing the bugs that do come up.

Re:Why Python keeps growing, explained by osigurdson on Saturday March 04, 2023 @10:21AM (#35021409)
Thanks. I thought that is what you meant but another possible take was that the last 20% is actually important. Getting something 80% finished is fast and then the long tail to get it to 100% is frustrating for everyone because the work, in theory is finished. I think that can happen as well.

Of course there are at least three dimensions to discuss here: internal quality, external quality and product/feature fit. Lower quality internal code eventually leads to slower future development and higher turnover as no one wants to work with the crappy code base. Lower external quality (i.e. bugs) can lead to customers not liking your product. Interestingly the relationship between internal and external quality is not as direct as one might think. Getting features out the door more quickly (at the expense of other things) can help with product fit. Essentially, like most things, this is an ongoing optimization problem and different approaches are appropriate for different problem domains.

Re:Why Python keeps growing, explained by Yoric on Friday March 03, 2023 @09:54AM (#35010344)
That is interesting. I went in the other direction :)

I am tired of having to refactor shiny new things churned out at 10x the speed and that keep breaking in production. These days, if given a choice, I prefer writing them in Rust code, spending more time writing and less time refactoring everything as soon as it breaks or needs to scale.

Re:Why Python keeps growing, explained by jimbokun on Friday March 03, 2023 @10:03AM (#35010479)
When the pointer chasing (sometimes) comes in handy, is once you have a successful business with a lot of data and/or users, and suddenly the cost of all those EC2 instances comes to the attention of the CFO.

That's when rewriting the hot path in Go or Rust or Java or C or C++, can pay off and make those skills very valuable to the company. Making contributions to databases, operating systems, queueing systems, interpreters, Kubernetes etc. also fall into that category.

But yeah if you are churning out a MVP for a new business, yeah starting with Python or Ruby or Javascript is a better bet.

(Erlang/Elixir is also an interesting point in the design space, as it's very high level and concise, but also scales better than anything else, although not especially efficient for code executing serially. And Julia offers the concision of Python with much higher performance for numerical computing.)

Re:Why Python keeps growing, explained by OJFord on Friday March 03, 2023 @10:48AM (#35011132)
If you're 'tired of chasing pointers', Rust's a lot closer to (and I'd argue better than) Python than say Go - it'll tell you where the issue is and usually how to fix it; Go will just blow up at run time. (Python (where applicable) will do something unexpected and wrong but potentially not error (..great!))

(Fwiw I use all three, Python professionally.)