My answer depends on what you mean by “productive.” I can produce the most working code per hour in SQL. I also get paid the most per line of code for SQL. Replacing 300 lines of application code with 20 lines of SQL gives a net reduction in source code (if that’s what you mean by “output”).
I can write working application code fastest in C, meaning the most lines of code per hour. That doesn’t necessarily translate to what I call “productive” in the sense of something that solves a business problem and doesn’t incur long-term costs.
I can write PHP code very fast too, from years of experience working with legacy PHP projects.
I think of “productive” as making the most money for the time I spend. Programming languages have little to do with that measure of productivity.
Yeah, I'd say the kind of code that you're writing makes all the difference.
For instance, Python has scikit-learn, pandas, jupyter and similar libraries for doing scientific computing. If I were trying to do this work in Java or Javascript I'd have to write a lot of code from scratch.
On the other hand there are things I could write quickly in Python that wouldn't run fast enough so one might say my productivity is 0 (no useful final product) if I write in Python.
Having worked extensively with Python, Ruby, TypeScript, Go, and Rust at various times, I definitely feel most productive in Rust. It's also the language I've spent the most time with, though, so there's a bit of bias there.
Part of why I'm so productive, I think, is that I trust the type system to "catch me"; I make a change in the most obvious way I can think of, and then see what the downstream effects are by looking at which callsites and expressions I've broken, according to the compiler. I don't have to think through every implication of every change, so my brainpower is saved for more complex things like reasoning about async control flow or thinking about performance.
4 comments
[ 2.8 ms ] story [ 27.2 ms ] threadI feel particularly productive in Python and R but I think I write my best code in Go, C#, or Elixir
I can write working application code fastest in C, meaning the most lines of code per hour. That doesn’t necessarily translate to what I call “productive” in the sense of something that solves a business problem and doesn’t incur long-term costs.
I can write PHP code very fast too, from years of experience working with legacy PHP projects.
I think of “productive” as making the most money for the time I spend. Programming languages have little to do with that measure of productivity.
For instance, Python has scikit-learn, pandas, jupyter and similar libraries for doing scientific computing. If I were trying to do this work in Java or Javascript I'd have to write a lot of code from scratch.
On the other hand there are things I could write quickly in Python that wouldn't run fast enough so one might say my productivity is 0 (no useful final product) if I write in Python.
Part of why I'm so productive, I think, is that I trust the type system to "catch me"; I make a change in the most obvious way I can think of, and then see what the downstream effects are by looking at which callsites and expressions I've broken, according to the compiler. I don't have to think through every implication of every change, so my brainpower is saved for more complex things like reasoning about async control flow or thinking about performance.