Bernd's Memory Leaks

Java is still the best language for the majority of enterprises. Because it's boring enough.

posted: 2010-10-14 21:19
filed under: Java

Over the last couple of days vocal statements have been made about how the Java is a bad choice (Paul's being the most interesting).

I'd like to add another perspective on this topic, beyond what I'm saying in my latest installment of the Flinke Feder column in german Javamagazin which will be published in the 2010.12 issue and has been put online early because it fits pretty good with this week's news.

My statement here is that building on the Java platform is the best choice an established company can make today. Here's why:

The iceberg

Customer facing code is just the tip of the iceberg. Below the surface, often there are countless front/middle/backoffice systems running. There are massive IT infrastructures out there and related investments done in all sorts of businesses. This is money already spent. Billions. This software often is driving business (or even is business-critical), and their UIs are not the most important (yet often neglected) part of them. The business logic is the tricky part, and nifty language features are unimportant. Many other factors, however, are leading to Java. Just keep in mind that most middle- to-large-sized companies producing software are not in business of actually selling software.

Armies of Developers

If you've got a flock of dozens or hundreds of developers, you need to use a platform which is accessible, comprehensible and widely known. Your staff has to be able to concentrate on the business logic as far as possible. It's impossible for enterprises (except the very few) to hire only rockstar developers. By definition, exceptionally good programmers are rare. Banks, Telcos, web agencies, manufacturers tend to hire developers which have knowledge in their respective business domain. Startups, Google, Facebook and Fog Creek are a tiny, tiny fraction of the job market. The large part are average performing developers (like me *grin*) which need to be able to get the job done nevertheless. In these kinds of working environments, developers come and go, are reassigned or work on different projects in parallel. Project maintenance is transitioned between teams, internally or from builder to customer. Projects are completed and after weeks, month or years are revisited. The only constant (should I say static?) is Java. Most developers don't pick up a new computer language every year. They rather pick up their children and have a good time with their family, and by the way are happy to have a job they get done.

Freight containers

Most projects I see are developed on Windows workstations and deployed on Unix systems. JARs and WARs are the freight containers of software development.

Toolset

The rise of Java happened at the same time as the rise of open source. Companies are happy to take and use open source. It lowers development costs and lets people concentrate on the business aspects. The JDK offers a phenomenal integrated toolset. Java is supported by exceptional integrated development environments like Eclipse (or IntelliJ as far as I am concerned) which make it easy to navigate large code bases. There are tons of libraries out there.

Aversion to upgrade/Long-time consistency

People critize Java for being behind in evolution of language features. Now, if you look at how companies are adopting new versions of Java in their projects, Java is actually moving really quick. I'm still seeing projects running Java 1.4, simply because upgrading them to a more recent version is not a business case. SAP even pays Oracle to receive support for Java 1.4 until 2017! However, as soon as there is a business need, e.g. because you need to extend an application, upgrading the JDK is a no brainer. (Ruby, anyone?) The Java platform has never (or very rarely) seen changes introducing incompabilities. Enterprises love that.

Strict type checking/Relational DBs/Error handling

Bugs in software are very costly and hard to predict in project planning. So companies want to reduce the possibility of the average developer to introduce a bug. The compiler should be able to find as many potential bugs as possible. Java has strict type checking. RDBs have it, too. This goes together well. Whatever you think of checked exceptions, it's a fact that Java does not make it easy for developers to forego exception handling. Duck typing and monkey patching are powerful means when you have a code base you can control. Potential conflicting sub-projects and wide-spread dependencies just happen in large code bases. They should not go unnoticed.

Counting it all together, you might get frustrated

All these factors multiplied make Java the least-risky choice for companies today. I'm not trying to justify that. It's just a matter of fact. Try your bigCo to use Lisp for shorter, more elegant code. Or Ruby for more readable code. Or Erlang for better scalability. Or Python for less curly braces and punctuation. Or Javascript for prototype objects. I really hear you. We all are convinced of our own preferred weapon of choice. But in a complex corporate environment, each individual programmer's choice is potentially in conflict with what works for the company as a whole. So don't be surprised if you end up coding Java, again. It's ok.

Careless Whisper, part 3: Released!

posted: 2010-04-02 23:14
filed under: Vysper | MUC | XMPP | PubSub

Apache Vysper was started on my ICE commuter rides between Zürich, Freiburg and Frankfurt in late 2005. That was my way of learning the XMPP RFCs 3920 + 3921. Meanwhile, Vysper undertook it's own journey from a private SVN through Apache Labs to Apache MINA's sandbox. It very much looks like the final move to MINA proper is just about to happen.

Many days came and went without me working on the code, but everytime I came back, it was fun and felt like coming home.

Niklas (from MINA/FTPServer fame, now an ASF member) added Multi User Chat, worked on infrastructure and pushed to a release. Last GSoC-summer, Michael added Publish-Subscribe.

Recently, over 4 years after the first line of code was written, Vysper 0.5 was released. Far from perfect, but working. Not production ready, although some more adventurous type of people seem to use it for more serious stuff.

It's pretty classical to use: run mvn install, cd dist/target, unpackage vysper-0.5-bin.zip, cd bin/, execute the run.* script of your choice. Server starts. There are three initial users: user1@vysper.org (...user3@vysper.org) all with passwords "password1", but this can be changed easily. You can use the Jabber client of your choice to connect, but make sure you configure the account to connect to "localhost" or the concrete host where Vysper is running.

Careless Whisper, part 2: Habemus muc!

posted: 2009-09-04 12:23
filed under: Vysper | MUC | XMPP | IRC

Jabber chat rooms have some advantages over IRC, like a more fine-grained participant control and other details. One advantage is that participants are identified from their jabber id, so there are virtually no 'ghost' participants and it's easy to have a private conference.

In the Jabber world, chat rooms are called 'multi-user chat' or 'MUC' for short. Vysper's MUC implementation has reached a critical milestone: users can create a room and chat with each other. Not everything is yet fully working.

Trying yourself is pretty easy if you have your Java5, Maven2 and svn ready:

  1. svn co http://svn.apache.org/repos/asf/mina/sandbox/vysper/trunk vysper
  2. cd vysper
  3. mvn install -Dmaven.test.skip
  4. cd server; cd extensions; cd xep0045-muc
  5. mvn assembly:assembly -DdescriptorId=jar-with-dependencies -Dmaven.test.skip
  6. cd ..; cd ..
  7. java -classpath src/main/config/:src/main/resources:../extensions/xep0045-muc/target/xep0045-m1.0.0-SNAPSHOT-jar-with-dependencies.jar -Dvysper.add.module=org.apache.vysper.xmpp.modules.extension.xep0045_muc.MUCModule org.apache.vysper.xmpp.server.ServerMain

Windows users, please change '/' into '\' for 7.

Log into the server as "user1@vysper.org" or "user2@...", both have the identical password 'password1' and make sure you set the server/host configuration to 'localhost'.

The chat can be found under 'Service Discovery' or 'Services', depending on your client.

As a client, I recommend Psi, but others work, too. However, I didn't get Apple's iChat to log into Vysper yet.

Know IDEA, part 2: CSS editing

posted: 2009-08-21 10:17
filed under: Intellij | IDEA | IDE | CSS

Ask the web programmer of your choice about a good IDE for developing CSS, HTML and JS. Most of them will recommend a simple text editor or a tool which is Windows only and not developed for at least 5 years...

Thankfully, I'm not a web programmer, but from time to time, I have my own little share in editing web frontend code. But I don't know CSS by heart. IDEA supports me with auto-complete in CSS files. It marks styles which are used nowhere in HTML.

It even displays a little colored box besides codes like "#628c78". Isn't that a beautiful color? Maybe not. Klick on the box and choose another one. Nice.

Now go to an HTML file, enter... <a class=" ...and invoke auto-complete. Now IDEA shows you a list with all defined CSS styles. Hitting Command-B on a class name brings you directly from HTML to the CSS declaration. That's the 'Integrated' in 'IDE'.

© 2002-2010 bernd fondermann brainlounge, contact/legal notice