Why does Linus Torvalds say Java is a horrible programming language?

Joined
May 22, 2010
Messages
2,079
Why does LInus feel that Java is a horrible programming language? If used properly it's not so bad is it. Someone explain the meaning of why he said that because I've only learned to program in Java becuase I only have a minor in programming and it's the only other programming language I like as much as C and C++ considering it's portable. If Linus believes this what does he recommend instead and is there anything else like Java besides ASP? Someone one please clarify this.
 
Probably because it's managed and not native code like C/C++.

Check out C# for MS's version of Java.
 
The virtual machine concept, garbage collection and reliance on large libraries. It all adds overhead and he hates overhead. Linus Torvalds is a very opinionated man and he loves C. As far as I'm concerned, many different programming languages are useful, but you need to use the right tool for the job.

On the flip side, Linus must really hate Android then. Linux core with Java-based userspace code?
 
Linux is an interpreted language and SLOW when compared to compiled languages. It is better than it used to be, but I still don't like it.

It is more portable, but that is really the only thing going for it in my opinion.

About 10-11 years ago I played with it and when doing math calculations, I would say Java was like a glacier and C was like a Cheetah speed-wise.

A few years after that, one of my college programming courses used Java. One of the projects was to debug a program. The program was so slow (using 100% CPU when just sitting there) that it was impossible to do anything. It turns out that the main loop had no delay and so was just using as much CPU as it could just polling for input.

I fixed that so the program was actually usable.. and that wasn't even the bug we were supposed to find and fix.

And if you ever encounter certain web based programs that use Java, sometimes you have to keep an older/buggy/insecure version of Java installed just to use it. Up till about a year ago, the ADP web portal was like this.

So, unlike other languages that will just work, Java breaks stuff with newer versions that was written to work with older versions.

If you had something like that in a compiled language, it would just work barring a new OS breaking something.
 
You should not be that bothered by Torvalds likes or dislikes in a way he will describe what he discovered about something and then sometimes have a "strong" opinion about it that even when he is right he manages to still piss off people in the way he puts his pet peeves forward ....
 
You should not be that bothered by Torvalds likes or dislikes in a way he will describe what he discovered about something and then sometimes have a "strong" opinion about it that even when he is right he manages to still piss off people in the way he puts his pet peeves forward ....

He didn't piss me off. He just left me wondering what language I should use to do the same thing as Java.
 
He didn't piss me off. He just left me wondering what language I should use to do the same thing as Java.

Gonna give you a little hint here: it doesn't matter. The language used doesn't matter nearly as much as the design, techniques used, and implementation of your representation of all those 1s and 0s.

If you develop well, you'll reach a point where the language used is just syntax - a loop is a loop, a variable is a variable, and they all end up trying to do the same thing - turning transistors on and off.

Many developers seem to think that 'their' language is the 'correct' language. Fact is, poorly designed/implemented code is poor code, regardless of the language written in.
 
You are missing the point, to you Java has some use.

Apparently I am, but I can't see thing from Linus's perspective because even though he's a programmer he actually is more of a computer scientist because he knows how to make the kernel and that's the most important thing to him, which I don't blame him considering he knows what direction it should go in if nobody else who may also be working on it with him.
 
The virtual machine concept, garbage collection and reliance on large libraries. It all adds overhead and he hates overhead. Linus Torvalds is a very opinionated man and he loves C. As far as I'm concerned, many different programming languages are useful, but you need to use the right tool for the job.

On the flip side, Linus must really hate Android then. Linux core with Java-based userspace code?

Yes, I see what you mean and my professor stressed this alot about Linux and UNIX that using the right tool for the job is important. Also C is a very powerful programming language as well as C++, so using Java probably doesn't make as much sense as I thought. Even if it is auto-completing for the user. Therefore, that must be why he said it was slow it must not be the right tool for the Job. However, I don't understand this comment completely yet because the only other alternatives are from Microsoft that I know of and he probably should avoid those.
 
I'm certainly not a programmer but didn't enjoy learning the foundations of Java.

Best quote I've ever heard regarding it was on bash;

'Saying Java is good because it works everywhere, is like saying anal sex is good because it works on anything'.
 
I'm certainly not a programmer but didn't enjoy learning the foundations of Java.

Best quote I've ever heard regarding it was on bash;

'Saying Java is good because it works everywhere, is like saying anal sex is good because it works on anything'.

LOL, that and unfortunately the receiving end probably won't be able to crap right for the rest of their life, but whatever.
 
Java, write once, beta everywhere.

hahaha good one, but I feel a Microsoft alternative is important and like Java is the only one. If it's not truely an alternative to Microsoft's solutions then what is it as well.
 
Last edited:
Linux is an interpreted language and SLOW when compared to compiled languages. It is better than it used to be, but I still don't like it.

It is more portable, but that is really the only thing going for it in my opinion.

About 10-11 years ago I played with it and when doing math calculations, I would say Java was like a glacier and C was like a Cheetah speed-wise.

A few years after that, one of my college programming courses used Java. One of the projects was to debug a program. The program was so slow (using 100% CPU when just sitting there) that it was impossible to do anything. It turns out that the main loop had no delay and so was just using as much CPU as it could just polling for input.

I fixed that so the program was actually usable.. and that wasn't even the bug we were supposed to find and fix.

And if you ever encounter certain web based programs that use Java, sometimes you have to keep an older/buggy/insecure version of Java installed just to use it. Up till about a year ago, the ADP web portal was like this.

So, unlike other languages that will just work, Java breaks stuff with newer versions that was written to work with older versions.

If you had something like that in a compiled language, it would just work barring a new OS breaking something.

Linux is an interpreted language ... linux is not a language, it's a program usually referring to the kernel which is written in C and some assembly. Nothing here is interpreted.

Java might have been slow 10 years ago but it's widely used and has likely had many improvements. I dabbled with Java8 and liked it. There are tradeoffs though. Don't want to manage your own memory (pointers) and want your hello-world application to run on anything? write java or any one of the similar languages.

the rest of your post is incoherant.
 
Linux is an interpreted language and SLOW when compared to compiled languages. It is better than it used to be, but I still don't like it.

It is more portable, but that is really the only thing going for it in my opinion.

About 10-11 years ago I played with it and when doing math calculations, I would say Java was like a glacier and C was like a Cheetah speed-wise.

A few years after that, one of my college programming courses used Java. One of the projects was to debug a program. The program was so slow (using 100% CPU when just sitting there) that it was impossible to do anything. It turns out that the main loop had no delay and so was just using as much CPU as it could just polling for input.

I fixed that so the program was actually usable.. and that wasn't even the bug we were supposed to find and fix.

And if you ever encounter certain web based programs that use Java, sometimes you have to keep an older/buggy/insecure version of Java installed just to use it. Up till about a year ago, the ADP web portal was like this.

So, unlike other languages that will just work, Java breaks stuff with newer versions that was written to work with older versions.

If you had something like that in a compiled language, it would just work barring a new OS breaking something.

Good answer, so what should be a Microsoft Alternative instead of this programming language. Also I have considered that this is an older language than Microsoft Implementations and that it has probably been revised many times, but hasn't resolved the problem and may have or still needs to be redesigned from the ground up. However, nobody has done this except Microsoft, which defeats the purpose because in the end that company still ends up racking in all the doe and taking everyone's freedom, even if they do happen or happened to do it better while the rest of us are left with nothing because we can't afford their solution or don't need another unnecessary expense. I see that Microsoft did make Visual Studio Code, but it's not Visual Studio and their are other better Linux based IDE's or alternative's that can still get the job done, like JGrasp or Eclipse and Emacs if it applies because it is unusual to use in the way it functions or atleast what I've become used to coming from being trapped in a Microsoft world for so long and not being able to see or appreciate the alternatives as much.
 
what? are any of you developers or just shooting from the hip?
 
Linus has many strong opinions, but ultimately those are just his opinions. Java and C++, which he has also called horrible, are not horrible languages. At least with his C++ criticism he gave reasons (tl;dr main thesis: too many n00bs use it). For his Java criticism, he just made a throwaway statement without backing it up.
 
Java is not more horrible than C# or any other mainstream languages. The problem with Java programming is with its compiler, which usually compiles into executable that requires a JVM to run. The point of JVM is so that a unified environment can be created on top of different platforms(OSes). This is all great except that the environment within JVM changes from time to time, thus defeating the purpose. In the real world, people need to keep different version of Java just to ensure apps (especially old apps) that requires them runs.

Aside from the issue with JVM, Java is less efficient when compiled to native machine code compare to C/C++, but the upside is that it is actually easier to code. That is, if you want to write something that is 'lean and mean' (i.e. viruses), C/C++ is the way to go.

Suppose you don't need your code to be that 'lean and mean', where you need to manually allocate memory down to bits, then Java is great as it is a higher level language that you don't need to know every bit of things and you can focus on the logic of what you really want to do. Once you compiled the code, it runs (in theory) in all JVMs of the same version regardless of the underlying platform.

However, because Java executable require JVM to run, it is really tricky if you want to communicate to the platform (OS), and since different platform has different APIs, doing so with defeat the purpose of using Java as it won't run cross platform. So say if you want to write a program that passes print jobs from a MS sql server to MS print server and monitor its status, then C# will be a better choice.

There are newer methods on solving problems nowadays as virtually everyone carries a computer with them and neither 'platform specific' or 'requires installation' is a good option. Instead of creating JVM within the client computer, we create containers within servers, which can be accessed via any browser. Suppose the target platforms are exclusive to Windows OS, then C# is the way to go. Otherwise, Java will do just fine.

I personally don't like Java as it is (IMO) outdated as the idea of running apps directly on OSes is outdated. Instead, apps are served via the web so neither Java or C# is a good choice. You can build a web app with HTML5 + Javascript and you can build a web server with NodeJS + Javascript, meaning that Javascipt will be the one language that you need to know to handle both front and back end. In fact, Typescript sits on top of Javascript, making it more structural.

At the end, it really depends on work you want to do. C/C++ is ancient, low level language that produces 'lean and mean' programs, C#/Java is a higher language where functionalities > performance, Javascript is for everything over the web.
 
Last edited:
Why does LInus feel that Java is a horrible programming language?


Let's look at what Linus actually said: What does Linus Torvalds think of Java and the JVM?

When we actually look at his remarks in context, we realize that he's got no solid reasoning for this opinion. He's just being petulent and seeking attention.

There's really, then, no value in his opinion. You won't learn anything about Java, the JVM, or any other language by studying this opinion.

You do, however, learn something about Linus.
 
What drove me away from Java many many years ago what the constant change in libraries. Swing 1.x if I remember correct. And many other libs too. With no easy way to migrate between versions. Plus the development environments felt slow. Understand it was early in the lifecycle of Java.

Few month ago I gave it another try on Android but I still don't like it too much; the Android SDK on my Mac also didn't helped much to let me feel home.
I stay with my Xcode and IOS (Objective C and Swift; though Swift also have some tendency to change every version; at least the refactoring is a bit better these days).
For server backend I kind of like Python.

So I guess I remain stay away from Java until I have to code for money in it.
 
Curious, why do you hate Microsoft and C#? It's probably one of the best/supported managed languages out lol.

As for the javascript is for everything on the web - yes, true, a nodejs backend can be used, but is it always the best tool for the job? Node has it's issues too, as do all languages. Java and .Net/MVC have great web api solutions as well.
 
Curious, why do you hate Microsoft and C#? It's probably one of the best/supported managed languages out lol.

As for the javascript is for everything on the web - yes, true, a nodejs backend can be used, but is it always the best tool for the job? Node has it's issues too, as do all languages. Java and .Net/MVC have great web api solutions as well.

Microsoft does make things easy to use, but maybe a little to easy though. Therefore, it's to easy to write viruses and malicious programs for it. You can't say this about Apple, even if they do make the easiest products to use, but what you can say about them is that their products are to restrictive and can't even do aliases in command line like Linux can by default. I don't like that C# pretty was made and restricted to Microsoft WIndows Implementations for regular use if I'm not mistaken. I don't know C# either and only looked into it while and after learning C++ as well, so I didn't really know much about it other than it's Microsoft ties and what you said in quotes. I probably should give it more of a chance though, but probably won't and I want to stick with Java despite its problems.

I just don't like somethings about Microsoft and their OS either, even if Windows 10 in a dual boot with Ubuntu is working out pretty well for me from my Upgrade from 7. Except that I have to do a boot repair of it after every time I log into Ubuntu if I boot to it. it works fine and their first party programs work better than Linux alternatives, such as OpenShot vs. Windows Live Movie Maker considering OpenShot can't do Dynamic Titles, Captions, or Credits. Also 3rd party program support is really good on Windows for things like Adobe, even though Stallman says it's malicious. What Windows doesn't do well is the dd command or anything else Unix Like that Linux can do, Like grep, sed, or awk. Powershell is a nightmare if you're trying to learn how to use if from internet guides too, but the same could be said about the bash shell or any other Linux shell. I use or have used just about all Operating Systems too Except the really expensive UNIX OSes and HP's the Machine as well as Multics. I probably couldn't afford True Unix, HP's The Machine, or Multics anyway, so that's going to make getting hands on experience a tough one anyway.
 
^ virtually all of that is 3rd hand, read it on a bathroom wall level of misinformation. :p

The easier answer would have been "because I don't really know anything about it, and people seem to hate it. Squawk! "
 
Microsoft does make things easy to use, but maybe a little to easy though. Therefore, it's to easy to write viruses and malicious programs for it. You can't say this about Apple, even if they do make the easiest products to use, but what you can say about them is that their products are to restrictive and can't even do aliases in command line like Linux can by default. I don't like that C# pretty was made and restricted to Microsoft WIndows Implementations for regular use if I'm not mistaken. I don't know C# either and only looked into it while and after learning C++ as well, so I didn't really know much about it other than it's Microsoft ties and what you said in quotes. I probably should give it more of a chance though, but probably won't and I want to stick with Java despite its problems.

I just don't like somethings about Microsoft and their OS either, even if Windows 10 in a dual boot with Ubuntu is working out pretty well for me from my Upgrade from 7. Except that I have to do a boot repair of it after every time I log into Ubuntu if I boot to it. it works fine and their first party programs work better than Linux alternatives, such as OpenShot vs. Windows Live Movie Maker considering OpenShot can't do Dynamic Titles, Captions, or Credits. Also 3rd party program support is really good on Windows for things like Adobe, even though Stallman says it's malicious. What Windows doesn't do well is the dd command or anything else Unix Like that Linux can do, Like grep, sed, or awk. Powershell is a nightmare if you're trying to learn how to use if from internet guides too, but the same could be said about the bash shell or any other Linux shell. I use or have used just about all Operating Systems too Except the really expensive UNIX OSes and HP's the Machine as well as Multics. I probably couldn't afford True Unix, HP's The Machine, or Multics anyway, so that's going to make getting hands on experience a tough one anyway.

One does not write a virus or malicious program for a web api - you try to hack it, and it's actually very secure these days. I'd say more secure than Linux because the support is there for developers to implement it properly.

Actually, apple has a TON of virus/spyware, it's just not broadly covered like Microsofts is. Reasearch that, you'll find tons of info on it. And, you'll also find something scary, Apple won't acknowledge it, nor fix a lot of their virus/spyware issues!

C# and .net is actually open source now, and can be run in linux environments, you should look into it, it's very powerful.

It sounds like you just dislike MS in general. A good programmed doesn't dislike any language, they just prefer the best tool.
 
Inane question regarding Linux... Yup, it's old Sharfy
 
Java is also owned and controlled by a company. Like .NET is. So when you use Java, C#, etc you are locking yourself into a proprietary platform. Java does have the advantage that it is designed to be fairly cross platform though, but as far as I know it's still closed. C/C++ is native and is not controlled by any one company. Technically, if Sun wanted to they could say that they own anything you write in it or require royalties if you want to distribute a program etc. Same with MS and .NET. So this kind of goes against the open philosophy of someone like Linus.

That said, use whatever language you feel the most comfortable with and that fits your needs.
 
Java as a language isn't that bad, Java support is what is terrible. The JVM is a joke. Besides, its basically VB that has been overly complicated. I kinda miss VB, probably the only one though.
 
One does not write a virus or malicious program for a web api - you try to hack it, and it's actually very secure these days. I'd say more secure than Linux because the support is there for developers to implement it properly.

Actually, apple has a TON of virus/spyware, it's just not broadly covered like Microsofts is. Reasearch that, you'll find tons of info on it. And, you'll also find something scary, Apple won't acknowledge it, nor fix a lot of their virus/spyware issues!

C# and .net is actually open source now, and can be run in linux environments, you should look into it, it's very powerful.

It sounds like you just dislike MS in general. A good programmed doesn't dislike any language, they just prefer the best tool.

I disagree because if your led to or happen to go to a website with ransom ware the creator has found a way to corrupt your machine regardless of it's using a web API and it's not secure if you don't put any security in place to stop it, which is or was less true of Windows in the past because most people don't create a separate standard user and administrator account let along use a host file to block sites if they don't have a content filter or enough filters on the content filter to allow them to block those unwanted sites. Why you think it's more secure than Linux is your opinion because support doesn't have as much to do with it as layers of security do and Linux has more layers to implement as well as implements them right off the bat. I say this because Linux implements a user and root or admin password during most installations of it's distributions and encryption. As for SE Linux, which I think is a thing of the past it was to difficult for most people to understand and most people disabled it, which I found it to be more like Microsoft's UAC if not exactly like it.

You point out something that's probably true about Apple's Mac OS X and that is that it does get viruses that they don't like to acknowledge this, so they just tell you Mac can only get Spyware, Adware, and Malware. Modern Mac's don't use a .exe or package installer, like Windows or Linux. Instead Mac's use a dmg image that put all the files installed in one place and when removal is desired the program can just be moved to trash. If you want to see the other files that belong to a dmg after installed I believe you click on the icon in applications and click show contents, which is an interesting concept for an installation method. I believe this also has something to do with why Mac programs can be moved anywhere on the machine and still run as well, but this may not always be true especially if the program does not use a dmg or if you're attempting to share a program with other users on the system.

Finally though the reason I don't agree with you that Microsoft is more secure than Linux or Mac is because it's popular and easier to write programs for, so it's vulnerable to everything under the sun and anyone willing to help makes a fortune off helping people with these problems if they desire to. Especially, Microsoft who probably makes a fortune helping ignorant users with their problems. The Windows community may have portable apps and a whole slew of Antivirus programs, but portable apps isn't self bootable and most of those antivirus programs eat up system resources and will eventually expire as well as cost a fortune to keep support current none of which are true of Linux or it's community. The only thing that's true of Linux is that most programs lack features found in Mac or Windows counter-parts or alternatives for some reason, which I believe have to do with programmers either not finishing their programs or not seeing these features get implemented all the way through, even if that's not true and I shouldn't think of it that way. You can't say you can install a program through repositories on Windows though if not Mac as well or in most other ways you can install a LInux program.
 
Last edited:
Microsoft does make things easy to use, but maybe a little to easy though. Therefore, it's to easy to write viruses and malicious programs for it. You can't say this about Apple, even if they do make the easiest products to use, but what you can say about them is that their products are to restrictive and can't even do aliases in command line like Linux can by default. I don't like that C# pretty was made and restricted to Microsoft WIndows Implementations for regular use if I'm not mistaken. I don't know C# either and only looked into it while and after learning C++ as well, so I didn't really know much about it other than it's Microsoft ties and what you said in quotes. I probably should give it more of a chance though, but probably won't and I want to stick with Java despite its problems.

I just don't like somethings about Microsoft and their OS either, even if Windows 10 in a dual boot with Ubuntu is working out pretty well for me from my Upgrade from 7. Except that I have to do a boot repair of it after every time I log into Ubuntu if I boot to it. it works fine and their first party programs work better than Linux alternatives, such as OpenShot vs. Windows Live Movie Maker considering OpenShot can't do Dynamic Titles, Captions, or Credits. Also 3rd party program support is really good on Windows for things like Adobe, even though Stallman says it's malicious. What Windows doesn't do well is the dd command or anything else Unix Like that Linux can do, Like grep, sed, or awk. Powershell is a nightmare if you're trying to learn how to use if from internet guides too, but the same could be said about the bash shell or any other Linux shell. I use or have used just about all Operating Systems too Except the really expensive UNIX OSes and HP's the Machine as well as Multics. I probably couldn't afford True Unix, HP's The Machine, or Multics anyway, so that's going to make getting hands on experience a tough one anyway.

I agree on most of the points, though not all.

For programs that care about performance, you aren't going to use Java because it's simply slower then pretty much everything out there. Nevermind the fact you lack the fine-grain thread control such programs often need. That same lack of thread control make it almost impossible to write optimized code that communicates directly with the OS (even if the JVM lets you, because it will fight you the entire way).

For programs that don't care as much about performance, assuming I don't care much about portability, I can make a better designed, higher performing app in half the time using C#.

Java really doesn't have a purpose. It's hanging on due to it's large legacy base, but outside of the mobile world, it really isn't used anymore.
 
Microsoft does make things easy to use, but maybe a little to easy though. Therefore, it's to easy to write viruses and malicious programs for it. You can't say this about Apple,
Your opinion has no basis in fact.

even if they do make the easiest products to use, but what you can say about them is that their products are to restrictive and can't even do aliases in command line like Linux can by default.
The "alias" command works just fine in the OSX shell.

It's hanging on due to it's large legacy base, but outside of the mobile world, it really isn't used anymore.
This is demonstrably false. Practically all of AWS is written in Java, for example.
 
For programs that don't care as much about performance, assuming I don't care much about portability, I can make a better designed, higher performing app in half the time using C#.

Java really doesn't have a purpose. It's hanging on due to it's large legacy base, but outside of the mobile world, it really isn't used anymore.

what? we use servicemix and the related suite of utilities to integrate systems. it is phenomenal for those purposes.
 
Let's look at what Linus actually said: What does Linus Torvalds think of Java and the JVM?

When we actually look at his remarks in context, we realize that he's got no solid reasoning for this opinion. He's just being petulent and seeking attention.

There's really, then, no value in his opinion. You won't learn anything about Java, the JVM, or any other language by studying this opinion.

You do, however, learn something about Linus.


"Just because he's terribly logical about his assessments doesn't mean he has to sugar-coat everything. Linus is blunt, and has a wickedly dry sense of humor - something that some people just can't deal with."
 
Your opinion has no basis in fact.{/QUOTE]

When referring to the ease of creating programs that could be viruses maybe it's not fact that it's easier to do for Windows, but it should be considering how easy it is to write VB and VB.Net programs to be malicious by themselves or with anything else they can be used with.

The "alias" command works just fine in the OSX shell.

Well if they can then they obviously aren't stored in ~.bashrc or /root/.bashrc, like they are in most if not all linux distributions, so whereever their stored it certainly would have been nice for apple care to help point me in the right direction when explaining my problem with using a journal script for documentation purposes for discoveries as well as for records all solutions to problems found on my Apple Systems. This portion seems to be getting off topic though, so lets not do that if the forum moderator won't like it.

This is demonstrably false. Practically all of AWS is written in Java, for example.

I have nothing to say about this as it doesn't seem to be directed towards my comments.
 
When referring to the ease of creating programs that could be viruses maybe it's not fact that it's easier to do for Windows, but it should be considering how easy it is to write VB and VB.Net programs to be malicious by themselves or with anything else they can be used with.
You're not making much sense. Any scripting language can be used for evil; Bash itself can do naughty things, if you want it to. I don't think it's measurably easier or harder than with VB.

Well if they can then they obviously aren't stored in ~.bashrc or /root/.bashrc, like they are in most if not all linux distributions, so whereever their stored it certainly would have been nice for appe care to help point me in the right direction when explaining my problem with using a journal script for documentation purposes for discoveries as well as for records all solutions to problems found on my Apple Systems. This portion seems to be getting off topic though, so lets not do that if the forum moderator won't like it.

Bash aliases are stored wherever you store them. Maybe this StackOverflow post can help you get sorted out.
 
Back
Top