Hacker News new | ask | show | jobs
by jcranmer 2823 days ago
> I have absolutely no doubts that the most used language is JavaScript - considering nearly every website in existence relies on it.

If you count by total lines of code running in production, then the most likely winner is probably C or COBOL (decent chance your paycheck relies on large COBOL applications working correctly). If you count it by lines of code times number of running instances, then I'm really hard-pressed to pick any other language of C because of its sheer prevalence in things such as cars. If you count by number of programmers, I'm not sure what the winner ends up being.

Even crufty old languages like FORTRAN or COBOL have surprisingly wide usage. Sure, they may be completely absent in user-facing applications, but it's easy to forget that such applications are only a small portion of applications. JS itself would probably end up somewhere in the bottom half of the top 10 in most metrics of "top languages," as it has very little presence outside of user-facing applications.

2 comments

> If you count by total lines of code running in production, then the most likely winner is probably C or COBOL

By lines of production, it's definitely Javascript. COBOL doesn't come close. What was a lot of developer time in the 80s is dwarfed by the number of people around the world working on websites alone (much less this Node.js silliness).

More Javascript is written every day than is produced in C, all year due to lower barriers to entry, lower cost to fail, easier to debug, less (possible) side effects, and number of developers.

> it has very little presence outside of user-facing applications.

That's where most code ends up getting written. SMH

Your first mistake is assuming that COBOL code was written in the 80s and untouched since then. People are still adding to COBOL code even today, and the language itself is still evolving (the newest COBOL spec was in 2014).

> That's where most code ends up getting written.

That's where most of the easy code to find and count gets written. But there is much more code that's outside of user-facing applications. Operating systems and drivers are relatively small, but have a much higher fraction of utilization since you're always using them. Embedded code is massive--not just the obvious things such as your car or airplanes, but also things like the microcontroller in your disk drive, the bluetooth controller for your headphones, your refrigerator, your microwave. There's the business applications: billing, payroll, corporate intranet, not to mention things such as scheduling the automated builds and tests or the management of releases for all of those applications. It's easy to forget that all of that stuff exists if you never work on it, and it's especially easy to think that it can't be that large.

If you avoid double-counting libraries (which is how I interpret the first number), then applications become a lot smaller because so much of applications is hooking together libraries. This is particularly true of non-app-y JS. By contrast, a lot of the business backend application logic (particularly for things such as payroll) is essentially 100% custom-implemented, so a much smaller fraction of it is common libraries. On pretty much any other metric of code use, though, such applications become far smaller in importance.

Both R and numpy have had some of their internals written in Fortran, iirc, so the amount of Fortran getting executed may actually be going up. The amount of people programming in Fortran is probably not, though.