Java Quote of the Day
So what’s happening? Java 7 is happening. And I encourage you all to go look at that train wreck, because oh my God. Oh, God. I didn’t sleep last night. I’m all wired right now because I looked at Java 7 last night. And it was a mistake.
— Steve Yegge
Posted by Olly on May 12, 2008 at 8:41 am in java, quotations
Comments Off
| Permalink
Peak Java
There’s an unpopular scientific theory in the oil industry that is really popular amongst the unscientific doomsday crowd on the internet. It’s called Peak Oil.
The essence of the theory is that the more oil we find, the more we suck out of the ground every year, and because oil isn’t renewable (not in our lifetime anyway) at some point the amount we suck out starts to decrease rather than increase. But, we are told, this decrease isn’t a period of steady decline where we all start running our SUVs on vegetable oil, it’s exponential which means production will fall rapidly until the amount of energy needed to dig it up is greater than the energy you get from the oil itself. At this point, no one can get hold of any oil which means the world will come to a grinding halt and we all strip to our loincloths, become feral savages and start building wattle and daub huts in the hills. Grrr.
But I digress.
Java developers have had it good for years and right now it’s boom time. It’s top of the heap in the latest popularity index, there are more Java jobs on www.jobserve.com, www.monster.co.uk and www.jobsite.co.uk than any other language and they pay more. Even Universities are teaching it to freshmen*.
Now, here are your typical skills a Java developer needs experience of these days on your average ‘enterprise’ project:
- Java (’core’)
- JMS
- JDBC
- Struts
- JSP/Servlets
- Hibernate
- Spring
- XML/XSLT
- Ant
- Eclipse/IntelliJ
That’s some barrier to entry and it’s getting higher all the time, with the increase in popularity of SOA and Web Services, AJAX, and no doubt several other ‘new’ frameworks and enterprise patterns which I’ve yet to hear about. Here’s a picture:
I think Java-based production is peaking and productivity has long-since peaked — the ratio of satisfaction returned on energy invested is spiralling down.
We have reached Peak Java.
Programmers like being productive. They like new and cutting edge technologies. If I had a fiver for every developer I came across who was learning Python or Ruby on Rails in their spare time, I’d have… thirty quid or something.
There’s change coming. People are talking about it more and more. Java will be around for a long time but the next generation of programmers, today’s hackers who will be tomorrows CTOs, haven’t got time nor the inclination to learn ‘the stack’ — they’re far too busy churning out killer web applications in PHP, Python and Rails.
As for me, I’m running to the Welsh mountains to build a hut and learn to subsist on a diet of grass and rainwater before the oil runs out.
Posted by Olly on January 20, 2007 at 10:39 am in java, jobs, software
Comments (4)
| Permalink
Book Review: Beyond Java by Bruce Tate (in the style of Bruce Tate)
A Glimpse at the Future of Programming Languages
Olly (November 29th, 2006)
★★★★☆
product
I read this book whilst kayaking down some level five mountain rapids. It was the first time I’d read it so I didn’t know what to expect. The sky was an ominous grey, there was an evil-looking rodent with a stripy tail staring at me but I felt prepared. I had read something similar before.
Java is a great language - the most successful ever. Remember when we were all C++ programmers? We had to navigate the treacherous waters of pointer arithmetic, header files, strings and it was a tough ride! Java came along like a breath of fresh air. The virtual machine, portability, Servlets: programming for the web was hip and easy!
It was going so swell on the rapids that we didn’t see the danger ahead. I hit a rock and dropped my book in the water - it was heading headlong for the waterfall. Now we had some real problems. I dived in after it but my prospects were not good. Mountain rescue eventually found the book and after three weeks in intensive care I stumped up the courage to pick it up and carry on.
I have a strong instinct for danger on the rapids and I’ve cultivated it to sniff out unhip programming languages. Several years on and Java is the enterprise king, with a royally bloated middleware to match. It has a room full of unfinished frameworks and XML hangs off them like cobwebs in my old attic. This one hasn’t aged gracefully.
Java was based on C++ which helped attract people to it in the first place, but boy did it pick up some bad habits. Primitives were an awkward mistake, static typing an unnecessary burden and as for Generics, well they fell out of the ugly tree when they were hit with the ugly stick.
What the world needs a new programming language. The Next Big Thing. A language that can match Java’s database/enterprise integration and friendliness, and have a killer application, and do all this with less bloat. And it must have dynamic typing, closures and continuations. Have you heard of Ruby?
I knew it was dangerous and every bone in my body fought against it, but I decided to read the second half of the book on my mountain bike, whilst travelling at breakneck speed down a 50% cliff face. Learning this kind of trick would take a while.
Like reading on a bike, metaprogramming feels unnatural. Want to see metaprogramming in action? Then check out Ruby on Rails. It’s much more productive than Java. In fact, I spent several weeks working on a system for a client in Java and rewrote it in four nights in Ruby! I took me a while to calm the client down but he came round in the end. Rails is so productive, and so much fun, but I’m not going to be drawn on whether it’s a Java killer despite the fact that I clearly think it is.
I almost forgot but there are other contenders. Poor old Smalltalk has Seaside going for it at least, Python is pretty cool but I just don’t dig it as much as Ruby. .NET is, well, .NET and Perl and Lisp will stay consigned to hackers and academics. Heck, you know, I’m not sure there actually is going to be a Java killer but you Java guys should watch out. Get outside, try something new and don’t go getting complacent. You do remember what happened to COBOL don’t you?
With apologies to Bruce Tate
Posted by Olly on November 29, 2006 at 10:45 pm in books, java, reviews
Comments (1)
| Permalink
Optimising JUnit performance in Ant
Ever been in the situation where your unit tests are running really slowly with Ant from the command line but run like lightening in your IDE? Usually tests which are persisting to a database?
I’ve recently had this problem and I managed to solve it by not forking the batchtest task, and instead forking the junit target and setting the forkmode attribute to once, like so:
<junit printsummary="true" fork="yes" forkmode="once">
<batchtest todir="${tmp}">
</batchtest>
</junit>
Posted by Olly on June 20, 2006 at 8:46 am in ant, java, software
Comments Off
| Permalink
The keyboard is your friend
Over the past four years I’ve spent a lot of time using Eclipse for Java development. I used to use JBuilder but thankfully I’ve managed to overcome that episode of mental torture with no lasting problems.
I’d go as far as to say I know Eclipse better than the back of my hand (which, now I think about it, I don’t know that well at all). It takes a lot of mouse clicks to do some basic things in Eclipse, so learning its keyboard shortcuts is one of the most productive things you can do.
So, for your coding pleasure, and in most-useful-first order, here are the ones I use most often on Windows*:
| Save |
Ctrl-S |
| Context-assist |
Ctrl-Space |
| Open Declaration |
F3 |
| Delete current line in active editor |
Ctrl-D |
| Find/Replace |
Ctrl-F |
| Find next occurance of selected text |
Ctrl-K |
| Comment/uncomment selected line using // |
Ctrl-/ |
| Open Type (class, interface, enum etc) |
Ctrl-Shift-T |
| Show Type Hierarchy |
Ctrl-T |
| Display drop-down list of editor windows |
Ctrl-E |
| Rename in file |
Ctrl-2, R |
| Rename Type |
Alt-Shift-R |
| Open Resource (xml, csv etc) |
Ctrl-Shift-R |
| Organise Imports |
Ctrl-Shift-O |
| Show Class Outline |
Ctrl-O |
| Close Active Window |
Ctrl-W |
| Format |
Ctrl-Shift-F |
| New |
Ctrl-N |
| Maximize/minimize active window |
Ctrl-M |
| Show quick fix |
Ctrl-1 |
| Switch View |
Ctrl-F7 |
| Switch Perspective |
Ctrl-F8 |
| Go To Line |
Ctrl-L |
| Activate Editor |
F12 |
| Select All in active editor |
Ctrl-A |
| Comment selected line using /* comments |
Ctrl-Shift-/ |
| Display all this (and then some) in Eclipse! |
Ctrl-Shift-L |
One other thing. By default, Eclipse uses Ctrl-F6 (and Ctrl-Shift-F6) to switch between editor windows. I don’t know about you, but I don’t have E.T. fingers so I find this hard to do with one hand. Instead, I always modify the mapping (Window / Preferences… / General / Keys - sheesh!) to Ctrl-Tab.
If you’re keen, feel free to download a handy PDF to print out and stick on your monitor.
Posted by Olly on May 31, 2006 at 7:07 pm in java
Comments (2)
| Permalink