Live data from Hacker News

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

techrepublic.com

141–150 of 357 posts

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

#141

Earlier quoted context omitted.

I've often found that starting some quick-and-dirty thing in shell scripts is great, but once I get to around 100 lines of shell script code, I'm better off switching to python (or similar). Similarly, once I get to around 1000 lines of python code, I'm better off switching to compiled, statically typed language (e.g., Java, C, C++, etc.). So my own heuristic has become: shell script when

I live by very suspiciously similar rules of thumb although my tolerance in the past for dynamic scripting languages was probably closer to several hundred lines of code. However, I have to acknowledge that modern IDEs (and even advanced code editors like VSCode) have pretty good support for dynamic scripting languages these days that make working with them in larger code bases not entirely painful.

Yes, PyCharm was an amazing help.

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

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

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

#143
post #102

I was a Python dev for 14 years or so (now doing mostly personal projects in C/C++, Scheme, Clojure), and 10 years ago met my partner who is a biologist. I think one thing programmers underestimate is how many scientists and academics are using Python. It's not just ML, it's pretty much every kind of scientist and tons of non-science academics too. The fact that it's a great "casual" or part-time language is huge for…

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.

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

#144
post #127

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…

> I'm writing some Java at the moment for an Android app, and it's just killing me after doing Scheme and Python Android isn't Java though. It's some frankenstein contraption made from a mutated version of Java from a decade ago. > I were starting my own business now, I'd use Clojure or Scala. I personally wouldn't ever choose Scala for anything. It's tooling is horrible (Sbt is a special hell, and scalac is as slow…

Interesting, I've only read Scala. Personally I like Clojure but thought I should mention it as I see businesses mixing Scala with Java successfully in my work.

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

#145
post #137

Darn it, yet another hint that I'm not getting any younger. 20 years of Java experience and no intention of learning a new language... When prompted, I usually snark that you don't ask a professional violin player to "just" switch to viola either.

Yeah, but in fairness they probably could, a lot easier than switching between programming languages

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

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

Yeah. When you have two experts in a garage, it rocks. When you absolutely need to hire some new folks in little old Victoria in the next two months so you turn to bootcamps and interns, not so much.... ;-)

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

#147
post #107

Earlier quoted context omitted.

I've used 'import gc' in python programs. gc.get_referers and gc.get_referents is very helpful.

I'm guessing you've been doing this for a while though... when you see that in a code base that you know has major issues and was made by fairly new programmers, it's like "oh god please tell me that doesn't mean garbage collector, I'm going to need a stiff drink"... :-)

yes, I have been doing 'import gc' for 20 years. Well, technically, I stopped about 15 years ago because I haven't had any unexpected references hanging around for that long.

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

#148

Earlier quoted context omitted.

> I'm writing some Java at the moment for an Android app, and it's just killing me after doing Scheme and Python, but I have to admit, if that start-up had used Java or C#, they might have been better off in the long run. that’s a logical fallacy. chances are that if they used Java or C# they might be dead by now (ie it sucks but usually it’s a good problem to have)

I know what you're getting at, and I agree with the sentiment very often, most of the time even. But in this particular case, I don't think so, and believe me, I spent a lot a of time thinking about that....

So what are your thoughts?

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

#149
post #85

Earlier quoted context omitted.

What does typescript have to do with speed?

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.

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

#150
post #10

Earlier quoted context omitted.

dataclasses are the best recent addition to Python, IMO, maybe tied with ordered dicts. Python definitely doesn't have conceptual simplicity, because there are many competing concepts in the language, and lack of focus on uniformity. (Example - enums are implemented with a metaclass and dataclasses with a class decorator - arguably the latter is the wrong choice, because it is already evident it limits what kind of f…

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.

There is no "No", you can just add your opinion about your favourite feature instead.
Post reply on HN