4 ms·
Java sucks (1997)
- gchpaco 18y agoSomewhere between a third and half of these complaints have been addressed as of Java 6, sometimes at not inconsiderable cost (generics, for example). But most of the fundamental complaints--handling unboxed data, the need to constantly wrap data, the brittle standard libraries, the sheer irritation of using anonymous inner classes for closures--are all things I trip up against every damned day.
- pohl 18y agoWhat's with the retro jwz fetish as of late?
- deleted 18y ago[deleted]
- albertcardona 18y agoCatched my eye that both slots-as-methods and defining new slots or methods on the fly are addressed in python rather well.
- dusklight 18y agothis is like the fifth time this old old post has been submitted to the news page. similarly, I think every single PG essay has been posted multiple times. maybe it would be nice to have some sort of warning that the "news" item you want to submit has already been submitted?
- Hexstream 18y agoActually, there is. If you try to submit an URL that has already been posted, then you upvote the original submission. But it seems there's some sort of expiry after which reposting the URL creates a new submission. Also, sometimes there's problems when 2 different URLs point to the same article.
- drp 18y agoThe forced unicode String complaint is quite valid. Implementing any sort of large in-memory index in Java basically requires a parallel implementation of String (not actually 'implements String') to keep its memory usage down to a reasonable level. Unless of course you're actually indexing Unicode strings.
- gtufano 18y agoI've been countless hit by programs crashing because I'm using an accented character. It is really easy to think "I'm not using unicode strings there"... until an user uses unicode characters. Enforcing unicode is a good thing, whatever english speakers could think about.
- axod 18y agoIMHO this is something Java got totally right. With many other languages Unicode is some afterthought. Ever tried Unicode things in php? It's horrible. Having all strings as Unicode is fantastic. If you're dealing with something else and can't afford the memory, then sure - roll your own with byte[] arrays. Not a big deal.
- ars 18y agoI use unicode in php routinely. It works fine. If you need sub-string manipulations add mb_ to stuff (and if you are manipulating an entire string you need do nothing special). And if adding mb_ is too much trouble use mbstring.func_overload. UTF-8 only of course. All the other encodings should never be used anywhere. With UTF-8 the majority of the time you can use regular functions - for example trim() works just fine on a UTF-8 string.
- neilc 18y agoI'm curious why Java doesn't use UTF-8 encoding by default; that would offer much of the memory savings the parent poster is talking about, if the data is mostly ASCII anyway.
- axod 18y ago
- mtarnovan 18y agoBesides being vastly outdated, this article suggests that Java is on par with Perl when it comes to performance. In fact, Java is almost as fast as C++ on most computational tasks, and faster than most other languages (http://shootout.alioth.debian.org/ http://shootout.alioth.debian.org/)
- mnemonicsloth 18y agoVastly outdated? Really? It's been quite a while since I've used Java so I'm curious to find out: Does Java have lexically scoped functions now? Macros? Inlined functions? Does Java have closures now? :keywords? CLOS-style multi-dispatch? It's not like there weren't languages out there, that certain co-authors of the Java spec did their PhD and postdoctoral work on, that implemented all of these features...
- mahmud 18y agoHey now, nothing Clojure can't fix.
- elai 18y agoBut why do java applications tend to be these huge, clunky, slow and memory hungry applications over and over and over again? Eclipse, any J2ME application/server and so on. Working on java applications has always been pain.
- deleted 18y ago[deleted]
- axod 18y agoYeah that Virtual Machine is actually quite a big part of Java.
- cia_plant 18y agoI don't think you're right that the people behind Java didn't understand languages. There are actually a lot of things which Java gets right. For instance, Java's namespacing is very good. Unfortunately, being smart and knowledgeable isn't enough to build a good language. A language has to "fit together" in a way that just can't be forced. This is why Java, whose design is pretty intelligent, is absolutely miserable to work in; while Perl, whose design is random and crufty by comparison, can be easy to work in and highly productive.
- hernan7 18y agoInteresting point (agreed on the pain of programming in Java vs Perl). What do you mean exactly by "fit together"?
- waldrews 18y agoFeel free to dislike the language, but calling someone like Guy Steele a marketing droid is just unfair.
- javanix 18y agoIt may be old, but he raises some good points. Java's syntax is probably a step forward from C++, but both are still far from intuitive. In an ideal world, I'd love to see a pared down version of Java's syntax matched with a better-optimized version of GCJ - the readability of Java combined with the speed of native bytecode would be a godsend.
- makecheck 18y agoWhile he makes the point that Java was 4 separate things that should've been developed and released separately, that probably would have seriously hindered adoption and even caused the language to die. [In hindsight, maybe that would have been best. >:)] When I first started with Java years ago, one of the things that made it appealing to learn a new language was the fact that it came with a box of toys (such as easily-constructed graphics contexts, UI elements, and threads). In the days of Java 1.0, it was probably the quickest way to get fairly sophisticated things up and running, so that power made it all worth learning. Had it just been some research language with no libraries or JVM, I probably would've said "great, but...what can I do with it, nothing!". In my case, this still came full circle; I eventually decided I really hated Java for any serious programming. I never choose to use Java for anything these days, I only put up with it if I'm maintaining something that is already Java-based.
- cvboss 18y ago"I'm back to hacking in C, since it's the still only way to ship portable programs." Scrolled to the bottom, found that line and thought the article doesn't worth my time :)