r/shittyprogramming • u/fuzz3289 • May 29 '13
The End of Java
Today I was musing about the existence of Java. The big selling point to me at its inception was Write Once, Run Everywhere. It was a cool concept. Force the developers of the Java VM to worry about platform specific implementation and the programmers using the language just focus on getting one set of code done that anyone can use.
In today's day and age, we have web apps. Some fancy HTML5 mixed in with some splashy CSS with a Python back-end and bam. You've got an application that can run anywhere. Sure you might have some browser specific implementations, but generally speaking you can write one set of cross platform code in the form of a webapp.
And if you're application is too big for a webapp? Then Java is probably too slow to be worth it anyways.
Java is full of security holes, performance is dreadful, readability is at best the same as C (in my opinion of course), and cross platform programming can be done in other languages more efficiently and much more cleanly (also slightly subjective).
My question to you, is Java coming to an end? Does this language have what it takes to cut it in today's world?
We have languages like Python, Go, C++14, CommonLisp etc, that make Java look slower than Windows 95 and have 10x the readability. If you use Java, speak up, why do you use it? Could you use something else? Or is Android and other legacy Java support going to continue to drag this dead horse around?
11
u/ISNT_A_NOVELTY May 30 '13
VB reads much more like ordinary written language, which is why I personally think it is the language of the future. VB 7 does this so well that you can give it a whole thesis and it will compile and run it.
6
u/ekolis May 30 '13
Perl will do that too, assuming you replace "thesis" with "gibberish mess of punctuation and the occasional letter or number thrown in here and there"!
edit: and with the proper regex, you too can transform your VB code into Perl code!
9
u/Ilostmyredditlogin May 30 '13
Java / jvm gets so much undeserved hate... It's a tool, and like any tool it can be used poorly it well. I can slam together java, Scala and closure code in one modern framework like play and deploy all over the web with zero hassle.
There's a whole arsenal of languages that compile to jvm and interoperate including jvm versions of python ruby etc. JDK 8 finally brings anon functions and whatnot into the flagship language (java). Multiple compatible jvm implementations from different major vendors. Huge library of established code to draw from...
The java ecosystem is great for large scale projects at least.
4
u/gnidoc Jun 01 '13
Why do you make claims like
performance is dreadful
without any citation, reference, benchmark or anything?
Check out these tests: http://benchmarksgame.alioth.debian.org/
Java is far from slow. Python, CommonLisp and Go implementations are much slower for computationally intensive tasks.
12
May 29 '13
Bah, if a language dies once it's buggy, hard to use, and can be easily replaced by other, more powerful, languages, C++ would have died years ago.
7
3
u/HINDBRAIN May 29 '13
Bal-musette is passé indeed, so Java is outdated. We should probably move to Boogie. Python is nice and all but snake dances should remain in school.
5
u/ekolis May 30 '13
But without Java, what use are the cupholders on our PCs?
2
u/Haiku_Detector_Bot May 31 '13
Your comment can be read as a (dodgy) haiku!
But without Java,
what use are the cupholders
on our PCs?
Did I screw up? Let me ^know!
5
u/Kapow751 May 31 '13
A haiku detector bot that triggers on non-haikus. Boy, are you in the right place.
0
u/BalsakianMcGiggles Jun 01 '13
Not really a non-haiku. The last line you have to read "PCs" as three syllables, but I can kinda see that.
10
u/andkore May 29 '13 edited May 30 '13
This is shittyprogramming, but in case this part was serious, I'd like to contend that Java is "only" as readable as C (which seems to imply that C isn't very readable). I guess I'm weird, but in terms of readability I would put Java above C, and C above Python. I hate Python's syntax.
Edit: As more people upvote this, I feel compelled to add that I really was being serious.
Edit: Contend is the wrong word. The right word in this context is contest.
2
3
May 30 '13
I agree. The next version of java should just be a brainfuck compiler. Java uses too many characters, and that's why it's so slow.
3
u/yaaaaayPancakes May 30 '13
Moving to Java from C# (Doing Android dev now) makes me sad. When I learned about Type Erasure, my mind was blown by the stupidity.
2
u/stillwaters May 30 '13
C# was able to do so well because it started from scratch, and Java suffered because it needed to maintain backward compatibility with many earlier versions. But C# could have easily taken Java's place if it weren't for Microsoft's silly aversion to cross-platform availability.
2
u/inconspicuous_male May 30 '13
I just spent 3 long miserable hours working on stupid Swing and awt graphics in java for a final project. I hate it too much to quit.
2
u/needisaymore Jun 01 '13
I'm curious to know if Swing ever actually gets used in Industry projects?
0
May 31 '13
[deleted]
-2
u/fuzz3289 May 31 '13
What about garbage collection and memory allocation? Those have pretty big performance implications.
I get your point about the ifdef hacks but to me its always seemed worthwhile to have true control over memory. May effect your development time but the thought of garabage collection always bothered me.
Erasure and typecasting are weak in Java as well.
Not to mention using iterators in Java. I mean, C isn't great either but at least I can look for end or null. Python did iterators right.
And lastly. Function pointers. Missing?
I mean these are things I've come to expect from modern languages and sure they're not necessary but to me they're dealbreakers. I feel like Java is missing a lot of power and features modern languages should have.
Correct me if I'm wrong. I don't write much java.
2
Jun 01 '13 edited Jun 25 '23
edit: Leave reddit for a better alternative and remember to suck fpez
1
u/fuzz3289 Jun 01 '13
C++ is finally getting lamdas as well, I feel your pain on that one. Python written with Cython or Pypy is pretty much nice looking C though.
My main use for python has been parsing and analytics. The NumPy library is very very efficient when it comes to this and wrap it in pandas you're looking at C style speeds because numpy preallocates memory while parsing.
I agree my initial wording was bad as many people have pointed out, but as you mentioned, there's a lot that Java is missing that other languages have been picking up.
I'm always looking at what languages I should be profficient in and at the current rate of growth in the Java language it seems like I can get more power elsewhere and 5 year from now that seems even more likely.
Would you agree oracle has been dropping the ball?
0
Jun 01 '13
[deleted]
0
u/fuzz3289 Jun 01 '13
With C I can specify variables of one BIT in size. I can stick 8 booleans into one of Javas (assuming java has 1 byte bools as most languages do). Most of my career has been working on extremely memory critical applications, garbage collection for us isn't an option at this low a level.
2
u/needisaymore Jun 01 '13
I think Java is a great work-horse when you need difficult jobs done. That being said, I think Scala is the next evolution of Java which will take its reigns. The future of programming is going to focus on utilising concurrency which is where Scala with Akka is designed to shine. Not to mention that Scala is great as a scripting language in its own right too.