9 ms·
One of the things I see with Java today, how difficult things have gotten with the language. Its next impossible to deal with any large Java project without an
by kamaal 13y ago
One of the things I see with Java today, how difficult things have gotten with the language. Its next impossible to deal with any large Java project without an IDE. The verbosity of the code is mind boggling. Often method calls are 4 - 6 layers deep, which in itself makes is very difficult to remember or even implement even if you read the documentation well.
The resulting code is massive walls of text. 90% of that is machine generated through eclipse. This is an indication that the language idioms are unable to support the current complexities in application programming trends. And you have to interplay with them heavily to squeeze out usable programming logic.
That doesn't end there. Perl is older than Java, yet despite that I see Perl can support a lot of idioms far far better than Java can with its bulky frameworks.
Its just that the language is beginning to show its age.
The only reason to use Java these days is basically availability of super low cost devs, Legacy code, tooling etc. Basically for reasons as with any tool that has an advantage with age.
- vivin 13y ago> Often method calls are 4 - 6 layers deep, which in itself makes is very difficult to remember or even implement even if you read the documentation well. I think that's a symptom of bad design than a problem with the language. The language doesn't force you to create abstractions on top of abstractions and it is not necessary. Having method calls like that is a bad code-smell. Java does have a verbosity problem and some of it being addressed in Java 8 with lambdas. > The resulting code is massive walls of text. 90% of that is machine generated through eclipse. This is an indication that the language idioms are unable to support the current complexities in application programming trends. And you have to interplay with them heavily to squeeze out usable programming logic. I have never had to autogenerate code. I use IntelliJ and it doesn't generate walls of text. It does autogenerate some stuff if you want it to, but those are usually just stubs. > That doesn't end there. Perl is older than Java, yet despite that I see Perl can support a lot of idioms far far better than Java can with its bulky frameworks. Well, Perl is strongly typed and has a rich (and ambiguous) grammar. I don't think it's a fair comparison with Java. Furthermore, Perl has a bunch of other issues. I love Perl, but I wouldn't really think about writing a huge application in Perl; it's usually a maintenance nightmare if you don't have a shop of disciplined Perl-coders. > The only reason to use Java these days is basically availability of super low cost devs, Legacy code, tooling etc. Basically for reasons as with any tool that has an advantage with age. Not really. You can build lots of full-featured webapps with Java and there are a lot of new applications that use Java. What I think is happening more and more though, is that the JVM is turning into a platform and there are numerous languages that run on it. What Java has going for it is its rich ecosystem via core APIs and numerous third-party libraries. You have access to all of this if your language runs on the JVM. For example, Nashorn (the replacement for Rhino) has access to the standard API, as do languages like Jython and JRuby which also run on the JVM.
- eropple 13y ago> The language doesn't force you to create abstractions on top of abstractions and it is not necessary. The culture of it does. When all of the code around you is objects-as-design-pattern bad-abstraction slop, you're going to think that's the right way to do it. Which for a certain value of "right" it may be, but it still sucks. You can write "good" Java, but it's still going to be more expansive and harder to read than good C# (which aggressively trims back Java design pattern crap) or good Scala (which goes way, way further). > that the JVM is turning into a platform Agreed, and this will save it, but Java's not helping itself at all.
- vivin 13y ago> The culture of it does. When all of the code around you is objects-as-design-pattern bad-abstraction slop, you're going to think that's the right way to do it. Which for a certain value of "right" it may be, but it still sucks. You can write "good" Java, but it's still going to be more expansive and harder to read than good C# (which aggressively trims back Java design pattern crap) or good Scala (which goes way, way further). There is no "Culture of Java" that forces you to write over-abstracted code, and it's not really that much harder to write good code in Java. Java is a tool. Sure, it has flaws, but they're not so bad that they force you to write really bad code. With Java I've never felt forced to overarchitect anything just to get it to work. Of course, I have often felt constrained by the lack of expressiveness in the language, but a lot of that will be fixed in Java 8.
- RivieraKid 13y ago> Its next impossible to deal with any large Java project without an IDE True, but I don't see it as a problem (for me). > The verbosity of the code is mind boggling. I don't find Java that verbose (especially with lambda functions in Java 8). > method calls are 4 - 6 layers deep I don't understand, do you mean nested method calls? > 90% of that is machine generated through eclipse. Definitely not 90% and lot of the generated code would have to be written manually in languages like Python. > The only reason to use Java these days is ... Libraries, tools, speed, multiplatformity. Also, Java is a pretty good language by itself. It lacks in many ways, but for a LOT of projects, it's a great choice. What language would you suggest as a Java alternative? > super low cost devs Java devs are among the most expensive.
- kamaal 13y agoI like working with Java too. I'm only pointing out the problems, which I see are pretty clear. The only problem is from the perspective of using and developing a new skill, I would rather use a newer language which is better built for problems of our time than something 20 years back. Java has had its day in the sun. Its primary purpose was to become an easy C++ for people who didn't get memory management and people who didn't want to get into tiny pedantic issues while trying to run their code on two different Unix'es. But these are by and large solved problems now. Over years a lot of legacy code has gathered around Java. But if you want better employability especially if you want to work on new projects, new paradigms and new domains of problems you should likely chose newer set of languages. Not Java. One hard lesson that I've learned over the years is to never have any hard religious feelings towards old aging tools. We must learn to move on, find new shores build new stuff there. The only projects you get with these older tools are legacy ones, and people are generally waiting just to phase them out.
- RivieraKid 13y agoOk, what language would you suggest as an alternative? I've written code in lots of different languages and I haven't found a replacement yet (C# is closest, but I mostly do Android development, on Linux).
- marcioaguiar 13y agoIt's impossible to deal with ANY LARGE PROJECT without an IDE. If you don't use an IDE, your project is not large yet.
- eropple 13y agoThis is an incredible generalization. I've very comfortably navigated codebases in the thousands of files of Python with only find and ack to guide me. I've done a lot of C# in Vim, too. But I can't do the same in Java; at my last job we had thousands of .java files and I was stuck fumbling around with an IDE to do anything. The verbosity and repeated ceremony of the language makes it difficult to search for anything in an effective manner and the distractingly clumsy syntax (inner classes, as an example) made trying to Vim it failure-prone enough that I'd use an IDE just for the red squiggles. Those being in and of themselves concerning at times--I'd often find myself just trying to make the red squiggles shut up rather than concentrating on writing better code. I don't find myself doing that in Scala or C# or even C++.
- dragonwriter 13y agoI would say that if you need an IDE because of the size of your project, the components are too tightly coupled. (Admittedly, I like what IDEs can do in static languages to catch errors early and improve productivity, but that's independent of project scale.)
- apw 13y agoWould you call the Linux kernel a large project?
- pekk 13y agoIt is not enterprise enough. If it used Java EE then it would really scale, like a stadium sound system.
- rsynnott 13y ago> Often method calls are 4 - 6 layers deep This is hardly the fault of the language, more of the community, which tends to fetishise certain patterns a bit.