Live data from Hacker News

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

techrepublic.com

241–250 of 357 posts

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

#241
post #34

Earlier quoted context omitted.

Logo is still very commonly used in early educational settings - maybe not typically for engineering applications, but I'm confident it has far more people using it than the other languages you list.

I have a hard time believing that Logo should even be used by a fraction of the people using for example Kotlin, which is a very popular language for Android development ...

And yet... there are currently more elementary school children in California than there are Android apps in the world.

(The parent link has a quote from TIOBE CEO that illustrates they are not considering only professional software engineer use)

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

#242

Earlier quoted context omitted.

They rank C number 1. There is no way that reflects reality. JavaScript is easily number one for reasons that will surprise nobody. On the WakaTime public leaderboards it dominates to such an extent that I think programmers spend more time writing JavaScript than all the other languages combined. I don't know if that generalizes to the broader population, but it gives one an idea how ubiquitous it is.

I can't actually say what the popularity of C/C++ is. But I don't know what you do for a living but in general Hackernews tends to have webdev tunnel vision. Embedded, operating system development, browser development, OS, driver dev, games, telecoms, compilers, lots of IoT, systems development generally, all of this is in C/C++, and will be for the forseeable future. That is a lot of lines of code, but mostly invisi…

I've worked (not just played with) almost twenty languages in a career about the same length in years.

I'm well aware of the things C and C++ are used for. I'm currently mostly working in Rust at that moment to make use of libraries in C++. But I think web development easily swamps that kind of work in terms of number of developers.

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

#243

Earlier quoted context omitted.

This was my heuristic years ago before Python got type annotation support. Now there are linters that take type annotations into account, and LSP servers that can catch type errors as you write Python code. I've found that using Python for large projects is both fine and productive as long as you utilize type annotations and modules. Ambiguity goes out the window when you do that.

I was really happy when I first learned of type annotations being added to Python. However, much of that excitement evaporated when I read that it was just a 'hint' and not something that's enforced.

This was also my initial reaction. However, if you couple type annotations with an LSP server[1] that takes the annotations into consideration[2], you'll get on-the-fly type checking in your editor or IDE. That way you can catch type errors as you write your typed Python code.

Besides VS Code, these days lightweight editors like Kate, Sublime Text, Vim, etc can all take advantage of type checking LSP servers for Python.

[1] https://github.com/palantir/python-language-server

[2] https://github.com/tomv564/pyls-mypy

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

#244

Earlier quoted context omitted.

This was my heuristic years ago before Python got type annotation support. Now there are linters that take type annotations into account, and LSP servers that can catch type errors as you write Python code. I've found that using Python for large projects is both fine and productive as long as you utilize type annotations and modules. Ambiguity goes out the window when you do that.

I was really happy when I first learned of type annotations being added to Python. However, much of that excitement evaporated when I read that it was just a 'hint' and not something that's enforced.

It's not enforced by CPython the interpreter. You run mypy to enforce the type hints: http://mypy-lang.org/

It's quite good.

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

#245
post #79

Earlier quoted context omitted.

I moved/was pushed over to Python around a year ago, after writing C# for 15 years. My Python setup is as follows: * vscode * pylance * black formatter * flake8 * python typing annotations used as much as possible This seems to work very well with regards to autocomplete and preventing run-time errors. One thing I do miss is proper refactoring support.

> One thing I do miss is proper refactoring support. You should try PyCharm then. That, and their debugger is orders of magnitudes better than VSCode.

Seconded. I had an IDE I was used to and loved and the first time I pair-programmed with someone using PyCharm I threw it out and switched. Doesn't mean it will be the same for you, but it's miles ahead of everything else I have used in 15 years for Python. FWIW, I like VSCode just fine for everything else, PyCharm is just so handy.

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

#246
post #214

I got back into python recently and one thing that really confused me: there's no good way to manage packages, apparently? Meaning: if someone clones my repo, there's no single, correct way for me to have specified the dependencies in a machine-readable format, so they can run the equivalent of "npm install", and get things working. Is that really true?

Use poetry. https://python-poetry.org/

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

#247
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.

Python doesn't have it but I think they are talking about mypy, options typechecker tool that has type inference.

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

#248
This might be a stupid question but anyway...

Is there someone well-versed in a statically typed language who would still prefer python most of the time? Could you explain why?

For me it's just the opposite. When I program I think about the types first. When I read code I care more about types than variable names. This is in my opinion the way to go even in C.

Also most python programmers I know are engineers and for them it would be a waste of time to learn C++. I would like to know why an experienced developer might prefer python ...

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

#249
"In the past, most programming activities were performed by software engineers. But programming skills are needed everywhere nowadays and there is a lack of good software developers,"

This is an important distinction and often missed from programming language discussions.

Engineering languages like C++, Java, Rust focus on being able to create robust APIs, handle incredible complexity, deal with dependencies, etc. Hacker languages like Python, PHP, erlang, and Go focus on an approachable language, libraries that tackle problem domains, etc.

There is obviously a lot of overlap. But I think it's good to keep in mind that engineering and hacking don't always align.

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

#250
post #94

Earlier quoted context omitted.

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).

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?)

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.

Post reply on HN