News for hackers. Stuff that matters.
Re:Python overtakes Java to become the second-most popular p... by smt88 on Thursday November 05, 2020 @07:12AM (#24997538)
We need to start ranking languages based on what people use them for.

Python is certainly #1 in ML, for example, but far from #1 in web.

I had a "which stack" argument with a client recently for a web server processing tons of data. He wanted to use Node (which I hate, but also use when performance doesn't matter because TypeScript is so good).

I showed him that the Node library ecosystem is actually pretty weak (many libraries, but most abandoned, single-contributor, and/or low-quality). Of course, browser libs for JS are amazing.

My point is just that mixing all these things together in popularity rankings is pretty meaningless.

Re:Python overtakes Java to become the second-most popular p... by Glyptodon on Thursday November 05, 2020 @08:59AM (#24998235)
I went from Rails to a Node-based stack with a job change recently and the backend libs we're using feel comparitively like pushing boulders uphill, which I didn't expect. (There may be more/better options than what we're using of course.)
Re:Python overtakes Java to become the second-most popular p... by ritchiea on Thursday November 05, 2020 @09:36AM (#24998590)
Agreed. I find with JS I have to write a lot of code for features that could be handled with a gem in the Rails world. I miss gems like devise that had large amounts of common functionality that there is zero value in me re-implementing myself.
Re:Python overtakes Java to become the second-most popular p... by partyboat1586 on Thursday November 05, 2020 @09:06AM (#24998284)
What libs are you using? I'm using Typescript with Tsoa and Objection and it's pretty good.
Re:Python overtakes Java to become the second-most popular p... by z3t4 on Thursday November 05, 2020 @09:14AM (#24998360)
You are probably using TypeScript. Try vanilla Node/JS if you want a faster Rails.
Re:Python overtakes Java to become the second-most popular p... by mumphster on Thursday November 05, 2020 @09:31AM (#24998547)
What does typescript have to do with speed?
Re:Python overtakes Java to become the second-most popular p... by k_sze on Thursday November 05, 2020 @09:41AM (#24998637)
Static typing can be a bitch to get right. There are quite a few weird cases where it would be natural to write without types, but tricky once you introduce static typing and want to keep pleasing the TypeScript type checker, usually involving generics.
Re:Python overtakes Java to become the second-most popular p... by stickfigure on Thursday November 05, 2020 @10:21AM (#24998979)
> Static typing can be a bitch to get right.

That goes away with experience. Typescript can be particularly bad because it has in incredibly complicated type system (to accommodate all the wacky things you can do in JS), but after you get "used to it", the puzzled pauses become fewer and fewer. Eventually it's no inhibition whatsoever, and actually makes you faster because of IDE code completion, refactoring, and bugs caught by the IDE/compiler.

This is that "blub" thing people talk about.

Re:Python overtakes Java to become the second-most popular p... by smt88 on Thursday November 05, 2020 @11:05AM (#24999362)
Static typing is an enormous time-saver. I would never, never, never use JS without it again.
Re:Python overtakes Java to become the second-most popular p... by throwaway894345 on Thursday November 05, 2020 @09:49AM (#24998701)
Types don’t affect runtime performance unless you’re changing the algorithm. Maybe you’re arguing that correctly annotating certain algorithms is harder than switching to a slower but easier-to-annotate algorithm, but I’m very skeptical of this, especially since (in my experience) well-typed programs seem to be more efficient (easier for the compiler to optimize types that don’t change at runtime than those that do).
Re:Python overtakes Java to become the second-most popular p... by k_sze on Thursday November 05, 2020 @09:58AM (#24998773)
I wasn't talking about runtime performance at all. I was talking about coding speed. (I don't think the commenters before me were talking about runtime performance either? Did I misunderstand?)
Re:Python overtakes Java to become the second-most popular p... by throwaway894345 on Thursday November 05, 2020 @02:31PM (#25001158)
I interpreted this as a comment about runtime performance:

> Try vanilla Node/JS if you want a faster Rails.

Understanding now that you meant development velocity (or whichever term), I contest that static typing is in impediment in general, but rather that it's an impediment for people who aren't used to it. Especially for those who don't care if their code is correct or if it only appears to be correct superficially, although someone will inevitably (and authoritatively) drag out some decades-old study which finds no significant benefit to static typing when comparing Python/Lisp to C++89/Java or something.

Re:Python overtakes Java to become the second-most popular p... by ewmiller on Thursday November 05, 2020 @11:31AM (#24999572)
Dynamically typed, vanilla JS always seems like the faster option at first. Then your team grows, new developers inherit the project, and your codebase needs to be worked on at scale. This is when vanilla JS falls apart and becomes incredibly annoying to maintain, and it's why most of the big tech companies out there do not use vanilla Node JS for large projects.

Types are like living documentation - a contract between devs that describes and enforces specific behavior. Just because you know what properties an object contains now doesn't mean you'll remember it in a month, or that the dev who inherits your work will have an easy time figuring it out. I feel way faster when I code using types, because the type system tells me exactly what I'm working with at a given time. This ends up preventing lots of bugs and makes debugging errors that do happen way easier, in my experience.

So TL;DR types seem slower at first but the dividends are paid in full, and then some, when you have to maintain a project among many devs or teams of devs.

EDIT: not to mention that IDE autocomplete features often seem like a superpower when working with static types. I'd recommend Typescript for that reason alone, honestly.

Re:Python overtakes Java to become the second-most popular p... by z3t4 on Thursday November 05, 2020 @06:28PM (#25003258)
Relying on the type system for code insight and bug catching means one have not carefully studied the code, which is what causes most bugs. If the code base is too large for anyone to digest, then break up responsibility.
Re:Python overtakes Java to become the second-most popular p... by pwdisswordfish4 on Thursday November 05, 2020 @10:08AM (#24998860)
This question doesn't make sense. The comment is vanilla JS as "a faster Rails", not "vanilla JS is faster than TypeScript"...
Re:Python overtakes Java to become the second-most popular p... by randcraw on Thursday November 05, 2020 @02:07PM (#25000952)
https://spectrum.ieee.org/static/interactive-the-top-program...

[Access to this page may require you to create an account.]

For years, IEEE has ranked the top 55 languages based on five use cases typical of IEEE members: overall, web, enterprise, mobile, and embedded, and ranked three ways: trending overall, in demand for jobs, and used by open source.

The 2020 results, ranked overall:

1 Python 100.0

2 Java 95.3

3 C 94.6

4 C++ 87.0

5 JavaScript 79.5

6 R 78.6

7 Arduino 73.2

8 Go 73.1

9 Swift 70.5

10 Matlab 68.4

11 Ruby 66.8

12 Dart 65.6

13 SQL 64.6

14 PHP 63.8

15 Assembly 63.7

16 Scala 63.5

17 HTML 61.4

18 Kotlin 57.8

19 Julia 56.0

20 Rust 55.6

21 Shell 52.0

22 Processing 49.2

23 C# 48.1

24 SAS 45.2

25 Fortran 43.0

26 Cuda 41.0

27 Visual Basic 40.3

28 Objective-C 38.9

29 Delphi 38.6

30 Perl 38.2

31 Verilog 37.6

32 VHDL 36.7

33 LabView 36.7

34 Elixir 35.8

35 F# 34.7

36 Prolog 34.6

37 Lua 34.4

38 Lisp 33.0

39 Ada 32.8

40 Apache Groovy 32.0

41 Scheme 31.4

42 Haskell 30.8

43 Cobol 30.4

44 Clojure 29.8

45 ABAP 29.5

46 D 27.7

47 Forth 23.7

48 Ocaml 23.7

49 TCL 22.1

50 LadderLogic 19.5

51 Erlang 18.3

52 Eiffel 16.5

53 CoffeeScript 15.9

54 J 14.3

55 Racket 0.0

Re:Python overtakes Java to become the second-most popular p... by zusoomro on Thursday November 05, 2020 @07:46AM (#24997766)
Just curious, what other server side languages do you feel have a better library ecosystem than Node/JS?
Re:Python overtakes Java to become the second-most popular p... by out_of_protocol on Thursday November 05, 2020 @09:10AM (#24998318)
Depends what you mean by "library ecosystem". If it's raw number of packages then npm is number one. On direct opposite side of spectrum you can find e.g. Elixir/Phoenix - relatively small number of packages in registry but even built-in stuff covers 99% of what you want - and makes this effortless for you. E.g. after single `mix phx.new YourAppName` You get

* Pre-confugured prod/dev/test environments

* Preconfigured webpack for the environments above

* DB migrations

* telemetry/metrics with live dashboard

etc

P.S. encrypted signed cookies, changesets (validations for db models or arbitrary forms), clustering, websocket stuff, "liveview" serverside rendering ...

Re:Python overtakes Java to become the second-most popular p... by michaelpb on Thursday November 05, 2020 @04:25PM (#25002149)
I've heard great things from Elixer/Phoenix fans, so I'm sure it's a great framework, but I'd argue you get a pretty comparable set of features with some of the most popular project templates for the bigger, older frameworks like Django or even Rails.

That said, I've seen that "liveview" thing demoed and that is definitely pretty slick. Off topic but it's very similar to a package I implemented in Django like 6 years ago or so (and happened to name it the exact same thing, too) --- sadly was for work in a proprietary setting, although I'm off-and-on working on remaking it now for a different project where I can open source it.

Re:Python overtakes Java to become the second-most popular p... by tluyben2 on Thursday November 05, 2020 @07:53AM (#24997805)
JVM based languages? Also I like the .NET ecosystem as it comes with batteries included and is quick to develop with.
Re:Python overtakes Java to become the second-most popular p... by mumblemumble on Thursday November 05, 2020 @09:26AM (#24998487)
I'm finding that JVM is really starting to look threadbare as a web development language.

I haven't tried Spring Boot, so I can't speak to that, but gather that a lot of people like it. Otherwise, though, it's kind of a mess of too @#$% many options and no clear winner aside from the legacy stuff that nobody actually enjoys working with on the flagship language, an alternative language that was initially promising for web development but ultimately collapsed under the weight of its own creeping featuritis, an alternative language that collapsed under the weight of efforts to turn it into Jonathan Livingston Programming Language, an alternative language that collapsed under the weight of a cult of personality, and an alternative language that looks poised to collapse under the weight of Oracle v. Google.

Re:Python overtakes Java to become the second-most popular p... by tluyben2 on Thursday November 05, 2020 @09:47AM (#24998676)
Everyone has different ideas about what matters; I care about continuity and stability. I cannot do a monthly dance of 'library blah is no longer maintained, please try library vlah which, by the way, is completely incompatible API wise!'. I need stuff that runs fine in a decade and where the maintainers respect backwards compatibility. I have not been let down by the past decades of JVM (and PHP but I never used many libraries there, so not a good example) and last decade of .NET in that regard. I carefully make sure i know my dependencies (read the code, check maintainers; ecosystems that have millions of tiny libraries cannot work for me; I like my sleep). Things simply work and they work, without much issues, after major upgrades of libraries and runtimes throughout the years. My business goals clash with fast moving things; my clients don't want them and I don't want to maintain them. And yet my software runs under the hood of 'hip' companies; they build fast moving stuff on top of it; I like it that way.
Re:Python overtakes Java to become the second-most popular p... by mumblemumble on Thursday November 05, 2020 @10:35AM (#24999105)
I think we may be speaking to the same goals. My worry about the JVM is that, culturally speaking, the community has been losing interest in the old stable stuff (Which I get, it all looks like 20 years ago.), and so the Java ecosystem seems to be eagerly headed in a more "move fast and break things" direction.
Re:Python overtakes Java to become the second-most popular p... by tluyben2 on Thursday November 05, 2020 @10:48AM (#24999224)
Well... Compared to others it is still very conservative. And backward compatibility is taken into account for many projects.

I too find it annoying that everything feels like early 00s as it prevents uptake; I think most can be fixed by creating a new, modern website for the project, adding examples how to interact with the system with modern tools and a 'try it out in your browser'. Many Apache projects, for instance, are great and very robust in the current time, however, when you go there to do research on what to use for a new project, the examples start with XML files and then Java classes. No matter what I think of node, examples these days must include a little few-liner with node, python, go, curl, java, clojure, ... . Most people like the idea of java -jar somethinggreat.jar, but opening IntelliJ, adding all kinds of arcane (when you are used to Go, Node, etc) artifacts and then writing actual Java code which you did not want to do in the first place, really hurts adoption imho. And made many projects not even appear on anyone's radar.

Like (anecdotally) picking mongo for a (trading) case geode was basically made for, but mongo was hip, not 'old apache' and not 'old java'.

Re:Python overtakes Java to become the second-most popular p... by smt88 on Thursday November 05, 2020 @02:09PM (#25000964)
JVM is still doing well in terms of interest.

The declining interest in Java is offset by Kotlin, Scala, and Clojure.

Re:Python overtakes Java to become the second-most popular p... by bsder on Thursday November 05, 2020 @04:03PM (#25001954)
Kotlin is ranked really low. Much lower than I would expect given that it is almost an alternate Android language.

Did the Dart guys somehow gain massive momentum? Or is Electron or React eating this up?

Re:Python overtakes Java to become the second-most popular p... by mumblemumble on Thursday November 05, 2020 @06:20PM (#25003197)
For my part, as someone who's just starting to look into cross platform development again after a couple decades of not caring, I have been 100% focused on Cordova and React Native. JavaScript on the front end seems like the only viable option, so I'm going with it despite my strong distaste for JavaScript.

I dismissed everything else pretty quickly for being too limited in what platforms I could target. Kotlin's out for being a poor choice for iOS. Dart/Flutter is out for not yet having fully baked desktop support.

Re:Python overtakes Java to become the second-most popular p... by krab on Thursday November 05, 2020 @08:48AM (#24998162)
Python.

The performance lacks somewhat and the debugging tools are not as mature as JVM's. But the libraries, frameworks, and overall development productivity are great.

Re:Python overtakes Java to become the second-most popular p... by jamil7 on Thursday November 05, 2020 @09:39AM (#24998615)
Some of the newer ASGI frameworks are actually pretty good performance-wise. I haven't touched Node.js in years and recently needed a backend for an iOS project with a lot of geoJSON processing, used FastAPI and found it excellent. While Python is far from perfect it opens you up to a diverse ecosystem from AI/ML/Geo/science communities.
Re:Python overtakes Java to become the second-most popular p... by pjmlp on Thursday November 05, 2020 @08:04AM (#24997866)
Java and .NET.

Not only better library ecosystem, more performance and tooling.

Re:Python overtakes Java to become the second-most popular p... by azeirah on Thursday November 05, 2020 @07:52AM (#24997798)
PHP has a solid library ecosystem, especially around Laravel, which is what I know best.
Re:Python overtakes Java to become the second-most popular p... by mtberatwork on Thursday November 05, 2020 @08:33AM (#24998067)
I'm not sure I agree with that. Lots of stale, abandoned libraries in PEAR/packagist as well.
Re:Python overtakes Java to become the second-most popular p... by krageon on Thursday November 05, 2020 @09:39AM (#24998610)
Most libraries exposed in some sort of package repository in PHP land are pretty bad. In terms of quality, but also in terms of documentation (frequently not there, partially there or wrong). It's not even rare to find libraries wrapping things with only half of the expected functionality implemented.

To say nothing of trying to get patches into the core. Be prepared to wait months for any response at all, every time getting the feedback that there is some new minor problem (or even worse, a "this needs to be talked about" without any followup).

It's not a healthy ecosystem. For that you require high-quality core libs, a strong developer ecosystem (that doesn't mean a lot of devs, it means good ones) and a culture of third-party libraries being few but high-quality. Anything else is going to end up pissing you off, guaranteed.

Re:Python overtakes Java to become the second-most popular p... by smt88 on Thursday November 05, 2020 @11:06AM (#24999374)
JVM, Python, and .NET all have better server-side ecosystems (which I know from actual experience on multiple projects).

The original project I was discussing ended up going with Kotlin on the server, and everyone (including devs) are super happy with it.

Re:Python overtakes Java to become the second-most popular p... by xtracto on Thursday November 05, 2020 @11:57AM (#24999783)
Java ? the amount of crap that is available for Java due to its 25 years alive beats the amount of crap that is available for NodeJS.

I program in Node/JS currently and programmed in Java about 10 years ago. But my preferred language will always be Ruby. I will never understand why "the community" (ML, scripting etc) preferred Python to Ruby.

Re:Python overtakes Java to become the second-most popular p... by thunderbong on Thursday November 05, 2020 @08:46AM (#24998150)
Ruby / Ruby on Rails as well
Re:Python overtakes Java to become the second-most popular p... by bryanrasmussen on Thursday November 05, 2020 @09:44AM (#24998658)
I think basically every majorly used general programming language has better libraries than Node - which becomes problematic if your application needs to do something that you would normally expect to get by using a library - but the thing that Node has which in my estimation makes it better than almost every other language is I don't have to context switch when changing languages in between backend and frontend.
Re:Python overtakes Java to become the second-most popular p... by blandflakes on Thursday November 05, 2020 @09:17AM (#24998382)
I'm actually surprised by this sentiment whenever I see it. Node still hasn't caught up in coverage. It feels like the Node community is really proud of their number of packages, which, given the likely median size of each package, is a poor proxy for actual stability and completeness.
Re:Python overtakes Java to become the second-most popular p... by 0x445442 on Thursday November 05, 2020 @09:15AM (#24998367)
Java
Re:Python overtakes Java to become the second-most popular p... by whimsicalism on Thursday November 05, 2020 @12:19PM (#24999981)
async python
Re:Python overtakes Java to become the second-most popular p... by edanm on Thursday November 05, 2020 @03:21PM (#25001578)
A totally valid point.

Do keep in mind that one of the reasons people choose Python though, is exactly because it is used in a few different domains. E.g. I'd rather my server-side language be the same as my video-processing language be the same as my data-science language, it makes things easier.

Re:Python overtakes Java to become the second-most popular p... by doomlaser on Thursday November 05, 2020 @09:15AM (#24998364)
One of the first things I made in python, over a decade ago, was a web scraper hooked up with an OCR-software suite to harvest a lot of data on the web. I imagine that's sort of a proto-version of some of the kinds of machine vision tasks that are done with it today.
Re:Python overtakes Java to become the second-most popular p... by aprdm on Thursday November 05, 2020 @12:12PM (#24999904)
What makes you so certain it is far from #1 in web? Django is massively popular as is flask.
Re:Python overtakes Java to become the second-most popular p... by smt88 on Thursday November 05, 2020 @02:11PM (#25000984)
No estimate is perfect, but PHP is far and away #1 because of WordPress.

Here are some stats that you could and should take with a grain of salt: https://w3techs.com/technologies/overview/programming_langua...

My anecdata also says neither Django nor Flask are very populate. I have yet to encounter either one already in use by a client. Rails is also rare. I think scrappy startup frameworks are a different population than what most devs (who work at big firms) use.

Re:Python overtakes Java to become the second-most popular p... by aprdm on Thursday November 05, 2020 @04:01PM (#25001938)
Interesting how experiences can be different. I have worked in F100 companies and startups and saw a lot of Django/Flask :), Bank of America was hiring flask devs like crazy back in the UK.
Re:Python overtakes Java to become the second-most popular p... by stOneskull on Thursday November 05, 2020 @09:16AM (#24998371)
i think flask and django are quite popular.
Re:Python overtakes Java to become the second-most popular p... by _a1_ on Thursday November 05, 2020 @12:19PM (#24999976)
This is just TIOBE, nothing more. If one wants other markers, it's possible to use different benchmarks/indexes. For example, I like this one:

https://www.techempower.com/benchmarks/

Re:Python overtakes Java to become the second-most popular p... by thefounder on Thursday November 05, 2020 @09:28AM (#24998519)
Go has the best std lib of all.