r/learnjava • u/capm_diealone • Dec 29 '23
I don’t like Java. Change my mind.
Hi all! I don’t mean for this to be a shitpost or anything like that, truly. Lately, for some reason, posts from this sub have been entering my email. I’m primarily a C# dev, and I love Typescript as well. I’ve always hated Java. Don’t ask me why…I don’t know. When I was in school, I was more or less taught that Java is super slow because the JVM is bad.
I’d love to know what’s been up with Java, partly because a lot of banks seem to use it and partly because I don’t wanna be that guy that just discounts a whole language because of flaws it had over a decade ago.
So change my mind! I’d love to find out what’s been up with Java, and any resources y’all can provide for learning Java (bear in mind I’m a very experienced software engineer) that aren’t LinkedIn Learning (I get access through my local library but that access is down right now) would be super appreciated.
Again, this is not a shitpost. I just hate Java. Change my mind!
2
u/Vilified_D Dec 31 '23
You hate Java but use C#? (which imo c# is just java but from microsoft)
ANYWAYS. I used to hate Java too (it's a whole story on why I did hate java at the time, and my favorite language C++ came in to my picture waaay later), until I was doing a school project with an Arduino and Java literally saved the project. It was a group project, and my partner and I were using an Arduino like I said. Arduino effectively uses C++, and we were making 'smart' devices (the only real requirement was we used code to send stuff from actuators over the internet). The problem came from the main thing that makes a smart device a smart device: the wifi chip. The unit we had was a third party piece of hardware rather than one officially licensed from Arduino, and all the libraries that we found that allegedly supported it just did not work. We tried everything we could to get it to work, but it wouldn't, and writing up client server stuff in C++ isn't very straight forward (along with reading data coming from a serial port).
Enter java. Java has very easy libaries to set up a UDP server, as well as a library called jSerialComm which reads the serial port from a USB connection. Write up a bit of java for a client and a server, hook up the arduino to the PC that is running the client, you press buttons/it could read temperature, couple other things and arduino prints messages to the serial port, which java reads from, and upon getting those messages would send those messages via UDP to another PC that was running the server connection, and then the server PC would send an email. In the end, Java (which at the time I hated with a passion) saved my ass and got me an A.
I still prefer C++ because I want to do game dev, but I will never disrespect Java ever again.