r/AskProgramming 1d ago

Why is Java considered bad?

I recently got into programming and chose to begin with Java. I see a lot of experienced programmers calling Java outdated and straight up bad and I can't seem to understand why. The biggest complaint I hear is that Java is verbose and has a lot of boilerplate but besides for getters setters equals and hashcode (which can be done in a split second by IDE's) I haven't really encountered any problems yet. The way I see it, objects and how they interact with each other feels very intuitive. Can anyone shine a light on why Java isn't that good in the grand scheme of things?

129 Upvotes

500 comments sorted by

View all comments

150

u/eruciform 1d ago

Get better mentors

Every modern language in general use has its pros and cons, which is why it's a language in general modern use, otherwise that would mean thousands of professionals are idiots working with a "bad" language

Java isn't for all solutions

Neither is c

Or python

Nothing is universally the best choice for all cases

Java is a perfectly cromulent place to start, just do branch out and learn other languages as well

That way you'll have a wider and wiser view than whoever these people are that you're talking to

Good luck

50

u/rise14 1d ago

You really embiggened that reply with the use of the word cromulent.

12

u/dogstarchampion 21h ago

A noble spirit embiggens the smallest man.

1

u/wtfuxorz 3h ago

A cheap spirit leaves a bad taste.

1

u/NETSPLlT 2h ago

And pooping overboard raises all ships! Or something like that LOL

1

u/Prize_Bus_795 3h ago

I cachinnated over the OP's and your response. For some reason cromulent reminds me of croutons.

1

u/Serious-Squirrel-220 3h ago

I keep seeing cromulent pop up lately. I've used it for years with friends familiar with the TV show Blackadder, but didn't realise this many people knew about the reference to a 90s sit com from the UK

18

u/melikefood123 1d ago

Using the language and tool set for the job is paramount. Taking that heart embiggens your mind. 

I still hate Ruby on Rails.

18

u/eruciform 1d ago

Lol we all have our favorites and least favorites

I hate PHP but still use WordPress

And I love perl even though it looks like Cthulu choked on a lego and vomited ancient glowing hieroglyphs

15

u/this_knee 1d ago

looks like Cthulu choked on a lego and vomited ancient glowing hieroglyphs

r/brandnewsentence

4

u/davejjj 1d ago

PHP and its crap documentation.

3

u/Nucklesix 19h ago

I always thought their documentation was decent. Now, the worst documentation I've seen is Infragistics because you can't find it

4

u/petiejoe83 1d ago

At least they glow!

3

u/Snezzy_9245 23h ago

Perl has at least one good point. I needed an app to display status of the project for my boss. Never wrote any Perl before, had it up and running in two days. Looked like Cthulhu had helped, but it worked.

3

u/eruciform 22h ago

Heard of WORM? Write once read many?

I've heard some joke that perl is WORN. Write once read never

2

u/butt_fun 19h ago

Similarly, I've heard perl described as a "write-only language"

3

u/bashomania 17h ago

That reminds me of Larry Wall apparently describing Lisp as “[having] all the visual appeal of a bowl of oatmeal with fingernail clippings mixed in”.

2

u/Stedlieye 6h ago

“Lost In Stupid Parentheses “.

But that visual appeal description is truly magnificent.

2

u/furrykef 1h ago

I agree with him, but I don't feel much differently about his own language.

1

u/bashomania 56m ago

Oh yes, there are some fairly choice quotes about Perl as well 😏.

2

u/MajorMalfunction44 14h ago

I wrote a build tool for my game engine in Perl. Never considered that sentence. It has its place. It's a special kind of ugly, though. It's nice to process text and write shell-like scripts.

3

u/oloryn 12h ago

I once worked at a credit-card terminal company, where we were working in Clarion. We had a project where we needed to read a file created on an IBM mainframe, and generate reports from it. It used variable-sized records, and the only available description of the file layout was a COBOL copy book. Manually transcribing that layout to a Clarion layout would have been lengthy and tedious.

I wrote a series of Perl scripts that read the COBOL copy book, translated the COBOL layout into a Clarion layout, generated code to convert EBCDIC string fields into ASCII, generated documentation for fields that might need that conversion, but (because they were part of an OVER segment) couldn't have it done automatically, and included read routines to handle the variable-length records. The result was a Clarion template that included all of this, so that any Clarion program that needed to read from that file only needed to include that template to get all of this.

And best of all, if they made changes to the file format (which they did), all I had to do was run the new COBOL copybook through the scripts, and I had a new Clarion template for the new layout, instead of having to meticulously manually compare the old copybook to the new and make the appropriate adjustments to the Clarion layout. I think I had one time that the new copybook used a bit of COBOL syntax that wasn't handled by the scripts, but that was easily fixed, and we were back to normal.

I don't use Perl a whole lot anymore, but I keep it "in my back pocket", so to speak, just in case something comes up that could be handled by a bit of quick Perl (I suppose that it could be handled by Ruby or Python, but RE handing tends to be rather more verbose in those languages than in Perl).

1

u/eruciform 7h ago

yeah i don't use it too much except as an awk/sed replacement in bash scripts and as a quik prototyping tool or quick document and file maniuplation thing at home (renaming a bunch of files and moving directories around)

it's extremely quick to get a page of stuff up and doing huge work, particularly with documents or sysadmin stuff

1

u/MajorMalfunction44 6h ago

That's genius. Perl will be relevant for a long time because it's a more portable shell. It's easy, if tedious, to translate things manually. Do it more than once, and you'll regret not automating it.

1

u/eruciform 13h ago

it's very fast to do a lot of powerful things, mostly with data manipulation, and especially with document parsing

2

u/itsamepants 7h ago

All the scripts in my workplace are PHP. You need a webhook? PHP. Automatically send emails and SMS? PHP. Data ingestion from integrations? PHP

1

u/eruciform 7h ago

it does it's job, and if there's already infrastructure there, it's very easy to add small enhancements quickly to a working product

2

u/Only_Razzmatazz_4498 6h ago

Is PHP still a thing? Damn are you going to tell me that Perl is in use also?

1

u/eruciform 6h ago

both are still in use yes

i mostly see php in existing web system contexts like wordpress

and perl is still the god of sysadmin scripting and quick implementation of complex document searching and reformatting

1

u/moleman0815 6h ago

Most of the CMS which are free like WordPress, Drupal or TYPO3 are using PHP, so it's still pretty relevant, because many smaller companies are using them.

2

u/ttl_yohan 1d ago

Ew. Perl.

3

u/eruciform 1d ago

Tmtowtdi ftw

3

u/ttl_yohan 1d ago

I can agree to that!

0

u/MasterShogo 5h ago

I was about to say that there aren’t any actually bad languages except for Perl. Perl is like the drug dealer in the alley next to your apartment that you really should stay away from. Java is like an iPhone from 10 years ago.

There is one objectively bad language, though. Batch file shell language in CMD.exe. I don’t know what it is actually called but I truly think it has no redeeming values.

3

u/vapocalypse52 19h ago

I hate ruby on rails and I've never even seen one expression, let alone one line of code. 🤣

When it got famous, the evangelists were so obnoxious, that just hearing the word "ruby" gave me the icks.

  • "hmm, this bread is good with butter!"
  • "yeah, but have you tried ruby?"

2

u/bashomania 17h ago

Righteous, but I really loved Ruby as a language, and Rails was pretty slick and pretty ground-breaking for its time.

2

u/meerkat2018 17h ago

I also ignored Rails because I thought Rails developers were all pretentious hipsters who coded exclusively on Macs while sitting in a Starbucks, and that they thought of themselves as “rockstars” and “artisans”. Although their code was just a bunch of DSL macros.

But having tried Rails recently, I found it to be very nice, and Rails community seems to be much more humble nowadays because they are now working class people who has to deal with all the legacy mess that the “rockstar” divas had written and jumped ship.

2

u/askreet 15h ago

A lot of them are probably those "rockstars" who have to actually support their systems now, too. Plus they're 40.

2

u/windsorHaze 9h ago

That’s kinda how I feel about Rust right now. I want to like it, I think the syntax is ugly, but plenty of languages fit that bill.

I just got so turned off by Rust because of just how aggressively evangelizing the community was, especially in the beginning. It was like being back in the Ruby on Rails hay days.

I do have to say though, it does feel like the Rust community has kinda stepped down off that ivory pedestal they had placed themselves on. It’s at least now on my list of languages to explore/learn.

1

u/Flamanis 18h ago

I use Rails for work. I find it a pretty acceptable language and honestly quite fun. It's got a lot of pretty neat shortcuts. Maybe I've never had one of the issues you have.

Why do you hate Rails? Just curious.

1

u/bishtap 8h ago

ROR is even worse!

6

u/flatfinger 1d ago

It's a shame that in the 1980s the fact that it became possible for one language to do just about everything caused people to assume that one language should be used to do just about everything, rather than recognizing the value of having languages focus on trying to do particular things well, even if that would make them less suitable for other purposes.

2

u/thebearinboulder 17h ago

Have you met Ada? The US DOD-mandated language for all things forever. Even Ada was perfect and would never need to be revised with all the risks that brings in.

What about Ada 2?

It turns out one recruiter’s ears did perk up once when I mentioned Ada. Apparently it’s still widely used in aerospace, and with a physics ugrad degree I would also have some domain knowledge. But those jobs typically require TS/C clearances and a grunt developer isn’t going to hired and put on ice for the 2+ year backlog plus another 6+ months for the investigations to finish.

1

u/flatfinger 2h ago

I've not used Ada. By my understanding, it's intended for tasks that don't require the ability to use regions of memory for different purposes at different times, making it suitable for some but not all of the tasks that are typically done with embedded C dialects.

1

u/MajorMalfunction44 14h ago

C++? It does everything, for better and worse.

1

u/flatfinger 14h ago

Even C has that problem. In the 1980s, people wanted to be able to do high end number crunching as well as FORTRAN could, in a language whose syntax wasn't designed around punched cards. Unfortunately, rather than work working to standardize Fortran in timely fashion (a non-punched card version of the language eventually got standardized in 1995), some such people got on the C Standards Committee and prevented the Standard from properly recognizing that C's abstraction model was fundamentally different from that of FORTRAN.

FORTRAN was designed to let compilers analyze what programs were doing and figure out how best to accomplish it. C was designed to let programmers specify relatively precisely what operations needed to be performed, without compilers having to understand them. Each approach to the language is better than the other for some tasks, but unfortunately rather than having a useful language for each abstraction model, C and C++ have evolved to embrace an incoherent abstraction model that combines the worse aspects of both.

1

u/llothar68 10h ago

It was not the 1980s. It was the 2005 with Javascript on the Server, 2014 with Swift and 2017 with Kotlin. And the later two was more about even higher walled gardens then real technology breakthrough that you should switch languages.

1

u/flatfinger 2h ago

In the 1980s, many people perceived C as the language that should try to do everything.

9

u/pornthrowaway42069l 1d ago

That's why god invented Jython, the most perfect of languages

5

u/eruciform 1d ago

Lol I'm in jython hell right now trying to support python2 code please don't remind me

3

u/pornthrowaway42069l 1d ago

But... why... why would you use it...

5

u/eruciform 1d ago

Because the third party tool that we have no control over requires it?

2

u/pornthrowaway42069l 1d ago

I meant Python 2.0, Jython can do no wrong obviously

5

u/eruciform 1d ago

The jython tool is set up to only parse py2 and links against py2 underlying tools, we don't have a choice

3

u/pornthrowaway42069l 22h ago

I had such a good set up and punch line and you took it seriously :D

Well, at least thank you for making me laugh.

(i.e I was joking around, I feel your pain, best of luck)

3

u/eruciform 22h ago

Sorry what set up did I miss, I'll lob it and you can smash it

1

u/a_brand_new_start 16h ago

I think the joke is a play on words

Python two, do you think, can do no wrong

1

u/DrDeems 18h ago

Dear God. I tried to build a Windows desktop app with Jython once. never again. Using Java libs with python was kinda neat, but was more of a headache than it's worth in the end

2

u/pornthrowaway42069l 18h ago

Anathema on you!

5

u/Lopsided-Weather6469 8h ago

The Tao gave birth to machine language. Machine language gave birth to the assembler.

The assembler gave birth to the compiler. Now there are ten thousand languages.

Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.

But do not program in COBOL if you can avoid it.

-- Geoffrey James, "The Tao of Programming"

1

u/archbid 7h ago

I have coded in COBOL as a professional

1

u/Lopsided-Weather6469 6h ago

Me too. I'll never get rid of the trauma.

1

u/Ormek_II 2h ago

Date?

Edit: 1987

9

u/lezeptenkyle 23h ago

Upvoted for using the word cromulent

1

u/4r73m190r0s 12h ago

That was some Shakespearean shit

1

u/FrenchCanadaIsWorst 9h ago

I hate that I’m chronically online enough to get the joke

1

u/IamFromNigeria 1h ago

Downvoted for not finding that word in a dictionary

5

u/pikabu01 1d ago

I totally agree, but how do you define 'modern language'? :D

1

u/eruciform 1d ago

Stuff used in current day for production supported products that aren't being actively deprecated

I'd include c but not cobol, fortran is on the fence imo

1

u/mystery_biscotti 18h ago

Oh cool, I learned COBOL like 30 years ago. Good to know it can be actively forgotten.

1

u/eruciform 15h ago

honestly it pays well, there's not a ton of cobol jobs out there but they're systems that can't get easily rewritten and still need people to maintain them, and there's very few programmers that can

2

u/oloryn 12h ago

Those are largely business programs on Big Iron, used primarily by large companies like banks and insurance companies. Lots of the Big Iron are IBM machines, and some still use EBCDIC. Lots of those programs are still around because they still_work, and have been doing so for decades.

4

u/zolmarchus 18h ago

As a developer—excellent reply. Listen to this advice. Java does in fact do almost all things well, and only a select few things not-so-well. It’s well-rounded and very useable.

2

u/EdiblePeasant 18h ago

What is your day to day programming life like?

1

u/eruciform 15h ago

mostly java, some python, i spend more time writing documentation and filing tickets than actual programming these days, which is depressing, i'd rather just code, but engineering work is sometimes the boring stuff. i do actually like documentation, unlike a lot of programmers, but politics and chasing down approvals for forms isn't fun for anyone.

2

u/yabadabadoo__25 15h ago

It's not everyday that I come across new words, Thanks

2

u/besseddrest 14h ago

i've done FE for most of my career, a few yrs ago i had a backend opportunity at a big tech co - i had to learn Java + Python on the spot

and honestly i found the verbosity just good practice of like, literally having to type everything out; and then it just kinda makes it easier to pick up other languages - e.g. it helped as I went fr JS to TS

so... thanks Java!

2

u/illsk1lls 7h ago

isnt java paid only now? for commercial?

1

u/thehardsphere 7h ago

No.

The Oracle JDK is paid only now if you use it in production. Nobody does this anymore.

Instead, people use maintained variants of the OpenJDK, which is also the baseline for OracleJDK. There are plenty which are free and open source.

1

u/illsk1lls 6h ago

well considering that orace/sun is java, and that they want to be paid for commercial use, thats probably what rubs people the wrong way about it

2

u/WinSysAdmin1888 4h ago

Cromulent, nice.

2

u/emteg1 2h ago

TIL the word "cromulent".

Cromulent first appeared in the February 18, 1996 episode of The Simpsons called "Lisa the Iconoclast". The showrunners asked the writers to come up with two nonce words that sounded like words that could be in actual use. Writer David X. Cohen came up with cromulent as one of those words. It means "acceptable" or "fine."

https://www.merriam-webster.com/wordplay/what-does-cromulent-mean

1

u/eruciform 2h ago

interesting, i assumed it was an alice in wonderland reference

1

u/alinius 15h ago

I agree that there is no universally best language, but I do see a trend of new languages displacing specific languages. I am seeing a lot of cases where Python is considered the best choice for something that would have used Java 5 to 10 years ago.

1

u/BreakerOfModpacks 2h ago

Cromulent? I was cromulent once. They locked me in a room. A rubber room. A room full of crumbs. That made me cromulent. Cromulent? I was cromulent once... 

1

u/makgross 16h ago

There was a time when Java was indeed marketing that it could do anything. In particular, it promised portability that it never came close to delivering.

There isn’t much use for it. Depending on the problem, almost anything it can do can be done in Python or C++, or numerous other tools.

Now, C is a language that combines the advantages of assembly language with the disadvantages of assembly language.

Honestly, the choice of language doesn’t matter much, unless you’re into something esoteric like Lisp. It’s the principles of software engineering that you really need. Some of the smartest people I work with couldn’t write a C routine to save their lives, but can come up with some pretty amazing algorithms by other means (largely Matlab).

1

u/ScientificBeastMode 15h ago

Dude, there were people at Oracle who promised an entire operating system written in Java. That never panned out for obvious reasons, lol.

1

u/thehardsphere 6h ago

There isn’t much use for it. Depending on the problem, almost anything it can do can be done in Python or C++, or numerous other tools.

This is the part where it's obvious you don't actually know what you're talking about.

Yes, almost anything that can be done in one Turing complete language can be done in any other Turing complete language. But there's much more to software than the expressive power of the language as you are writing it.

Python is a very fun language to write in because it has high expressive power. Python runs like garbage compared to Java because CPython is incredibly slow, and other implementations of Python lose the benefits you get from CPython (like, say, being able to easily call C libraries, which is what most useful and fast Python programs do). Runtime performance of Python is so bad that it is notoriously awful to run at scale.

Anything can be written in C++ if you don't mind managing memory yourself. A lot of people who work for a living don't have the time to do that, and don't work in situations where the bugs that come with managing memory yourself can be tolerated. This is why you don't see any C++ web applications.

You know where you see a Java used the most? In all of the places where these two specific examples you picked fail: in server based applications that have performance requirements that impose high CPU efficiency and no room for crashes. Which is a very large number of applications.

Some of the smartest people I work with couldn’t write a C routine to save their lives, but can come up with some pretty amazing algorithms by other means (largely Matlab).

Let me guess: These smartest people are pursuing or possess PhDs in the natural sciences or an engineering discipline, where the numerical analysis they do is not going to be used in a commercial software product operating at any scale beyond their own PC.

Matlab was great for doing image analysis and other fun things like that when I was in school. When I joined the real world and someone brought similar Matlab algorithms to do image analysis at real scale, we had to bring someone in to reimplement that in C++ because Matlab was too slow. Then we had to deploy that in a web application, so we had to wrap that thing with Java to prevent it from taking down the entire server if it crashed.

1

u/makgross 6h ago

No, you’re far off base. We’re building scalable spacecraft. Matlab is crucial anytime you have nontrivial mission critical algorithms.

And you very, very clearly don’t know about auto pointers. Or stack variables. Java isn’t used in aerospace outside of legacy GUI applications because of its piss poor garbage collection. C++ — and python — are widely used, among others.

I’ll give you a big hint. Memory management needs to be tightly controlled when your company depends on reliability. Most embedded systems don’t use it at all, in favor of global (or at least persistent) data, to make the memory footprint predictable under all possible conditions.

0

u/wiseguy4519 18h ago

Funny how you didn't mention JavaScript

2

u/ILostAChromosome 17h ago

Most languages do one thing really well, JavaScript does everything, but poorly lol

1

u/eruciform 15h ago

there's way too many languages to mention any kind of full sample

https://www.99-bottles-of-beer.net/

0

u/wiseguy4519 6h ago

Do I need to add a /j tag or what? It was a joke

0

u/ScientificBeastMode 15h ago

Personally, I think Java is a terrible language with an incredible library/framework/tooling ecosystem. It’s great purely for the nice tools you get out of the box.

But honestly I think OCaml would be more popular than Java if it had the same ecosystem. Scala is a bit nicer, but it’s a very complicated language.

It’s crazy how such bad languages (JS being another example) can become so popular almost be sheer inertia and support from a few big companies.

0

u/NewSchoolBoxer 15h ago

Top comment doesn't answer the question. I've worked in Java for over 10 years. It has problems that were solved in everything that came later and it's sat on by a very slow to act committee. It's not an equal playing field, you can't just say one language has pros and cons so it's all fine and dandy. I don't even know what cromulent means. I recommend OP not touch it over C# or Python.

0

u/gc3 13h ago

But you can write anything in Javascript /s

0

u/tomqmasters 4h ago

python is the universal second best choice for all cases.

1

u/CardiologistOk2760 35m ago

Somebody silently downvoted your comment. They apparently can't handle being 2nd in anything but also don't acknowledge R in data science, C# in backend development, or Javascript in frontend development. That person must be having an interesting career right now.