Why is Java Considered Un-Cool?
jg21 writes "After the Slashdot discussion on Paul Graham's 'Great
Hackers' essay, it had to happen. Java developers have taken umbrage at
Graham's assertion that "Of all the great programmers I can think of, I know of
only one who would voluntarily program in Java. And of all the great programmers
I can think of who don't work for Sun, on Java, I know of zero." Now in JDJ Sachin Hejip pinpoints the Top
Reasons Why Java is Considered Un-Cool and to tries to debunk them. He levels some of the blame at the Java compiler for "too much
chaperoning" and speculates that Java fails the geek test precisely because
"it's such a language-for-the-masses." But isn't he missing the point? Enterprise-grade apps and "coolness" may be inapproriate bedfellows. Besides, does any language offer both?"
people just concentrate on the best tool for the job instead of worrying about things like, "coolness".
These, "my programming language is better than the rest and here is a list why" arguments are BS. Every situation is different, every problem requires different tools/methodologies to solve. You wouldn't go into the carpentry business and claim your hammer is the best hammer for every single job would you? You would be laughed at and possibly hit in the head with said hammer. Same goes with programming languages.
Monstar L
This was a lame article, IMHO.
It had the sarcastic "Oh, it's too easy for you?" theme going. No, that's not
why I dislike Java.
Here's why:
o Java GUI is slower than native alternatives
o Java is not supported by all platforms, and is not supported by
WinXP by default.
o All the Java "binaries" I've tried relies on me having installed a
local interpreter.
o It's object oriented (*)
*) Hey, I said this is MY list. I dislike object oriented languages, m'kay?
Oh, and take a look at this page for some more GOOD arguments why Java sucks.
This is news?
Java is the new COBOL. No, I mean that quite seriously. COBOL means "COmmon Business Oriented Language". Java is the language of choice for modern day corporate application development. In the corporate world - which probably accounts for more actual lines of code than anything else - applications fall into two categories, forms (inputting data into databases) and reports (getting data out of databases). The corporate world wants legions of cheap, interchangeable programmers to work on these applications. Kids are taught Java at college or learn it themselves. The language makes it very easy for one person to work on another person's code, and it makes it quite painless to document your work as you go. That's the reason "hackers" don't like Java - they've just transferred their traditional dislike of COBOL to it.
Some of the things in java are terribly verbose. especially when going to design GUIs.
Using the language you just "feel" as if there should be an easier way.
I'm no fan of microsofts products but I think C# is an excellent language to program in. It addresses alot of Java's shortcomings and it is a joy to program in.
Python is an enterprise-grade programming language because its code is so readable. Sure, you can write a perl program faster, but six months later you won't be able to read it.
-russ
Don't piss off The Angry Economist
Please, do we have to hear this comment every time Java comes up? It was cool to say that in the 1990's, but it's a little out of fashion now.
"No matter where you go, there you are." -- Buckaroo Banzai
From my employer's point of view, it makes me more productive than (most) other languages would, since I spend less time worrying about crap like header files, pointers, memory leaks, and so on.
So everyone wins. "Cool" stopped being important when I turned 18.
..on the laptop I use for work (a Pentium-2 ...) it's just like that. Don't understand me wrong: I have programmed in JAVA, I liked it.
But as corporations nowadays still have little budget left for buying their employees decent PC's, JAVA still has this practical limitation.
Slashdot: stuff for news, nerds that matter, matter for news, stuff that nerd
There are Java pundits, and LAMP lovers. Not to mention .Net-sters.
.Net (MONO). For low-level use C++/C/Asm.
The real issue is use what works, regardless of 'cool' (hell, COBOL was probably cool once and is still used in some places).
As the story points out, Java is not used for low-level (device) programming. And Assembler is rarely used for data movement (ETL).
I say, for QuADs (Quick And Dirties), use a slower coding language that allows for quick development. For Enterprise-level Web/XML apps use something like Java or
Or try Bison...
i've read several of his articles, and none of them strike me as particlarly insightful. most are more of the "hey, i have this quirky idea, which i think is cool but is actually rather mediocre, and i have a lot of leisure time on my hands, so i'm going to flatter myself by dwelling on my quirky, mediocre idea in public" variety.
pr0n - keeping monitor glass spotless since 1981.
Most developers I know basically slam it for it's reputation for being slow, and frankly, because it's not C, the geek Gold Standard. Perl has the same difficulty and has it's own cultish crowd (Perl users are the Greatful Dead fans of computer science). Python is somewhat trendy as well.
But Java....Java was designed to be easily learned, and to especially be used in web-based apps. To Unix geeks, that makes it kind of the Visual Basic for the Slashdot crowd. Not something to brag on.
Fact is, it's a great language, and it's still growing. A friend of mine is a professional Java developer (mostly server side stuff), and he's one of the brighter bulbs in the lamp. He loves it, and still thinks Java's potential is largely untapped. Whereas we know what C can and can't do, Java is still growing. He thinks it'll be used (and used effectively) for things we can't even imagine yet.
Life is hard, and the world is cruel
I cant speak but for myself, but we use some Java applications at my work. Some work just fine while others literally grinds the computer to total halt. IANAP (I am not a programmer) but somehow I get the feeling that some Java applications are just badly programmed. Why else the variation in performance?
It's just not that hard to understand this. For good or ill, programming has always been an ego-driven profession. You hear stories of punch cards and marathon hacking sessions, and how cool it was that some guy arranged all of his code so that memory accesses were precisely in alignment with the rotation of the memory drum. You do not hear about how cool the fact that someone's applet can't crash because of automated bounds checking and lack of explicit pointers.
Java is seen as uncool precisely because it protects you from your own mistakes -- it's an attempt to make programming approachable to the masses, and the fact that it's forgiving makes it look like programming with training wheels. And just like the 50 year old MBA will never fit in with the Harley crowd, Java programming will never be seen as cool as "real" hackers' languages like C.
I think the guy needs to learn something about modern programming languages before sitting down to write...
Classloading is slow as all get-out, and even moreso when you're suffering through the startup of a Swing application, since Sun saw fit to make every Swing class reference every other Swing class.
Java is used a lot these days. There are three main reasons, in my view, why it became so popular:
So if you look at it purely as a language, it's just not that cool. You don't see amazing Java hacks. It's not great, it's just not bad. Add to that a few really irritating things (that are being addressed) like constant casting and having to check every exception all the time... Why would it be considered "cool"?
I believe posters are recognized by their sig. So I made one.
What would you recommend as an alternative? I've found it hard to stray from Java to other programming languages, even though I'd like to learn a few more, simply because building a GUI with anything else means learning not just the language but an unrelated toolkit or something. I can't find anything else to program in that isn't harder to learn to create GUIs with!
(It needs to be a viable linux option for me though... having just wondered if you're talking about something like VB).
In my career I've written more C then anything else. Followed by PERL for test automation. Recently I'm working a new program that is 100% Java. It has been a pleasure. I do not see any huge performance problems that people seem to complain about. I'm not just writing a database/forms program either but doing REAL work in image processing.
I have no idea what you mean about byte code making it harder. You compile things into a JAR, in most OS's you can double click the JAR and run it. How is that difficult?
Tons of production software is written in Java. Especially server side.
C/C++ are out there but the reality is that they are too hard to use for very large project. It can and will be done successfully but it costs a fortune. I can do so much more using Java with so much less budget that its amazing.
As far as being multiplatform. It comes close. I've never had any huge problems outside of cosmetic differences that might need to be tweaked, but that it easy. I was even doing 3d graphics on the mac and demoing them blindly on a windows PC without testing on Windows (I refuse to own one of those) and had no problems.
.plan!! what plan?
If an application in a language constantly crashes, its 99.999% of the time not the languages problem. This actually brings to light one of the benefits of using java, you know exactly the kind of errors you can get if you read the API. Based on these errors you know you could get, you should make the program recognize and handle the exception.
I had to use Java back in school and I won't touch it unless my superiors threaten the branding iron (again). Java loads too much overhead and it doesn't have the same responsiveness as C based apps, IMHO. I don't think Java is optimized enough, and it shows. All the cross-platform support comes at a price and that price is speed.
... for security. Java has all sorts of neat features built in like automatic bounds checking on arrays that simply don't exist in languages like C. This means that it may run slower, but in a computing environment where processor speed doubles every 18 months, would you rather have a little bit slow execution for now or a fundamentally flawed security paradigm? Programming in C leaves you wide open to buffer overflows and other attacks, and it takes a security-oriented programmer to overcome those problems. And guess what, once you get all of the code in there necessary to make it secure, it runs at about the same speed as Java. Java just puts all of the security stuff in by default, which I don't think is a bad decision in this age of computer worms and viruses.
Java is optimized
Cyde Weys Musings - Scrutinizing the inscrutable
I can't speak for anyone else, but the thing I don't like about Java is that the string handling sucks ass. There are how many different types of strings that you have to convert back and forth between in order to do something simple like accepting text from a network socket, altering it, and presenting it on the screen? At least three major type conversions that come to mind as the minimum-path.
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion.
...Java's strong typing isn't a problem because it's strong typing. C++ does strong typing rather nicely. Haskell does it even better. Java's libraries, because they don't have anything like templates (at least until Java 5), require huge amounts of casting and instanceof checks to pull anything out of a container. That's when static typing gets in the way instead of being helpful.
I'm quite a fan of static typing, really (honestly), but not the way it works in Java. Of course, I hate lots of other things about Java too, but it's not because it's 'un-cool', it's because it's crap. Even if nobody used it, it still wouldn't be cool (I'd have a party though).
And although it pains me to say it of a Microsoft product, I hope C# takes over from Java, because although it's not perfect (no language is, or can be), it's for the most part what you might call 'Java done right'.
Miri it is whil Linux ilast...
Maybe it's because a whole lot of us are too busy working on multi-million dollar financial projects to stop and tell you how cool it is? Java is all about the server side, so if we're not coding desktop apps, its because there's more appropriate software out there for that. That doesn't make Java uncool - there's a lot to be said about enterprise Java. Whether it's cool or not, it works.
By the way, I frequently use a very cool Java desktop app - It's an Amp/Effect editor from Line 6 that controls their Guitar and Bass Amps - It's all Java, looks and runs fantastic. Check it out if you have a Podxt.
That's right, he used LISP.
First impressions for java weren't all that good. Back in the early days it wasn't just slow, it was painful. We'd ask "why does VB have a user interface that's so much quicker?" I still don't know. We also asked why every interface looked different. Java never did successful wrap the APIs provided by the OS and there's no reason not to.
By the time of the second impressions, Sun and Java zealots started to become annoying, promising silly things like it was faster than native code. Maybe in some cases it is, but certainly not where it counts: the GUI.
Oz
One reason Java is un-cool is that it is just another proprietary technology, owned by Sun. If Sun goes away, as it very well may, the Java code-base is at risk. And that would be very un-cool. Linux and Open Source development are cool. Geeks tend to like consensus-based technology that doesn't have a heavy intellectual property burden. Ultimately, Java is un-cool for the same reason that Windows is un-cool.
Marshall's Generalized Iceberg Theorem: Seven-eighths of everything is hidden.
...and then I'll tell you it can join the club of "cool" languages.
The problem with Java is that Sun really has managed it properly. We all thought it was cool when it came out, but the promises really weren't true. Write Once Run Anywhere mostly managed to work on different platforms, but the GUI is so god awful slow nobody really wants to bother. Its just easier to code native. I'm not exagerating here that even Visual Basic programmers could have come up with something better.
.Net products. Hate MS all you want but .Net actually is really easy to use.
Sun has let the technology stagnate while Microsoft has caught up (and IMHO surpassed) Java with their
Plus I don't know what's going on at Sun marketing, but they've descended Java into acronym hell. Plus the naming conventions don't really make sense now. The new version of Java is J2SE5 (I'm not even sure that it is this now).
I'm taking this from the perspective of desktop developers (rather than the server side as they seem to use Java fine). Java really does blow, and there are now better technologies to use. Sun has even ignored integrating other, better technologies (*cough* SWT) due to NIH syndrome.
If Sun went and fixed their mistakes rapidly (a bit late IMHO) then Java could still be cool. But everyone on the desktop who's used it considers it a steaming POS.
No matter how many ultra-cool hackers I know tell me that Lisp and Scheme and ML are cool, I never have fun using them. They force my brain into such an unpleasant state of nerdliness that the only thing I can program in them is a mathematical proof or some sort of logical system.
Er, that is every single computer program you have ever written. First let me disclaim that I make my living writing in C (a little C++ and some interpreted languages). But I firmly believe that until we approach every program as the "proof of a logical system" we will be burdened by the inexorable piles of poo that is the vast majority of the software written today.
Functional programming is the way forward. I don't mean this as a personal criticism of the parent poster, just a general comment. The fact that they (most programmers) cannot see that every program they have ever written is a logical system is an indictment of how most people get into the industry. Code is just applied mathematics and most coders do not have the mathematics to apply. The sooner we fix this the better the quality of the programs we write will become.
"The first thing to do when you find yourself in a hole is stop digging."
I wouldnt say that any of those reasons is why I dont like Java. My reason is the enforced OO that has a tendancy to drive me up the wall. The fact that everything must be an object and used properly. Is irritating if you are trying to do a smaller program that doesnt need the OO.
I surely believe what you are telling, but in what way is Java responsible for that? Your companies uncool recruiters are to blame here.
A program made in Java without an eye to security is going to be more secure than a program made in C without an eye to security.
I wouldn't count on that. The classes of vulnerabilities that affect typical C and Java programs are just different. Of course, buffer overflows aren't a problem for typical Java programs. On the other hand, lack of synchronization is not such a big problem in the C world.
For example, if you write a web application in C, it's quite unlikely that it exposes data from a different session if you hit the browser's back button. With Java, such problems do occur (because the same servlet object is used in different sessions and some programmers use it to store session-specific data).
Anyone still concerned with whether or not their favoured language is cool or not is a 1) hack, 2) student, or 3) self-described 'geek' who's not nearly as good as he thinks he is.
Java works well in some environments and for some tasks, and poorly in others, and a lot of that depends on the programmer, not the platform.
Besides, success is its own argument. If you can't understand why Java is so big these days, maybe that's your fault, and not the world's.
Anyone who loves or hates any language, platform, or manufacturer, doesn't know what they're talking about.
Except that Flash 6 is like ~500kb and a decent JRE is like 30MB.
Flash 6 can install on accident even on a dial-up modem. You won't be accidentally downloading a huge runtime to get Java installed.
That problem is solved if everything runs in Java, and Java is part of the kernel.
Heck, playing devil's advocate here, as I think JAVA as such has a very nice API.
I agree. Of the languages I am allowed to code in nowadays, it is also the most elegant one. One of the problems of Java is that there are gigabytes of example code on the internet of how not to program. Crappy memory and resource management and bad string manipulation are the worst problems. I rarely have performance problems, as long as I don't have to write a GUI or use an application server or XML related library.
Why the hell is this modded up? Java has nothing to do with javascript, jscript, ecmascript, or jboss. That faulty premise is so old and tired that it surprises me that people still are confused by it.
And as far as Java 1.2 vs. Java 2 goes -- ever heard of versions? You really think that everything in the original specifications were rock solid and that nothing needs to change? That's ignorant.
-1, Troll
Rule #1 -- Politics always trumps technology.
I do not find java all that verbose. Terse or not the really key to getting real work done quickly is a large collection of libraries so you do not spend your life reinventing the wheel. Look at Perl it is not a pretty language but cpan makes it so useful that it has yet to be replaced by Python or Ruby.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
If this is too abstract for you, consider the following C code for a simple command-line interface:
struct command_t{
};struct command_t commands[]={ };
void run_command(char *comm){
}printf("Unknown command: %s\n",comm); }
Implementing help is left as an excercise for the reader. So is handling bogus input. The point is that this way I can add a command without touching the command parser -- just write the callback and insert it into the list. If there's some more sophisticate processing needed on some commands, I just add a flag to the structure and do the work once in the parser. Short of code generation, how would I do this in Java? A switch statement is not acceptable, because it means that everwhere I deal with commands, the data will be duplicated (embedded in the code).
That's just getting started, of course. Then there's the type system, which uses hideous wrapper classes around the most useful types (this can and should be done transparently without involving the user -- lisp, python and ruby do it fine). There's the complete lack of introspection. There's the absolute need to put every helper function into a class whether it logically belongs there or not, bloating classes beyond the problem-space items they represent. There's the misdesigned basic library so complex I need documentation every time I read from a pipe....
It just takes far too much work to make Java do anything I want.
Sig:Why copyright isn't a fundamental human right
Synchronization is not a problem for C because the average C programmer writes single-threaded code, and it tends not to be server-side (and if it is, it tends to be CGI, which doesn't scale well. It's possible to run Java in from a CGI script too). Of course it is possible to write multithreaded apps in C, but then synchronization becomes a big issue too.
Server-side scalability means pooling, caches, lots of things that imply resource sharing. This means some form of synchronisation, whatever the implementation language.
Hey, I *like* java, but this kind of crap is definitely shooting yourself in the foot material.
You! Yes, YOU! Out of the gene pool!
Thats a programmer error. A bad programmer can make anything happen.
Mine aren't. They run for weeks and months at a time. Startup time is irrelevant in the enterprise.
Blar.
They go where the work is. Plently of Indian workers programming in .NET and other languages. Your just not tendering for them.
or maybe it's because one of Sun's co-founders is an Indian, and favors Indian workers. This isn't speculation on my part, see Sun's co-founder says Sun favors Indian workers
The quote was:
"At Sun, people from India are favored over almost anybody else."
If Bill Gates said something like this about American workers, he would be called racist. God, I love the American media.
To cut a short story shorter, he got selected after a technical and HR interviews which were cakewalks compared to other guys' interviews.
To be frank, it really concerns me when the interview process is a "cakewalk". It generally means that the interviewer is too lazy, thoughtless, or inexperienced to come up with challenging questions. If a company takes that attitude towards their most important fundamental activity (bringing in talent), it doesn't bode well for anything else they do. (Plus, I like working with people that can teach me things...) ObJava: I've seen some _tough_ Java interviews, so Java doesn't necessarily mean anything about the difficulty of the interview process.
Since when is an unsubstantiated flame with absolutely no substance considered "Insightful"? I guess it was moderated by overly sensitive Java developers.
By the way, don't take Paul Graham's comments out of context. His main argument wasn't about what language is better but about what tools are available that hackers like using. He also points out that with Java being touted as the language everything must be written in by PHBs because it's the trendy thing to do (rather than the right language to use) means everyone and their brother wants to learn to be a Java "developer" in order to get hired and make a decent salary. He points out that this makes it more likely to get someone not so good at coding if searching for Java programmers. By contrast, if you put in an ad for Java AND Python programmers (for example) you're more likely to get a good hacker in that position. Not necessarily due to Python being a better language but because someone knowing the language probably wanted to learn it for themselves, not because it was a trendy "I can make lots of money" sort of thing to do.
I equate it to the same problem we have with a mass of "point and click" admins (you know, folks that go through and get their MCSE's to admin Windows networks that don't actually know squat about networks, couldn't write a shell script to save their lives and generally don't know more than the basics and are unable to figure much out on their own apart from what they were trained to do). The problem here isn't that Unix/Linux/BSD is in itself better, but that you don't just have a bunch of geek-wannabes sitting down and thinking, "Damn, I need to learn FreeBSD or get Linux certified because it'll be easy and I can make loads of money and find a job easy!". Does this mean that all Windows admins are idiots? Of course not, it just means that if you advertise a position for a Windows admin and another for a Unix admin, your going to (percentage wise) get more capable folks
applying for the Unix admin position. You may get a few good folks for the Windows admin position but mixed in there will be a horde of point-and-click admins to go through and the problem is, those HR folks probably won't know the difference.
CLASSPATH. This thing sucks. Worst design decision ever, I swear. Spend forever setting the frigging thing up, and hope to $DIETY things don't change. Oh, and make it so you need to reference individual .jar files too! What a great idea? What to add a library to your project? Be prepared to do battle with classpaths.
.jar's in a *direcotry* referenced by CLASSPATH? I'd love my CLASSPATH to just be "/usr/local/java/lib:${HOME}/java/lib" or something rather than specifying a million .jar files...
Anybody know why they decided to make it so you can't just put all
"Ignorance more frequently begets confidence than does knowledge"
- Charles Darwin
Of course there are full-featured IDE's for Lisp. In fact, the very first IDE's were made for Smalltalk and Lisp.
The fact that you can't understand Lisp speaks more to your intelligence than to the merits of Lisp. As Paul Graham says, he is talking about the tools preferred by the best and the brightest programmers, not by average programmers.
|>oug
Who cares if a language is cool?
.Net convention. There Java was considered "uncool" because you had to think before writing a program. That did put some things in perspective...
My customers (and me) want an application that works, is maintanable and runs on platforms on which they haven't decided yet.
I use Java to program those applications. And they live up to their expectations.
I once attended a
Brainfuck is by far the best language ever concieved :)
You could take the approach that every piece of software you write has to have that level of detail and accuracy, proof-like precision if you will. I think you'd find that your productivity would be far lower in terms of logical constructs completed per unit time. This is probably an acceptable trade-off if you write control systems for nuclear power plants or if you work for NASA where budget and time-frame are vastly greater than for your average business programming problem.
But for most applications, there is not only a set of requirements, things it needs to do, but a very short period of time to make it do them in. And if you go to the boss and tell him it's going to take 14 months and cost 1.3 million dollars because everything has to be written as a logical proof, he's just going to fire your ass and get a team of third-world guys to puke it out in Java in 3 months.
I'd love to be proven wrong here - if you can show me a study that indicates that use of ML or some other language type results in substantially more bug-free code _without_ sacrificing development speed, then by all means, I'll admit that I'm wrong. My own personal experience is limited to small apps I've written in OCaml, which were cool and everything, but OCaml isn't purely functional, and I found several aspects of its use quite painful, despite feeling very "elite" as I hacked away in a semi-functional language.
Most particularly, the idea of not specifying an explicit contract between chunks of a system with the types of information passed between them really irks me - to me this makes a development language unusable by more than one person, or even by one person in a sizeable programming project. I constantly refer back to other chunks of my code to see what type of data I need to feed to some function or method - and when using somebody else's code I'm far more likely to be interested in the interface than the implementation. Without that kind of separation, I don't see how this stuff is usable (I can't "keep the whole proof" in my mind at one time when I'm doing mathematics either, that's why you have lemmas and theorems and other mini-proofs that you call out to).
Maybe somebody can point me to a more usable version of a functional language that doesn't "feature" static typing, or that was designed with real programming tasks in mind and thus would be worthy of more study re: the development speed and team usability characteristics I mentioned above?
In theory, all of hte above is correct.
But I am a JAVA developer using Borland JBuilder X (one of the leading JAVA IDEs, implemented in JAVA) on a 3Ghz machine. The UI is the slowest, most unresponsive thing on my system. If the maker of one of the leading JAVA IDEs can't package their system (w JDK of their choice, toolkit of their choice, etc) so that its responsive on a modern machine using XP Pro, then I think it's fair to say that JAVA is slow for GUIs. (Yes, XP pro sucks, but every other app on my machine, most of which are written in C/C++, work fine.) Try eclipse - even using SWT, my experience is that its about as unresponsive, compared to Microsoft's C++-coded IDE, and even compared to Emacs, which is largely written in bytecoded LISP (and not even a very fast LISP) and has been known as a hog for decades.
Also, while hotspot VMs in principle can grow to faster cpu performance than native compilation, the major cause of JAVA's slowness is space cost, not time, plus startup time (of the JVM, classloader, etc). I've never heard of any JVM which is reasonable in space terms. Most need a 10M resident set for hello world, and go up very fast with increasing complexity of app.
Starting BEA (_the_ leading JAVA app server) on my system takes 30 seconds. This is absurd. (And it's not even precompiling the JSPs needed, because as soon as I hit a page, it chokes again for multiple seconds.)
Plus, htere are things that native compilers are better at than hotspots, as they can make lower-level decisions than a bytecode compiler while they can still see the source tree. I don't think either type of compiler is clearly better than the other, but I don't think its fair to say that JIT is always faster. Try using a few JAVA apps, then using a few C++ apps, and see which one works better.
That said, JAVA has a huge security advantage over C/C++. Even experts screw up sometimes using those languages (look at the occasional security hole in carefully coded bits of core unices). _Any_ garbage collected, bounds-checked language has much of what JAVA has (excluding secure classloaders, sandbox, bytecode verification) for security, in fact. Some, such as OCaml and Common LISP, can potentially be far faster than JAVA, especially at compute-intensive tasks. If speed is no object, use Python or Perl (and I know, sometimes they're just as fast).
Tool choice depends on the task. And sometimes the task is "interface to these twelve hoary enterprise systems using the same language the standards committee decided the other twelve hundred programmers will use." Don't laugh. I think the analogy from JAVA to COBOL has some truth to it...and just think how much better of a COBOL JAVA is, in most ways. But that doesn't mean that Paul Graham should like JAVA. He made his career by seeking out the kind of problem that is NOT subject to the above constraints, but very different ones. (Did anyone actually _read_ his article? Or his other 30?)
Sounds like an ID:10-T error to me...
Some of his posts are grossly incorrect. Examples:
But the semantics for many programs would not be correct, since Java requires array bounds checking. Disabling it means that you're not compiling Java.
True, if youe xceed the bounds of an array in a Java app you will get an array out of bounds exception - but that is the worst that can happen, a nasty error message. However, this is a totally different can of worms in C/C++. If you don't check the bounds of every single array, you could be exposing buffer overlows in your application, which is a huge security hole. +1 for Java.
You've posted three examples of code that you claimed was as fast or faster in Java than in C++, and every one of them, when compiled properly, turned out to be faster in C++ than in Java.
Faster when run how many iterations under hotspot? 1? 10? 100?
In Java you have to write nine copies of the basic sort function: one for arrays of chars, one for arrays of doubles, one for arrays of Objects, etc.
For one, most people use the Collection or List interfaces for utility classes so that you can pass in any type of object, be it an ArrayList or a linked list, so in the Real World(tm) this is rarely an issue. Additionally, Java 1.5 has templates so it is a moot point.
I could go on and debunk more of his debunking, but I can tell from his posts that ihe is quite biased and is not being resonable. Just for reference, I am *not* a Java developer. I write a lot of C++ code and a lot of java code, both are ideal for certain situations. For example, desktop apps with need for a fast startup time will always be best written in C++ until Java Vms are built into the OS. But for long-running business applications, where startup time is not a huge requirement and ease of development, debugging, and security are a higher priority, Java wins hands down.
During the last 20 years that I've been a professional programmer I've developed a theory that says, the more practical an application will be to the larger masses, the less cool it is to programmers. A corollary being that the tools to create uncool applications will also be uncool.
Consider the coolest programming jobs: game developer, theoretical research and embedded missile guidance systems, etc...
Now consider: accounting applications, banking applications and word processors - arguably the most used, most common, most practical of applications - and low down on the programming pole.
And then there are the tools used to build those applications: at the top of the pole assembly, C, Perl; at the bottom: Java, Basic, C#. Again the uncool languages are associated with building uncool apps.
It's a simple as that.
Finally, the exception that proves the rule is operating systems. Linux being a perfect example of a cool thing to work on and eminently practical. I would argue however, that the OS is unseen by the masses. The translucent background against which applications are run, thereby exempting them from the theory.
- Tune in next time for.. a clever sig.
"the managers that choose Java"
Hey, waitaminute, who let the *managers* choose?
"Fred, here's a saw. Go pound some nails in."
Bingo. That's why I hate it. The whole "platform independence" is pretty much a load of crap in Java. Yes, in theory, it's there. In practice, all of the real Java apps I end up having to deal with require some specific runtime. Then I fight with CLASSPATH stuff.
I understand that truly cross-platform programs are a difficult problem. But that doesn't change the fact that Java is pretty bad at it. And don't even get me started on the fact it has multiple GUI API's.
One word: Eclipse
IBM took a different tack than Microsoft, yes. They wrote an app that didn't suck and made it open source to boot.
To reduce crime, make fewer things against the law.
Java is slow - This is a myth.
I honestly don't understand why people are still repeating this. It _is_ slower than either native C++ or
Java bytecode is not easy to optimize, having been originally intended for interpretation (my, how silly that seems now!). This is usually a minor issue compared to memory. I also suspect that, using the standard Java libs, IO is bound to be slower than a more direct approach unless the JVM takes some shortcuts and makes some methods into special cases. But actually, from the point of view of my actual work it doesn't matter what the reason is -- performance critical serious number crunching is done in C++, and that's pretty much a universal, because everyone relevant has made the same simple observations I have. This C++ can then be wrapped with a Java interface for the benefit of other systems that depend on Java and for people who only care about whether the system is Java or not (and so that it works with WebSphere now that the company is locked into WebSphere, heh heh).
So, _whyyyyyyy_ am I _stilllll_ told by posters on
Whence? Hence. Whither? Thither.
Agreed. I work in the government contracting space in the Maryland/DC/Virginia area. Every contractor up here wants Java/J2EE right off because that's what the government is into. It gives them maintainable, cross-platform code that pretty much anyone can understand. Given the wide range in skill levels of personnel working on these projects and/or future versions of them, this is essential. Not necessarily *cool*, but certainly good use of taxpayer $$ over the long term, especially given the wildly heterogeneous server environment in the government (NT, XP, Linux, all 32 flavors of Un*x, AIX, Cray Solaris anyone?).
:) The point is, here and now Java's popularity yields significant gains for those who can program in it.
And in our area, it's much easier to say "what economic downturn?" especially if you know Java and have some kind of security clearance. Email me if you do, we're hiring
Whether this is cool or not depends on the observer.
Keep your friends close.
Keep your enemies in a little jar on your desk.
Java is quickly becoming a de facto standard among management.
Some of the managers are technically savvy enough to realise that there is not much difference in choosing one language implementation over another. They choose Java because there are many programmers being taught Java at school. They are betting that should keep the labor pool large and the labor cost down in the long run.
These tech savvy managers know that python or curl is easier to write and maintain. They also know that other OO languages perform better, but they are adding the cost of staffing and outside support into their equations. They are projecting Java to become the next COBOL or C. None of them were 'perfect' coding languages, but they each dominated all other languages. What is technically 'best' is not always the 'winner' in the marketplace.It only needs to be good enough.
That said, most of the rest of the management (about the other 90%) likes the cool Java swag they got at the last convention. They think it makes them superior to wear it in first class while sipping cocktails and talking loudly on their cell phones about 'their' latest Java project implementation, and its overall downward effect on the cost ratios of delivering customer facing services, thus maximizing the returns for each level without jeopardizing the long term blah blah blah blah blah...
Just like the last article slashdot linked from this source. For one, it's a straw-man argument. He gets to set up the 10 greivances that he'll knock down. How about he ask Paul for a list of 10 greivances to knock down? Secondly, the greivances he picks and his arguments against them clearly show that he's incapable of thinking in the way that people who despise java think, which makes him a poor arbiter of such things. Would a great hacker really say "Java sucks because it doesn't have a cool IDE like MS Visual Studio?"
11*43+456^2
I think it really depends on what you're programming for. For user applications, especially small ones, it doesn't really make sense to program in java unless portability is your overriding concern. For business applications, especially server applications, java makes much more sense precisely because of the security features inherent to the language, not to mention the maintainability of the code, provided that programmers with half an ounce of knowledge are working on it.
If Paul thinks lots of "great" programmers work for MS (they code in C, hence they must be "better" than java coders) I'd like to know how he explains the never ending list of bugs, many of them security bugs/buffer overflows that seem to permeate the entire set of MS code?
That aside, yes, a great programmer will be able to code something fast in the terse language of choice. That same code will most likely be unmaintainable when the poor maintenance guy comes along to attempt to track down the buffer overflow or whatever other error has cropped up in said code.
And just because you use a language like Java doesn't mean your code has to be verbose. You can approach C's terseness with Java, although you cannot utilize some of the pointer variable morphing attainable by C. But you certainly can approach C or Perl's unmaintainability with ease with Java, all it takes is 1 or 2 people that don't understand the language, architecture, nor OO. (Think 14K line "classes" here with 20 or so methods, 5 "inner" classes, and lots of circular dependencies)
The cesspool just got a check and balance.
One has to admit that a statement such as
Of all the great programmers I can think of, I know of only one who would voluntarily program in Java. And of all the great programmers I can think of who don't work for Sun, on Java, I know of zero.
can only come from someone who doesn't really have a global picture and is a bit narrow minded. Otherwise, he'd think more, open his eyes and will find some happy Java developers around. Obviously, this argument is flawed on purpose and all he wanted to do is revive a closed debate that has been around since Java is out, which is a bit pointless IMHO.
I think Paul Graham should have been modded "flamebait" or "troll" at best.
I'm amazed that how all of the current "state of the art" Languages/Frameworks still haven't caught up to Smalltalk yet.
Smalltalk is a Language/Library/ and integrated development environment all in one.
It's had for over twenty years:
Java/C#/.Net wish they had all of this "20 year old" tech. They are good Languages/tools that are slowly evolving into Smalltalk. Why don't you just save time and go to the top of the food chain?
It's amazing how one research lab, Xerox Parc, could have been SO far ahead of its time. Its like software has stood still for twenty years.
You can explore it via the open source squeak project. Understand it is written for coders by coders so it takes a little work to come up to speed on it, but in my option, well worth the effort. And Morphic just rocks. http://minnow.cc.gatech.edu/squeak/1
Martin Fowler of Refactoring does Java.
Erich Gamma of Design Patterns is a major player on the Eclipse project.
Besides why should people consider a language cool at all? Shouldn't it be, "What I can do with a language" is considered cool?
If someone is passing you on the right, you are an asshole for driving in the wrong lane.
Is it just me, or are there more sponsored links on that page than there is information.
I'm ok with people using ads to substidize content, but there are like 30 sponsored links surrounding the article.
I could not agree more with your post. There was another quote that went something along the lines of: a cool language is one that teaches you something by learning it. I thought learning and using Haskell and Lisp were very useful for a different and complementary mindset that they help create. I think my C++ programs are higher quality because of my functional programming experience.
Languages like Java or Basic are not cool for me personally because they did not teach me anything. These languages are primarily designed to protect the computer from the programmer. I think the proliferation of buggy programs is due to languages like Java or Basic that make it easy for a person without the proper training to program. Engineers need to go through very rigerous tests to certify their expertise before they are allow to design and build a bridge. Why should programming be different?
SYS 49152
Yeah, but how do you know when you're answering a job ad? Most of us aren't Paul Graham and don't work for k-rad startups all the time.
The key point is that Microsoft themselves uses the "smart guys in a room" setup, and has long promoted "1 Good Programmer is worth 10 bad ones" etc. Thus MS Technology projects tend to follow that model.
Sun Micro outsources tons of their own stuff, and Java projects tend to follow the Command-n-Control model.
I'd also like to know why it's considered hard to learn. When I tried writing some Java stuff (a few years ago) I found Swing extremely straight-forward and obvious. Perhaps that's because I had previous experience with GUI toolkits in Smalltalk, C++ (including MFC!!! ;)) and Modula-2. Perhaps it's not easy to learn if you're a newbie to programming, but then any large class library is going to be challenging.
You talk like pointer aliasing is something common within an application.
That's missing the point. If I have a C/C++ routine taking two pointer dummy arguments of the same type, then there is no way of guaranteeing that the pointers won't be aliased (i.e., point at the same object). Therefore, notwithstanding whether they are aliased in a given program which uses the routine, the optimizations that can be performed when compiling the routine are severely limited, in order to allow for the possibility that the arguments might be aliased.
Tubal-Cain smokes the white owl.
Let's see, here I am at a command line, I want to run a Java application. Any other compiled language compiles to a native executable that you run by typing its name. Java is just this random archive full of "stuff", and you have to use a "run" command like we were back in 1968 before Bell Labs invented the executable bit.
.o in, and package require... no...? How do I do that, then?
Here I am running a Java application. I type the command line to start it, and wait. And wait. And wait. And wait.
Here I am with some code written in Java, and I want to call it from Tcl. Write a quick C wrapper, link the
Here I am with a library written in C, or Fortran, and I want to call it from Java... well, how badly do I want it?
Java is like Mac OS used to be, its own little world and the only way to play is to leave everything else you've ever worked on behind.
Well Java as I understand moves much of the optimization process down into the JVM whereas a compiled language like C++ does that optimization during compile time. Comparing the time I have spent waiting for C++ during the code, compile, run, code, compile run, I find I have wasted much more of my time. With the Caching of classes and dynamic inlining of code the JVM tunes up as you you go along.
... current and 1.5 (Tiger) coming in a few months are light years ahead of that old MS version and should be looked at seriously.
You are correct that this model has a start up delay which can be seen as a problem if you do a lot of startups, but like many applicatons say a web server that starts a JVM and keeps it running while the server is up it is a one time charge. I find that given the saftey of the language especially around automatic garbage collection compared with C++ my envirionment is rock stable and the online Web apps we have only come down with the hardware needs maintenance.
The folks compainign about MS Java have a good complaint as that was an old buggy version of Java that has not been in general use for years by people using Java from the Sun source. The new versions of Java 1.4
I write my code on NT and W2k platforms (java 1.4.2) and field the same code on WNT W2k Sun Solaris with out modification and no changes for envirionments. With C++ or C# and the java clone this is impossible at this time. I have in the past had to field C++ code on different platforms and that was not a very nice time.
How do you want to spend your time. Collecting your own Garbage, writting very very carefully so you can use your code in different environments, or do you want to just get the job done right and once and get on with it?
...is that if you don't program in Java, you've probably tried it. I know I've dabbled in everything from assembler, basic, visual basic, c, c++, java and various libraries/toolkits.
Java, by an order of magnitude, has the worst first impression of them all. Try writing "Hello world!" in a Swing window as your #1 tutorial. The start-up time, memory use and whatnot makes it seem like a dog.
Yes, I KNOW Java scales well to a large app, where it's not that relevant. That doesn't change the fact that if you dabbled in Java, and decided on something else as your language, your impression of it will be far less than stellar.
And you know how it is with every programmer telling you that "[MyLanguage] is the best", you'll think "Riiiiiiight. I tried it, not so buddy."
Kjella
Live today, because you never know what tomorrow brings
This is true, but that is not the whole picture. One of the things that was obvious right away is that minimizing the number of things the programmer can do wrong causes a significant jump in the effective productivity of the programmer.
Brooks talks about this in the Mythical Man Month as it related to assembly versus high level languages, but we do see the same effect when moving between a language like C and something like Smalltalk or Java. It has been my experience that a good programmer writes more and higher quality code in Java versus C or C++, largely due to three factors:
1. Mandatory exception handling forces error handling down into the code where it can best be dealt with. In other words, you have to work harder to not handle abnormal situations.
2. Garbage collection eliminates whole classes of memory mismanagement problems.
3. Standard libraries contain many useful classes that had to be written independently in C/C++ (leading to a variety of different container classes, for instance, of widely varying usability and quality).
All three of these affect both time to deliver and quality of delivered code. We're not talking about minimal changes in productivity, either. I've been watching and working with Java and C++ since ... well, pretty much since they made it out of the laboratory. The improvement in real world productivity seen with Java is a factor of two to four greater on average versus C/C++ (measured by "how long does it take to get this feature to work", which is not necessarily the same as "how much code did I have to write"). Often lower for GUI work (depending on which GUI toolkit/tools you're using) but much higher for network code. Moreover, bug counts in released code are dramatically lower, like one tenth as many, and they tend to be less serious (a feature may fail, but seldom does the entire application fail).
In any case I guess I would have to vehemently disagree with Graham's contention that great hackers don't use Java. I suspect that is more a matter of which circles you run in, as that certainly doesn't hold true in my experience. There are fewer using it today than three or four years ago, but I surmise that that is mostly a matter of language maturity; the best programmers tend to sit on the bleeding edge, and that's not Java anymore.
Your mileage may vary, contents may have settled during shipping, etc.
jim frost
jimf@frostbytes.com
But the reason it is uncool is because, outside of stuff written just for Java monkeys, there is no Free software to speak of written in it. Free software is written in C (65%), C++ (25%), and Python and Perl (all but the last 1%). Free Software coders have avoided Java for lots of reasons, including its not-really-portability, its bad performance, its hasty and stupid language and library design, its corporate 0wnedness, and their own resistance to hype and idiotic jargon.
Java killed Freenet in the crib.
Do they have any other choice? ;)
It can, in theory, be faster. Sometimes you discover data that turns out to be constant in the end, but you don't know this until your program is running. A JITter can use this additional information to compile to machine code that is a lot simpler and therefore faster. If you then execute this piece of code lots of times, you can earn back the time spent compiling and then start to profit from it. I remember some work being done into some research which did this in C: it generated some C based on a template, fork()-exec()ed gcc to compile it to a shared library, dlopen()ed the shared library and then ran the code. Of course, you had to do this explicitly, but I think since the chances of actually having an algorithm that benefits from this is pretty rare, that's not going to be a problem.
That being said, Java has no way of hinting to the compiler "this is going to be constant for a long while now", or "I'm going to run this loop a couple of million times in a bit, you might want to JIT it real good". Without those, the compiler doesn't really have a hope.
Also, it's not a case of interpreted languages not being cool. Perl, Python and a myriad of other languages are all interpreted (or run as some kind of byte-code), and no-one complains. Then again, I've seen Java out-paced by many of these languages (most of which compile the program to byte-code at start-up faster than Java loads), which suggests to me that Java is just a poor interpreted language. If you've seen how JVMs work internally, I think you'll agree with me.
The VAST majority of software being written is high-level business applications; hence there are at least an order of magnitude more JOBS available for application programmers than systems programmers. For virtually all business apps, programmer productivity, code maintainability, and predictable scalability are FAR more important than raw execution speed. This is where Java puts C++ to shame.
Why is it that the proponents of "one nation under God" are so eager to get rid of "liberty and justice for all"?
meh
The Java API is so large that wheels often get reinvented because no one can bloody find the 19" wheel with a particular bolt pattern an the type of treads they want.
I rarely criticize things I don't care about.
Real java apps are packaged in a Jar file with a manifest file that takes care of everything...
That's total BS. Real programmers make mistakes. Real programmers benefit from the abstractions that C provides over assembly. When you write Java, do you find yourself wishing that you could address members by adding pointer offsets? Or do you long for the days when you could conditionally branch to a label instead of writing a for() loop? Pointers are a necessity for many computing environments, but I don't think that PC application software is one of them. You gain nothing, IMO, and risk everything.
My dislike of Java has nothing to do with slowness. It has to do with control and succinctness. Trivial example:
// Must be stored in a file called "hello.java"
public class hello {
static public void main(String[] argv) {
System.out.println("Hello world!");
}
}
Since everyone likes readability, I'd like to ask what part of "static public void" helps you to understand the program. Let's compare this to, oh say Perl.
print "Hello World\n";
Which, as Perl's reputation precedes it, is obviously harder to understand.
Javs relies on vast ammounts of knowledge drilled into the heads of students. If the OO paradigm wasn't so popular, Java would be entirely obtuse. Anything not memorized must be looked up. You wanted to add that integer to the float? Too bad. Go look it up type converting. Additionally I'd like to conjecture that the human mind is better at remembering small things than large ones. Therefore, system.out.println() is more difficult to remember than print. I'd rather remember something like "-e" (Perl) to test for file existance, than the Java equivalent, which I have looked up and since forgotten (though I've used each the same number of times).
While C may be verbose, it allows you to have near complete control of the physical operations of the hardware (e.g. when you delete memory or use a pointer, this has a physical analogue).
Java is both verbose (lots of commands to do simple stuff), clunky (really long commands), and forces you to use the OO paradigm whether or not the problem demands it. It's these reasons why I dislike it.
-- Political fascism requires a Fuhrer.
Graham claims that terser languages are more powerful, because studies have shown that coders churn out a pretty constant number of lines per day, regardless of the programming language. Java is anything but terse.
So, use a decent IDE, one that features code completion - type the first few characters of the name, hit ctrl-space (or whatever, as appropriate) and it completes the symbol for you. Meanwhile, having more descriptive names improves code readability (and thus maintainability).
Next argument agaisnt Java, please.
It's official. Most of you are morons.
First, there's nothing wrong with a language being easy to learn and easy to use. Power and ease of use are not mutally exclusive.
True. But sometimes "ease of use" runs into "quick and dirty", and all the difficulty in maintaining and extending that that implies. VB and Perl lend themselves to quick and dirty and require more self-discipline to stay well-engineered. Java usually pushes you to more forethought, and while crap code is certainly possible, it's somewhat less likely.
Second, what's with this stuff about languages "for the masses"? VB programmers are programmers. No one's running down to the local curb store for a loaf a bread and a $400 box of VB.net. MS hasn't included Basic, Visual or otherwise, with its operating systems since,I dunno, DOS 3.3?
Yes, currently VB is just another language.
But I grew up with built-in BASICS, and when I got introduced to it, VB3 seemed to be positioned in a similar role. I got a student edition for cheap and had a lot of fun.
As for the "for the masses", that could also be "for the non-techie, business-knowledge people in your company". I don't know if VB (especially the Office-centric versions) still do that well or not.
I do think that we who grew up with computers that booted into BASIC have an edge over people who get the start button. Making goofy, kiddie programs had a much lower barrier to entry back then...now it's almost certain you'll have to install something, or go nuts with the Javascript.
SO YOU'RE GOING TO DIE: The Comic for Dealing with Death
here is the REAL reason hackers don't like java, and most of them don't even realize it.
the job of an organization developing a software product (whether it's a company, an open source team, whatever), is to get a product out. nobody outside the project cares about languages or anything else, as long as it all works in the end. but to get a product out, the manager eventually has to pick a strategy. they usually fall somewhere in between the two extremes:
A) use a few brilliant (possibly well paid) hackers and let them do the work. they're smart, and good enough to rely on to just do it. managing them is like herding cats, but why would you need to?
B) use an army of keyboard monkeys and manage the hell out of them. these guys can pound out mediocre code, but with enough software engineering from the top down, well defined specs, and massive testing and integration, their work is sieved into a release-quality product.
real hackers hate being marginalized, having their creativity stifled (yes, for those of us who actually write code, not just implement specs, creativity is involved), having to do the dumb solution just because everyone else is too weak to do their part of the smart solution.
java is not a bad language. i think many would agree that is it at least decent (i think it's pretty good, actually). but java is the language of the B coders. it is made to be easy and idiot proof, like visual basic. you cannot do "neat hacks" in java, because if you could, the B coders would screw it up and produce worse code. java is a great language for the B coders. but the choice of java for a project is often a leaning toward strategy B. it's the "we can get any code monkey off the street to do this". it's the grunt work software that real hackers don't want to do, and what B coders are hired for.
perl, a RAD (and rad) programming language, does not suffer this stigma. perl is accepted by hackers, precisely because it is not idiot proof. it's easy to confuse the B coders (and yourself) with some maliciously written ascii barf. you can do some crazy tricks in perl. it does not lend itself well to software engineering and the micromanagement of the B coders. perl is a hacker's language.
many real hackers i've seen instinctively feel resentment towards java and the like, because they see marginalization of the software industry. java is for the blue collar coders, part of the greater plan of "software factories", where reproducability, meeting deadlines and specs, and easy replacement of people is way more important than doing cool shit. those of us who wish to stay at the top of the game, to do the cool shit, to write the programs that interest us the right way are often drawn to the languages that keep out the idiots, that have a higher barrier of entry, and let us do the cool hacks.
i don't dislike java, and i don't dislike you B coders out there (you know who you are). i just don't want to be one of you.
thanks for reading my long-ass post,
p.
Some of the things in your list are valid gripes, but there are a few that I don't agree with. For example:
In my experience (which isn't huge with Java, but I've used it for commercial work), one of the things I liked most about Java was that it actually tended to save me lines of code.
Oh, sure it's got an explicit full-on syntax, but I'm comfortable with that. What I was most impressed with was there was a vast amount of standard data types and APIs available to accomplish a very huge amount of stuff. Looking at C++ and the like, the APIs are anything but cross-platform. (Any helpful links to a good C++ API (not GUI toolkits) which is both POSIX and Windows might make me use that some more.)
Ding ding ding! We have a winner! Congratulations, you realized that a terse language is not necessarily a productive one. If that were true, C would be more productive than Java, and APL would be the most productive language on the face of the earth. Neither of those statements is true because the terse languages have primitive standard libraries and therefore usually require more code to accomplish the same thing.
I guess I'll never make anyones list of greatest programmers, but I think Java is plenty cool, especially with some of the recent changes. Java has gone from being a trivial scripting language that was primarily useful for animating pictures on the web to a very powerful language that can occasionally outperform C++, especially on web appliations.
Java is far easier to learn than C++. While Java does not provide all the flexibility of C++, most of the time I don't need to be able to write code that interacts directly with the hardware.
The days of managing memory by hand should have become a distant memory for all but a handful of programmers long ago. Memory management bugs are among the most common and difficult bugs to fix.
When I first started programming Assembler programmers made all the same comments about us "sissy" C programmers that the C++ programmers make about programmers in Java and other memory managed languages. There aren't so many assembly language programmers around these days...
-All that is gold does not glitter - Tolkien
www.ra
I am glad that these are the only things the guy who truly hates Java can come up with
Eveything you listed is your friend, not enemy. Once you program for a while (and I mean 5,6,10 years), it will start coming to you.
Object casting
Often, downright ugly, this "feature" ensures that every object is what you think it is. You delegate all the checking to the compiler so you program, when it is incorrect, fails early, in fact, fails before it runs. Failing early is the sign of great code.
try and catch ..) ways out. Using exceptions allows much cleaner separation of the "normal" logic and the "error" logic. Now, whether all the exceptions must be checked, or if C# model is better - is a different question.
Exception handling is a marvelous feature once you realize that from every situation there may be more than one (or two,
int and boolean
Well, they are two completely different things, representing completely different animals in the real world. Why would you expect to be able to compare,assign, etc. apples to oranges?
native and object types
Tend to agree with you there.
Precision
Because IT IS an error when precesion is lost?
bytes
bytes are bytes and numbers are numbers.
stacktrace allows to pinpoint your runtime problems
classpath can be messy but it is precise: only stuff from classpath will be loaded by your program, nothing less, nothing more.
etc., got to go, do some uncool programming.
That is an interesting idea. Too many choices? Better to spend the time hunting for a 19 wheel with the right bolt pattern than having a chunk of ore, a forge, and an anvil handed to you.
See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
This is not really about Javas coolness or not (could not even read the article).
To my experience when Java programmers switch to C++ they tend to produce code that is full of memory leaks (new in Java and C++ are VERY different) and have a tendency to write overdesigned and unnecessary complex code.
What you will always see from a person done Java in the past and now doing C++ is things like:
HaraldPaul Graham points out why this happens in another of his essays, Revenge of the Nerds.
The pointy-haired boss miraculously combines two qualities that are common by themselves, but rarely seen together: (a) he knows nothing whatsoever about technology, and (b) he has very strong opinions about it.
Suppose, for example, you need to write a piece of software. The pointy-haired boss has no idea how this software has to work, and can't tell one programming language from another, and yet he knows what language you should write it in. Exactly. He thinks you should write it in Java.
Why does he think this? Let's take a look inside the brain of the pointy-haired boss. What he's thinking is something like this. Java is a standard. I know it must be, because I read about it in the press all the time. Since it is a standard, I won't get in trouble for using it. And that also means there will always be lots of Java programmers, so if the programmers working for me now quit, as programmers working for me mysteriously always do, I can easily replace them.
Well, this doesn't sound that unreasonable. But it's all based on one unspoken assumption, and that assumption turns out to be false. The pointy-haired boss believes that all programming languages are pretty much equivalent. If that were true, he would be right on target. If languages are all equivalent, sure, use whatever language everyone else is using.
--- Hot Shot City is particularly good.
This is just messed up.
Are you talking about replacing Java applets with Perl scripts? What? And who does serious web development with Perl CGI!? I'm a full-time perl programmer and won't touch CGI. CGI.pm, sure, but not unless it's under mod_perl.
And Java not good for web-based applications? Have you not even considered the enormous rise of Java as a popular back-end server language purely for large-scale websites? And hey, in some cases Java's regexps are faster than Perl's!
I love perl. I make money writing perl. I teach people perl. But I also know Java (mostly from college) and can tell you don't know what you're talking about.
Yes, you can use /etc/ld.so.conf
for common shared objects. You can equivalently
use $JAVA_HOME/jre/lib/ext for common jars.
Using a path is the single most common way to find dynamically loaded code.
(Reality reasserts itself sooner or later.)
Actually, your parent poster was precisely correct. You're trying to compare completely seperate entities. Applets were meant to be a way to deploy thick client applications to end-users as opposed to your perl scripts which are completely server/thin client based deployments.
If you truly want a closer apples to apples comparison you really should check into using jsps. On any decent application server a jsp deployment will outperform cgi based perl script (I can't speak for a mod_perl based deployment). I'm not trying to bash perl here, I love it. I'm just pointing out your error in comparison of applets (which are all but dead -- replaced with java webstart [.jnlp files]) to server side perl scripting.
I'm a Java guy because of the API. When I want to get something done right I don't want to re-invent the wheel, and I don't want to have to mix and match dozens of differently-written APIs. Java features a robust and (generally) consistently named and structured API. On top of this, the API is very well designed and tested, and caveats are well-known. It is not some obscure OSS library that lacks security/features/functionality and may still have unknown holes or bugs.
Also, all this talk of the "Coolness" of a language really got me upset and made me have to post. When I was in college, people like this pissed me off to no end. I had a compilers class and the assignment was to make a 4-stage compiler in the language of our choice. I picked Java and recommended others do the same. The responses that I got were "I want it to be quick, so I'll use C" or "I don't really understand Java, so I'll use C" or "No thanks, I'll use a real programming language", etc. So fine, I was the only one that used Java. In the end, my program was complete, worked 100% without error, was well-structured (having logical distinction between subcomponents), FASTER than the C programs, readable, and it took me LESS time to write it than the C-lusers that stayed up until Midnight helplessly trying to complete theirs. Some failed.
In the course of working on the compiler project, the 1337 C coders had memory management issues, segfaults, etc. Some of them could not work the bugs out of their hashtables/linked-lists/etc, and so resorted to bad practices such as bubble-sorts, arrays-of-arrays-of-arrays (instead of dealing with pointers), etc. Wasteful memory practices, inefficient algorithms, sloppy code, etc. -- hallmarks of 50-75% of every C program I've ever had the pleasure to clean up after. The ones that
DID manage to complete their projects were exquisitely proud of how great of hackers they were. Nevermind the fact that in their desparate drive to complete the project, they had no chase to sit back and think of nevermind implement hash-maps, etc. which would make their program efficient AND ELEGANT. Java allowed me the comfortable leisure to do all that, and I have the elegant code to prove it.
Now before anyone gets me wrong and says that at least these guys were getting experience with the algorithm knowledge they'd later need, let me correct you. I CAN do algorithms and memory management very well. I understand data-structures perfectly and have written my own in C-based data-structure classes. Java's structures are well-thought-out and allows GOOD programmers to focus on elegance rather than re-implementation.
And BTW... every "1337 hax0r" I've ever met has been nothing but a sham. The smartest programmers I've ever met favored C/C++. The second-smartest favored Java. Both wore normal clothes and didn't have the long hair, beard, etc. that the rest of the insecure programmers of my school would cultivate instead of actual ability. They enjoyed elegance instead of minutae, and knew that languages were just tools to get a job done right (Where right is sometimes incompatible with fast). That should be the real definition of a hacker.
Sincerely,
Enemy of Cool
Now, people hating Haskell might just be jumping ona a bandwagon. People who hate Lisp might be jumping on a bandwagon. People who hate Ruby might be jumping on a bandwagon. These languages are comparitively rare.
But Java? No.
How about this then? Java's type system sucks. It sucks, sucks, sucks. Java generics are only marginally fixing the problem. You cannot design your program up front. Heck, to refactor Java most programmers say you need tools. If your language is so intractable that it requires a tool to make refactoring reasonable, then you have a crappy language.Java's primary GUI API, Swing, is not "brilliant." It's obtuse, lacks many features, and is unnecessarily slow.
Java's "Native Interface" (or FFI, "Foreign Function Interface") is hideous. It's difficult to get much of anything done at all. Ruby and Python provide much better models.
Are these complaints general and clear enough? Java is so riddled with flaws that it's amazing it's gotten this far. A living testament to the fact that marketing overcomes all.
Slashdot. It's Not For Common Sense
You don't use pointer aliasing, it's a concept. Pointer aliasing does occur quite commonly by the way, evidenced merely by the existance of memmove() and memcpy().
Here's pointer aliasing that most people wouldn't even recognize: You make me worry
No, you make me worry. Especially after the HUNDEREDS of applications you've written. You can't even spell "hundreds" correctly for Christ's sake.
Are you flipping crazy (or trolling)?! Go to freshmeat.net, browse to the projects by programming language, and look at the number of projects writting in java (currently 3257, about what C++ is at). Are you telling me and everyone else that every one of those projects are both non-free and solely written for "Java monkeys"? What a total load (as are your "statisics").
First you say: Yeah, and your point is? In case you didn't notice, passing functions as arguments does not make the worlds most legible / maintainable code. On the other hand, an explicit interface is both legible and maintainable, plus you have an explicit place for documenting the interface (Javadoc in the interface definition).
Then you go on to say:This is an implicit downcast:It compiles perfectly and works as expected.
The last line of this:Is an upcast. and I dare you to find a list implementation in any type-strong language that doesn't require an upcast in this situation. You need it to be able to store objects of an anonymous type on a list.
How such misinformed tripe ends up at +5, I'll never know...
std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
Besides, success is its own argument. If you can't understand why Java is so big these days, maybe that's your fault, and not the world's.
How true!
And the same goes for Budweiser, McDonalds, the Ford Escort, and reality TV, as well. Who cares if they are good or anything; they are popular.
Microsoft is to software what Budweiser is to beer.
It's a bit misleading to say that I called Java uncool. I said in Revenge of the Nerds that hackers think Perl and Python and Ruby are cooler than Java, but I'm not claiming that that's how one should decide what language to use.
I dislike Java because (a) it lacks abstractions I need, (b) it is horribly verbose and bureaucratic, and (c) it is another Frankenstein in the C++ tradition of languages created by bolting features from dynamic languages onto a C substrate.
I'm often accused of being a language bigot because I violate the taboo against comparing one language to another. But if you think about it, anyone who works on language design *has* to do that, taboo or no. If you can't compare alternatives, how do you decide what direction to go in?
This is an interesting example, because I think in the real navy, there's a straightforward answer: Sometimes your preparation fails.
In the example you gave, there are *two* points of failure. The first is that you can't find the directory you pointed at, and the second is that you can't get a listing of it. Making those things be separate forces you to consider the failure cases.
A large part of what Java is about is failsafe enterprise-level applications. When you write to that level of safety, you need to identify the different causes of issues.
In the same way, your day-sailer on a 12' boat doesn't shout to his crewmate "Prepare to tack!" because there isn't any reason to. If you're sailing an 80' schooner, however, you do shout to your crew of six "prepare to tack!" And then you wait in case someone shouts back, "Port side winch is jammed!".
-Zipwow
I don't know which is more depressing, that 2/3 didn't care enough to vote, or that 1/2 of those that did are crazy.
Yeah, but YOU didn't write bittorent. A python programmer did.
You could write an AI expert system in javascript if you wanted to. I am not saying one language is better than another for this task or that.
All I am saying is that for people who are "hackers", Java is not as "attractive" as python.
This attraction is the "coolness" factor.
I agree that to build an enterprise-wide web-based data-back-end high availability, fast and robust multi-thousand user application, Java is the better tool.
But "hackers" don't want to develop billing software and reporting engine for banking or healthcare. They want to make things like bittorent, for fun.
And it's the "fun" that makes it "cool".
"Piter, too, is dead."
Is that really true? In many fields there are tools that only experts can use properly. Why should it be different in programming? I think Michael Vanier makes a good point about LFSPs.
I have never seen so much utter nonesense that what I'm seeing posted in this forum today and my karma has been 5 since 1999. I code more in C now than I ever did in Java but clearly you people have no clue what makes a good programming language or how to program. Java is a great programming language. Most of these posts are downright incorrect. And why the opinionated ones get modded Insightful is beyond me.
Certainly not. There's nothing whatsoever new in Java, it inherited every single feature from somewhere else. That in no way makes Java less interesting, since it does a pretty good job of combining a lot of good features in one place -- and being popular enough that you can pretty much count on an implementation being available, too.
Regarding Paul's article, you might notice that I didn't take issue with any part of it other than the idea that the best hackers avoid Java. His clique presumably does, but it's plenty easy to find high power hacks who either are building or have built significant amounts of code using Java.
For that matter, it's been my experience that the best are relatively language agnostic -- writing code in e.g. C, C++, C#, Python, and even -- god help 'em -- Perl. Pick J. Random Hacker and ask 'em what languages they've made significant use of over their career and you'll almost always get a laundry list.
Whatever gets the job done, right? The relative "goodness" of the language has little to do with it, which is easily proven by looking at how much work gets done in C and C++.
jim frost
jimf@frostbytes.com
OK, you lost me when you said that Neither Perl nor C move from platform to platform with the same ease Java allows. I disagree:
1. If we restrict ourselves to Linux, Windows, Mac, then there are GUI toolkits for both Perl and C which are cross platform (for C it's a recompile for each platform). Unless you program in the Metal/Java Look and Feel, Java programs tend to require a bit of tweaking on each platform (and Metal looks like ass).
2. If we do not restrict ourselves to "major" platforms, particularly if we are willing to scrap the GUI, then C becomes the most portable language. Ever programmed in Java on a PA RISC system? Probably not, because nobody has made a JVM for it (although this is dated knowledge).
The only place where Java wins big is in the emerging embedded market, where some companies are making their devices J2ME compatible and not providing a C interface. This market is growing and will likely be more important in the future (it is important to some people now).
Java's "best" is garbage collection, SWT, and Apache. Garbage collection is cool because, as the grandparent said, B coders can't screw up. SWT almost acheives all of the cross platform look and feel objective, at the expense of manual resource management (which is sort of odd in Java). Apache (and IBM) provides some of the most useful libraries and frameworks for developing enterprise applications.
Java's "worst" is installation. I used to think that applets and web start applications were kind of cool, until I noticed that everyone had an old JDK installed on their machine and I wanted to use the latest. If I program an application in Flash, I can redirect the user's browser to require a single click to download the latest player. Users seem to be Ok with this when it is required. For Java, the user is presented with three different things they are supposed to read and click through. Updating Java intimidates some users, just because of the way Sun has tailored the whole experience. Thank god apple updates their JDK through the system updater.
OK, InstallShield almost completely mitigates this problem, but it is still fucked up that Sun hasn't done anything about it.
thanks for reading my long-ass post
you're welcome, thanks for posting it
However, I think you miss a few important concepts in your post.
1) Not all "A coders" are hackers.
- I've worked with the elite programmers that do believe that requirements and documentation are good and that a process produces better results. It seems that these are usually the elite and experienced, but not always.
2) Not all hackers are "A coders".
- "B coders" are hackers too. Seen it too many times. Just like anything else, there are more "B coders" and "C coders" that are hackers than there are "A coders". It is just a fact of life, that there is always an elite FEW, but and abudance of mediocrity. i.e., just because you are a hacker, doesn't mean you're good.
3) Managers are people too.
- There are many "B managers" and an elite few "A managers". And usually, an "A manager" is worth a team of "A coders" to a company.
4) Teams are usually a cross section of the population.
- Rarely are there teams full of code monkeys, or full of "A coders". Here is where a great manager is important. An "A manager" will allow enough room for each person to do what they need to, but ensure that each is able to work with the other. I've been lucky enough to have "A managers", and they make a world of difference to individuals and to projects.
5) Programming languages are just tools.
- Use the best tool for the job. Saying you choose a language based on your ability to do "neat hacks" is idiocracy. If I see someone putting nails into a wall with a screw driver, I think - "Damn, that guy is good with a screw driver", and "what a friggen' idiot".
Reading your post it is obvious that you are either an elitist with a lot of bad experiences, or someone with no experience. Either way, I hope your next manager is an "A manager", you really need some help.
I am living proof of the Peter Principle
This is like saying that C can't be fater than the assembly. In theory it's true: whatever assembly is generated by your C compiler could have been written by you by hand. But in practice, you don't write assembly the same way a compiler does and it is much smarted about optimizing it than you are. So we reach a point where good compilers can generate more efficient code than would any actual human would write if they hand-coded in assembly, even though they theoretically could write equivalent code.
Similarly, a good JIT will in practice be faster than running native C code. We haven't reached that point yet, but we will because the JIT and the runtime are free to do things (like reorganizing memory to reduce paging and to put certain things on the same cache line) that your C compiler can't do since it lets you have access to pointers to arbitrary memory (and lets you pass them around and do whatever you want with them), and because your compiler doesn't have the same information at compile time about how you use the program that the JIT and runtime do, since they get to see what happens at runtime.
I'd rather be lucky than good.
I see job security.
Because none of you have got an eye for the business imperative behind most language decisions: Make your software assets, your hardware assets and your people interchangeable.
Here's how it works. I'm in a mgmt meeting and the SPHB tells me that he thinks it would be reaaaal cool to put the temperature in Cleveland on the "About Us" page so his granddaughter can see how shriveled old gpa's testicles are. So I mention this change to the appropriate product manager and soon enough, resources are queued for that job and it gets passed out to a SNK (snot-nosed kid) for implementation. SNK immediately whines that we need Perl if we're a Java shop, Java if we're a Perl shop or a combination of struts, EJB's, an EJB-.NET bridge and some back-end VisualHappyHappy(TM) if he's had too many Mountain Dews that day.
Like WTF? "The best tool for the job" means crap to me when our software doesn't have to articulate the friggin Space Shuttle. If SNK goes and builds some monstrosity that only he understands, WhoTF am I gonna get to maintain it? If I let the nerds pick their favorite needle-nose pliers for every job, I'd have a whacko menagerie running on six different platforms in one month flat!
Thank you, I will retreat to my cave.
Interesting discussion.
.NET? The structure and goals of .NET look like the best of Java with other stuff thrown in. The point here? It's the marketing dummy.
.NET! And why does that matter? Because without competition the MS machine will assimilate us all!!!
Although this is a site / topic aimed at developers, it seems their are some "big picture" things here being glossed over. IMHO.
For one, someone upstairs said, "different languages for different problems." Hear hear. No one language is great for everything. I can think of three different languages I use for three different problem domains. C for device drivers, perl for system admin functions, (even on Windoze machines), and yes, Java for "big" e-commerce apps.
Java IS an excellent, strongly typed, OO language. When a problem lends itself to a good OO approach, and I'm not required to measure clock ticks for performance, I prefer Java because it makes it easier to do.
On the downside. I've been frustrated in the past with lack of JVM support for various devices. (And too dang busy to write my own!!)
And this brings us to the final "big picture" issue. Have you ever taken a look at Microsoft
We can argue about syntax, tool support, and performance all day. But in the end, one of the key things about Java is, JAVA'S NOT
MS is rapidly advancing to take over everything from the palmtop to the desktop, the set top box, and even your automobile. We need more alternatives that don't wear an MS brand. I would like to see us break out of some of these old, tired issues, and start focusing on what we can do to advance the state-of-the-art in more competitive ways.
because everything requires library calls in java, whether or not that makes sense. want to use a list? use this library. want to use a dictionary? import that library. want to add or delete items from your collection-like data type? do tedious method calls on objects created using those tediously imported libraries.
meanwhile, in sensible languages, i'm trivially iterating over the members returned from the list comprehension i used to eliminate the irrelevant items from my collection. one line, no inherent method calls, perfectly succinct and - in any sensible language - perfectly readable. in java i already gave up long ago, because i had a real problem to solve that didn't involve learning the various APIs of umpteen jillion libraries, no matter how standard. it didn't have to involve butt-ugly syntax using method calls to do what should have been done with operators, either.
creating basic structured data types and assigning them some initial data should be pretty much a one-liner. decent languages have built-in syntax to make this easy, natural, readable and even good-looking. it's a personal litmus test of languages for me; if creating a dictionary and populating it involves jumping through hoops, the language is too low-level and obtuse to bother with.
i've used java. i have also, i will shamefully admit, studied COBOL. it's a toss-up which of the two is more verbose, and if java is any more powerful, it certainly doesn't present its power any more succinctly or aesthetically - java code just seems naturally butt ugly for some weird reason, to an extent that even COBOL doesn't necessarily approach. weird, that last, but true.
- Difficult to do very simple OS specific stuff, like opening an html doc in the default browser.
- Takes a long time to start up the VM. If your program is trivially simple, the overhead dominates over actaully running the program.
- The Swing and AWT mess. It's gotten better, but I think Sun made some fundamental mistakes right at the beginning and they are unable to acknowledge these mistakes and unwilling to start over and do it right. They're a server and OS company. What do you expect.
- It's a lot harder than it should be to call natively compiled code from a Java program. JNI is a pain in the ass compared to other languages.
- EJBs.
Things that don't suck about Java:What really sucks is senseless language flame wars. If you're smart, (I mean really smart, not just self-agrandizing) it's a matter of choosing a good tool for the job. I would say the right tool, but there's often several good choices, as well as not-so-good choices.
It's interesting to note that Perl and Lisp are a lot alike, not so much in the languages themselves, but in their community. Both feature an intensely loyal following of programmers willing to overlook truely bizarre syntax in exchange for the ability to implement some advanced programming language concepts cleanly and consicely. Both languages are similar in their retention of some very strange artifacts of history: cons, car, and cdr, for example, or the parts of perl adopted from shell scripting languages. Some members of both communities tend to be a little too convinced of their own superiority. But, both languages really do have some cool features.
And remember: If Java is to Cobol what Python is to APL and if Perl is to Linux what Visual Basic is to Windows and James Gosling is to Larry Wall what Elvis is to Hank Williams Jr., can you doubt that we were made for each other?
-cbare
That'd be Erlang.
The FA missed the point rather badly, IMO - what makes Java 'uncool' is its lack of support for abstraction. When a programmer finds himself doing the same thing again and again, his first thought is "can I abstract this pattern?". In Java, the answer is all too frequently "no", and the programmer is forced to type in several lines of code to express one conceptual construct.
Sun's big mistake was in not separating the ideas of Java and the JVM more cleanly when marketing it - there are some very cool, hacker-friendly JVM languages (most notably Scala), all of which share Java's virtue of "compile once, run anywhere", but which have got practically no mindshare.
If your solution to avoiding using CLASSPATH is to put everything into the Java extensions folder then you should be claiming that CLASSPATH isn't needed on any platform, because they all have an extensions directory. It is, however, a crap solution. It doesn't allow you to switch between different versions of a library unless you want to keep replacing a symlink. Moreover, unless you do your development in /Library/Java/Extensions (which is _really_ crap) it forces you to cd to the directory into which you compile before running anything.