Java is dead, but you'll learn to love it
muckandbrass.com
muckandbrass.com
I feel like I am being drawn back to the JVM after pushing it away for so long. It really is an impressive system.
The Java one would probably still win, but an easy two lines may bring them closer to parity.
Like I said, overkill, but it could be worth it.
I say this being in the same boat: coming from the JVM to Python and looking back at some of the things I'm missing.
The advantage with using the JVM is that you get a lot of libraries for free, which may be worth coping with a Java-centric design.
For instance, for java 7 there is supposed to be support for dynamic languages.
I've been running M4 on a Debian box for awhile now, and it's surprisingly stable for an 'in-development' product.
As soon as it hits the mainstream and people have been testing the hell out of it we'll surely follow though. Second best is good enough for production.
Clojure will have it's turn. Things like tail recursion are already on the radar. Check out the Da Vinci Machine project for details.
Incidentally, that other 'dead' language (Latin) is still very much in use, precisely because it is dead. Being 'dead' (as in no longer under aggressive development) can actually be an advantage. Plenty of branches of industry prefer stability over sexiness any day.
I'm not saying that Java (or Latin, for that matter) doesn't have a place in the future, but I just hope that it doesn't continue to have undue influence on the evolution of programming language and methodologies simply because it is a revered institution.
I would tweak that to "... programming language and methodologies accepted by the mainstream...". Java is already not stopping many very different streams of development from existing at all, but the question is whether anything that isn't Algol-derived can be the next big mainstream language. That syntax is really starting to creak under the load of all the stuff that even C# loads onto it, and the Next Big Enterprise Language really needs to not be that way. (I make no claims as to what it should actually be, though.)
I guess the rest of us will just continue along doing what we do with whatever tool we need for the job.
But I'm afraid they want something different.
IMO there's a big difference: A Java IDE like Eclipse probably writes half of the lines of source code for me - the tedious bits that are simply structure/sugar. PHP/Python guys write every single one in vim/e-macs. Perhaps "unnecessary boiler-plate" Java code gets in the way, but yet my IDE hides most of that for me automatically. And most importantly, when I do want to edit that getter - it's right there in my source code for me already.
I believe IDEs and compilers should become more powerful, rather than the languages, because you often want to drop down a level of abstraction to improve things.
For the record I use java, c#, php, python, etc.
If the programmer does not need to write the code, it has no business being in the source code. Nobody wants to find all their slightly-modified boilerplate and modify it because the boilerplate generator had a bug. Sane programmers will fix the bug in one place, upgrade the library, and be done with it.
The less code to maintain, the better. The less repeated code, the better. This is what many programmers strive for, and why they eschew "my IDE will write it" in favor of more powerful abstractions.
Relying on your IDE is like using a shopping cart to carry around a portable generator, tower CPU, and CRT monitor instead of carrying a laptop. It's pretty easy to push around that shopping cart, right, so why bother with a laptop? The laptop doesn't have a 21" screen, after all, so it seems like a total waste of money compared to the shopping-cart-and-50"-TV.
But he specifically said that this breaks down when you need to pierce the abstraction and he's right. You can often accomplish the same thing by doing the "non-abstracted" code in a lower level language and linking to it, but that's not always convenient or safe.
I'm of two minds on this topic. I like the "smarts" of a good IDE that hides stuff that I don't care about. But at the same time, I'm afraid that if it breaks (bug in the IDE or library), I don't have the ability to find the broken part and fix it or work around the problem. This was exactly how I felt when I started playing with WCF.
Take python: I don't have to write getters and setters, but if I need to tinker around "inside" one, I simply write a function and decorate it with @property. But that code is only present if I need to create an exception to the general case, rather than having everything, including the common cases, present in source and hidden by the IDE.
Edit: Check out Project Lombok (http://projectlombok.org/), which tries to address some of these issues for Java (including the exceptional case, rather than hiding the general case). We discussed it a two months ago at http://news.ycombinator.com/item?id=738958
In Perl, we can even compose meta-roles into metaclasses; meaning that even tiny changes can be made easily reusable.
This is generally preferable to editing code in an IDE.
List<String> userNames = new ArrayList<String>(); for(User user : users) { userNames.add(user.getName()); }
is not just more verbose but also reveals the programmers intentions less than something like:
var userNames = userList.map(\u -> u.Name)
Java programs often devolve into a lot of for loops, which all kind of look the same regardless of what you're doing, and you have to read pretty closely. It's nice to replace a bunch of loops with explicit methods like "map" or "find" or "reduce" or "each" or other things that explicitly declare the intent of the programmer.
I write a lot of Java, and we also have an in-house Java-like language built on the JVM (that we're working to open source), and we added closures to it in order to gain those sorts of benefits. Even though IDEA or Eclipse can write my for loops for me, it can't read them for me.
There's no technical reason why you can't have a statically-typed language with excellent tools that isn't unnecessarily verbose: all you really need to add are type inference, closures/first-class functions, and properties, and a little bit of metaprogrammability (instead of code generation) is also both feasible and helpful.
List<String> userNames = users[@name]
Just showing the line in a different colour could mean it's "summarized". Clicking on it could reveal the complete loop and allow you to modify it. But common idioms such as map/find/reduce/each can be summarized.
I accept that things like Eclipse are essential to write Java but I still have to read vastly more code.
There are many other things that an IDE could do beyond validating my code, function arguments, giving me hints, auto-completing variable names, code-blocks, etc. All those things make Java & C# much more productive than people think. The worst bit is actually dealing with libraries, whereas with Python/PHP much more stuff is built-in.
But still, GWT, Guice and Grails are pretty active and relevant projects. Even if you don't plan to use them (I don't), it's pretty hard to see a language as "dead" when the community still draws this level of talent and innovation.
Mirror anyone?
... I really hope I'm not becoming one of those really old dinosaurs who refuse to learn anything new. ;)
You've recognized PHP's shortcomings, but you haven't switched to a language with solutions to those problems.
By the way, specifically PHP isn't important here; the question is really "Do you only know one language?"
All-in-all it's plenty fine when I see people writing off PHP devs, in my case, it's mutual. I don't write off ASP devs just because I think ASP is restrictive to my style of programming. There are "better" tools for the job, but often the claim that something is the wrong tool is rooted in... well.. yeah, I'll stop there.
(And I am not even sure about Fortran.)
It's a thrown together mess.
Oh wait, none of those.
(And I say this as someone who thinks Java is the second-worst programming language available today.)