Live data from Hacker News

Python overtakes Java to become the second-most popular programming language

techrepublic.com

281–290 of 357 posts

Re: Python overtakes Java to become the second-most popular programming language

#281
post #112

I was a total raving Python evangelist for the first 12 years of my coding career, and then got a job as the CTO for a Python based startup that had been running absent a technical leader for 5 years, with relatively junior coders making all the decisions. I still love Python, but I now have a completely different attitude to hyper-dynamic languages (like Python, Ruby, Clojure, Elixir, etc). In my new opinion, they a…

This is true for any language, strongly typed or otherwise, with or without memory management. The evidence gathered in the last decades is pretty clear: there is little to no advantage using a strongly typed language over something like Python or Ruby (on mobile so can't look up references but there's really plenty). And that's just looking at bug density, without even considering how quickly you can build something…

Apologies for the "flexible" usage of the words "strongly typed". Arguably (as someone already pointed out) Python can be considered strongly typed (i.e. doing 1 + "1" won't cast the first operand to string, unlike e.g. JS) although there doesn't seem to be a clear definition of what strongly and weakly typed means (https://en.wikipedia.org/wiki/Strong_and_weak_typing). So let's stick with "statically" typed, which in the case of Python would mean using something like mypy.

Here are some references (there might be some overlap):

- https://labs.ig.com/static-typing-promise

- https://danluu.com/empirical-pl/

- https://vimeo.com/9270320

- https://medium.com/javascript-scene/the-shocking-secret-abou...

- https://www.researchgate.net/publication/259634489_An_empiri... (one of the original studies)

I hope it's clear I'm not implying that there are no advantages in using a statically typed language, only that it's often seen as a solution to a problem that doesn't originate there.

PS: what is up with the downvotes? What is this, Reddit?

Re: Python overtakes Java to become the second-most popular programming language

#282
post #237

Earlier quoted context omitted.

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.

JVM is still doing well in terms of interest. The declining interest in Java is offset by Kotlin, Scala, and Clojure.

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 programming language

#283

I was a total raving Python evangelist for the first 12 years of my coding career, and then got a job as the CTO for a Python based startup that had been running absent a technical leader for 5 years, with relatively junior coders making all the decisions. I still love Python, but I now have a completely different attitude to hyper-dynamic languages (like Python, Ruby, Clojure, Elixir, etc). In my new opinion, they a…

This is my experience as well. Incidentally "this is a problem of people, not language" is one of my pet peeve statements (not that I'm mad at you, of course!) specifically because I've had it used against me enough to defend choosing, imo, bad tools. Everyone thinks they have developers that are good enough that they don't need the bumpers up when they bowl. But honestly, it's just almost never true (and if it is, i…

> Everything is a spelunking expedition, and there's no type safety or anything to help you figure it out.

For any significant Python codebase, I make sure to put extra effort into precise and strict type annotations so I can rely on type safety. Sometimes after fixing all the statically detected type problems, my program works on the first try.

Python was strongly typed from the beginning, before it was statically typed. When you add a string to a number in Python, you get a type error. Python's static type system– which is formally part of the language and has multiple implementations– is an elegant and natural fit to the language. Unlike TypeScript, where the type system is artificial, and restricts what you can do with JavaScript.

Language features that made it into ruby– like blocks and unless– were rejected from Python because they would have made it possible to create advanced DSLs, which is something the language maintainers aim to avoid– enabling the creation of arcane application-specific special languages.

PEP-484 is the static type system's name: https://www.python.org/dev/peps/pep-0484/ (implementations include mypy and Pyre)

Re: Python overtakes Java to become the second-most popular programming language

#284
post #225

Earlier quoted context omitted.

No, (optional) static typing is the best recent addition to Python. It allows IDEs to catch a large variety of errors. The static type system is part of the language and has multiple implementations. It's Hindley-Milner, making it two-way, like Haskell's type system.

Wait what? Are you saying Python has a Hindley-Milner type system? What's it called? Google didn't turn up anything.

It's called PEP-484, and it's part of the language https://www.python.org/dev/peps/pep-0484/

Pyre and PyCharm are third-party implementations of PEP-484.

Re: Python overtakes Java to become the second-most popular programming language

#285
post #7

The past month I have used Python again after a few years and I have to say I didn't quite like the experience as much as before. On one hand I also used vanilla Python instead of something easier to use like Django but the amount of preventable run-time errors and the lack of IDE autocomplete support at various points was kind of off-putting after coming back from very strictly typed languages like Swift, Kotlin or…

I don't understand why someone would use Python instead of say using Ruby. I think right now it is a matter of "synergy" given that Pandas, Torch and all those libraries are more tailored for Python, but as a scripting language Ruby is just so much easier, elegant and intuitive [ len(something) vs something.length ]

> [ len(something) vs something.length ]

The first reads like english, the second doesn't.

Re: Python overtakes Java to become the second-most popular programming language

#286

Earlier quoted context omitted.

I actually do due diligence on tech firms now for a job, and you're 100% right that the tradeoffs change dramatically when the company grows. Which doesn't mean that using the best thing possible for your expert coders at the beginning is wrong. At the beginning, you need every advantage you can get, and if you have expert programmers, give them the sharpest knife you can find! But yeah, once your company is hiring h…

Why would you make technical decisions based on what hyponthenictal new owners would prefer in a hyponthenictal acquisition in 5 years?

What's "hyponthenictal"?

You used it twice, but it's not on Google...

Re: Python overtakes Java to become the second-most popular programming language

#287
post #102

Earlier quoted context omitted.

From what I've seen, jupyter notebooks reach convoluted excel formulas-level of accessibility and efficacy for lay people. Most of us really underestimate what "non" programmers can achieve with if/else, loops, equality tests, a repl and autocompletion.

Yeah I'm guessing code quality is _tanking_ around the world. Lots more code , a lot less quality.

Perhaps, but when I built the shed in my back yard I didn't enforce the same standards a construction engineer would for a skyscraper. I increased the quantity of "shitty construction" in the world, but it works great for my purposes.

Re: Python overtakes Java to become the second-most popular programming language

#288
post #7

The past month I have used Python again after a few years and I have to say I didn't quite like the experience as much as before. On one hand I also used vanilla Python instead of something easier to use like Django but the amount of preventable run-time errors and the lack of IDE autocomplete support at various points was kind of off-putting after coming back from very strictly typed languages like Swift, Kotlin or…

> as dumb as JavaScript Could you elaborate on this?

[deleted]

Re: Python overtakes Java to become the second-most popular programming language

#289

I was a total raving Python evangelist for the first 12 years of my coding career, and then got a job as the CTO for a Python based startup that had been running absent a technical leader for 5 years, with relatively junior coders making all the decisions. I still love Python, but I now have a completely different attitude to hyper-dynamic languages (like Python, Ruby, Clojure, Elixir, etc). In my new opinion, they a…

> ever seen "import gc" in a Python program?

Yes, I see it all the time. People think that `gc.collect` collects all the garbage, but that's not true. It only checks for reference cycles.

Re: Python overtakes Java to become the second-most popular programming language

#290
post #142

I was a total raving Python evangelist for the first 12 years of my coding career, and then got a job as the CTO for a Python based startup that had been running absent a technical leader for 5 years, with relatively junior coders making all the decisions. I still love Python, but I now have a completely different attitude to hyper-dynamic languages (like Python, Ruby, Clojure, Elixir, etc). In my new opinion, they a…

This precise struggle is why Go is created, and also why Rob Pike said what he said. The industry needs a statically typed language with good ergonomics (not typing too much) and performant. I agree with you, asking everyone to be discipline with their code in a dynamic language is a bit too much to ask (unfortunately).

Too bad the lack of generics means it has awful ergonomics in reality.

I also think rust's ? makes the "return err" pattern much nicer to deal with.

Post reply on HN