Posts Tagged ‘Java’

Tools, again

Wednesday, May 21st, 2008

Computer Swedens developer columnist Tobias Fjälling the other day answered the question “What should a good development environment include?”. (MÃ¥sten i en bra utvecklingsmiljö – Computer Sweden).

Tobias list:

  1. Auto-complete
  2. Refactoring
  3. Navigationsupport
  4. Extendability
  5. Speed
  6. Debugger
  7. Code templates

I find this to be spot on what Ola wrote about the other day which I already quoted:

It’s interesting, many Java programmers talk so much about tools, but they never seem to think about their language as a tool.

Tobias seems to be a good guy, I am giving him the benefit of the doubt and assume that he forgot.

The Programming Language Is Your Most Powerful Tool

Thursday, May 15th, 2008

Ola is so spot on with this one:

A New Hope: Polyglotism: “The one thing that I am totally sure if is that we need better tools. And the most important tool in my book is the language. It’s interesting, many Java programmers talk so much about tools, but they never seem to think about their language as a tool. For me, the language is what shapes my thinking, and thus it’s definitely much more important than which editor I’m using.”

I do not know how many discussions I have had with Java developers who questions Ruby et al. because there are no IDE’s with the same feature sets as those found in Java.

(Via Ola Bini on Java, Lisp, Ruby and AI)

The Good Pragmatic Developers

Tuesday, May 13th, 2008

Java in 2008: “These are people who aren’t religious and aren’t close-minded and just want to Get Shit Done. Oh, and they’ve already got a lot of it done and they aren’t interested in discarding that investment.”

(Via ongoing)

Things I Have Actually Used

Monday, March 31st, 2008

Robby Russell is a constant source of information on Ruby and Rails, I have used his instruction on how to set up Rails and PostgreSQL on Mac a number of times. It is therefore fun to see that I have actually used 3 out of the 5 things he wants to know more about::

RSpec User Stories

We were very early adopters of this one, we started using it the same day it hit trunk in a useable form. Everyone should start using it today – I cannot speak highly enough of it. The only thing I miss is a Fit-style table approach to rules, but I have my own thoughts about that one.

Using Selenium with RSpec

We have used the now outdated spec/ui library at WeMind. Today we use RSpec Stories almost exclusively for acceptance testing. My position is to use Selenium only where you really need it, for example to test Javascript functionality.

JQuery

I have used it for the dynamic hiding of speaker info for Agila Sverige. Not at all enough to judge a library by, but it feels a lot sweeter than Prototype/RJS.

JSSpec (BDD for Javascript)

Yeah, I wanna know more about this as well.

Using the Google Charts API with Rails

Same here.

Other than that I would love to try out:

  • Seaside – I have dabbled with it but nothing worth mentioning.
  • CouchDB

Java vs the JVM

Friday, February 1st, 2008

Tim Bray on the JVM being the good part of Java:

“But the Java language just doesn’t seem like the interesting thing about Java, these days.”

I wish more Java programmers would agree to this. One of my observations at JFokus the other day was that a lot of people really like Java the language, and are going through hoops to implement their ideas in it.

Stephan Janssen has created a kick ass new version of parleys.com in Flex/Air, but he wants to redo it all in JavaFX script, just so that it is Java. Rickard Öbergs new framework for composite oriented programming could be useful, but in my opinion it introduces enough new concepts to qualify for a whole new language. Lipsticking on top of Java makes it feel verbose and clumsy. After a year of Ruby I have very little patience for Java interfaces.

(Via ongoing)

Jonathan Schwartz says Sun will continue to support PostgreSQL

Sunday, January 20th, 2008

My suspicion that Sun will not continue to support PostgreSQL after purchasing MySQL was unfounded:

From Jonathan Schwartz blog::

What happens to your commitment to PostgreSQL?

It grows. The day before we announced the acquisition, and within an hour of signing the deal, I put a call into Josh Berkus, who leads our work with Postgres inside of Sun. I wanted to be as clear as I could: this transaction increases our investment in open source, and in open source databases. And increases our commitment to Postgres – and the database industry broadly. The same goes for our work with Apache Derby, and our JavaDB.

Awesome.

Update: Josh Berkus says the the same thing

Groovy and Ruby

Thursday, January 17th, 2008

I cannot help myself from making a small comment on Rick Hightowers post on Groovy vs JRuby. In short he thinks Sun should support Groovy instead og JRuby, because the syntax is familiar to Java programmers.

To support his case he presents a chart showing language popularity according to job postings. And since Ruby is at the bottom and Java is on the top, Sun should support Groovy. Which by the way is not even on the chart.

One thing I did recognize was this:

Comment on Rick Hightowers Groovy post

Notice that between Java and Ruby/Python there is a wasteland of languages that you will not see running on the JVM in any near future. So if Sun wants to expand the developer base for the JVM (not Java the language), I believe they are making a very wise decision to support the largest languages available to them outside of Java.

Supporting Groovy would probably be popular among the already converted, but Sun has to appeal to new markets to expand the JVM usage. I believe that is what they are doing.

Ola Bini: JtestR 0.1 released

Sunday, December 30th, 2007

Ola has released JtestR 0.1. It seems to b a great tool for those doing Java development. I can personally not imagine doing any development these days without RSpec.

Agile Sweden 2008

Sunday, December 30th, 2007

After reading Aslaks post on his upcoming conferences it is obvious to me that Stockholm is sorely lacking in the conference space.

Aslak mentions RubyFools in Copenhagen and Oslo, and Smidig 2008 in Oslo. RubyFools seems to be great, and I know that Smidig was awesome in 2007.

The only conference I can think of in Stockholm is JFokus, which I hear is very good but Java only. Looking to the whole of Sweden we have Øredev which I always has found too unfocused, and Expo-C which I cannot tell if they exist anymore.

I guess I have no right complaining if I am not prepared to do anything about it. So, after Smidig 2007 in Oslo, we have had talks within the Agile Sweden network about running a similar conference in Stockholm this spring. And while this is no announcement by any means, I am putting pressure on myself to actually contribute to make it happen by speaking openly about it.

Look out for Agile Sweden 2008 this spring.

Choice Is Good

Thursday, December 13th, 2007

I was happy to note that Dion Almaer commented on my blog post on Merb. Dion is one of my favorite bloggers/podcasters and I value what he writes highly.

But I disagree with him on this one. The problem with using Java for web application development was never one of too much choice. In fact, it was because of that choice that Java became a player in the server side market at all. Sun alone never had the answer to what was needed for server side development, instead the open source world stepped in and made incremental corrections.

The same thing is happening to the Rails world. The core team cannot create a framework that is a one-size-fits-all. The initial Rails proposal is great for a large number of webapps, but it is other things around it like plugins and JRuby that is making Rails a viable choice for all.

My Java tools of choice was usually Tomcat/Jetty, FreeMarker, iBatis, WebWork tied together with Spring or PicoContainer. What I hated was having some frankensteinian-enterprise-architect-design-by-comittee-lets-not-be-different stack forced upon me with a fullblown J2EE server, EJB’s, Struts or the JSF monster, sprinkled with an Eclipse-only development environment. And I hope dearly that Rails development is not going the same way where people question you on your choice of tools and wonder why you are not using MySQL and TextMate like the rest.

There is one choice that I do not miss though – directory layout. I am truly happy every time I do not have to choose it.

Instead of not having to choose, the most important difference I’ve experienced is that Java as a language together with the Servlet/J2EE spec induces a lot of accidental complexity, which is almost non-existent in the Ruby/Rails world. It is that which enables the increased velocity many development teams experience when switching to Ruby.

Google Says JavaScript Is A Language For Non-Programmers

Monday, December 10th, 2007

They actually do say that, here in Sweden. In a brochure handed out at SIME07, Google provides a little glossary for the technically challenged, and to my amusement JavaScript is described as follows:

JavaScript – scripting language for those who are not programmers, in first hand intended for creating web pages.

The translation is mine. The original text in Swedish: “JavaScript – skriptsprÃ¥k för de som inte är programmerare, som i första hand är avsett för att skapa webbsidor”

This is of course a mistake, and my guess is that mistakes like these are inevitable if you have local offices like the one is Stockholm without technical knowledge. I find it funny, but I wonder if Sergey and Larry would laugh if they were to find out?

Merb, Leaner And Meaner Than Rails

Saturday, December 8th, 2007

I have used Rails on a daily basis for almost a year now, and before that I was a night time hangaround. While I am definitely a happier programmer using Rails than anything built on Java, I still feel that it can get better.

First of all I want more things to be plugins. And really, they should not be plugins at all but gems instead.

Why plugins? We use RSpec instead of Test/Unit, HAML instead of erb and are seriously looking into JQuery instead of Prototype. And of course, we are using Mercurial instead of Subversion. All of this is of course possible to use in Rails, but a lot of things are sort of made for the default choice, such as generators generating tests, and plugins having the -x switch for Subversion. And I am pretty sure that this is the way DHH wants it.

So, when 2.0 is now released, I see that the Rails community as a whole does not see the same problems as I do. If they did, they would have done more like the stuff above, instead of sexy migrations and ActiveResource.

This is where Merb becomes really interesting. I have looked at it before not understanding its value, but now I see a framework that does everything I want Rails to do. Gems as plugins and very agnostic about templating languages, Javascript frameworks and even ORM frameworks – almost a heresy in Rails. I will definitely think about using it instead of Rails in the future.

Distributed Version Control

Wednesday, October 17th, 2007

I just read this article on distributed version control by Ben Collins-Sussman who is a lead developer behind Subversion. If I understand his arguments, he basically says that DVCS is better than centralized VCS, but you probably should not use one since 80% of all developers are too dumbfounded too understand VCS at all.

I am one of the pretentious, self-righteous and obnoxious fanboys of DVCS. And let me tell you this: the difference between using DVCS and Subversion is on par with the difference in programming in Ruby compared to Java. If you have made the switch you just do not want to go back.

And finally: We have taught our GUI-guy Martin to use Mercurial. He has limited experience of using VCS’s, but he grasps the difference between commit and push. My face is straight saying this.

Delphi and JBuilder as role models for Rails development?

Thursday, September 20th, 2007

Chatting over a beer with Ola Bini last year, we discussed the possibilities for JRuby. My dream was to run a Ruby IDE on top of JRuby to get a Smalltalk like environment, because Smalltalk is still the best programming environment I have ever used.

Now that 3rdRail, running on JRuby, is released, should I get my hopes up? Some people are actually very excited about it, but when Delphi and JBuilder are referred to as some sort of pinnacle of development it seriously makes me wonder.

Where is IBM in Rails?

Thursday, September 20th, 2007

I have absolutely no clue as to why David Heinemeier Hanson would hold any suspicious thoughts toward Sun. To me, given the big boys in the playground, they are the good guys. But reading it made me realize that I have not heard of IBM in a very, very long time.

Big Blue was quite quick to join the Java bandwagon, remember VisualAge for Java? But in the new world of dynamic languages IBM, apart from a few developerWorks articles, is not to be heard from.

And this from a company who once was a strong proponent of Smalltalk? In my mind, if there is a mystery man, he and his cat is sitting in an IBM campus somewhere.

Gourmet Web Hosting

Thursday, February 22nd, 2007

I am trawling for a hosting company and came across this gem of a web page:

Gourmet Web Host

The page won’t load at all if Javascript is disabled, has no doctype, won’t render umlauts in Firefox on Mac (and this is Sweden, we actually use them.)

The final nail in the coffin is that it states “Web hosting for gourmets”.

Javaforum in Stockholm Wrap Up

Wednesday, November 22nd, 2006

I spent yesterday evening at Javaforum. Ola Bini held a great presentation of JRuby that really showed what can be accomplished today and what we can expect in the future.

Ola is not only an über hacker, he is a great guy too. When asked what work is done with Ruby in Sweden today, he was kind enough to mention the work we’ve done at Valtech with Rails, which of course got him a well deserved beer later.

The guys from Interface 21 did a so-so job presenting Spring AOP. I might be biased as I have been in AOP-land and left it, but in my opinion their presentation skills were far better than the actual content.

During after-beer Ola and I discussed the state of Java and agreed that the greatest part of the Java platform is the JVM. It will most probably survive Java the language and be a platform for a multitude of languages. It was therefore funny to read Mike Bowlers blog post today about exactly the same thing.

All in all a good evening.

Java is the new C

Sunday, October 22nd, 2006

This could actually turn out to be quite important down the road:

Writing Solaris Device Drivers in Java: “‘We present an experimental implementation of the Java Virtual Machine that runs inside the kernel of the Solaris operating system. The implementation was done by porting an existing small, portable JVM, Squawk, into the Solaris kernel. Our first application of this system is to allow device drivers to be written in Java. A simple device driver was ported from C to Java. Characteristics of the Java device driver and our device driver interface are described.’”

(Via OSNews.)

Kent Beck on Ruby

Wednesday, August 9th, 2006
Kent Beck on Ruby: “
I always knew one day Smalltalk would replace Java. I just didn’t know it would be called Ruby.
– Kent Beck

Blaine Buxton links to this quote at ozmmdotorg.”

(Via Mike Bowler’s thoughts.)

Cedric Still Doesn’t Get Agile

Friday, June 9th, 2006

Update: Martin Fowler pointed to . It seems Cedric did not give us the full picture. I have edited my post accordingly

After attending a less than stellar presentation on TDD, Cedric Beust confuses TDD with “Agile” and goes on to tell the world that agile is not good. Let’s have a look, shall we?

First of all, tests are not specs.  Not even close.  Somebody in the audience was quick to give a counter-example to this absurd claim by using a numeric example (’how do you specify an exponentiation function with a test?’)

I would not use unit tests for specs. Automatic acceptance tests on the other hand is really nice if you have a customer/product owner that will work with you. Now Cedric has previously stated that he does not really care for the labelling of tests (“However, when I write a test, I don’t really care if it’s a unit test or a functional test”) so that of course makes it harder for him.

And hey, testing an exponentiation function? How about providing test data with given parameters and answers? It would be a prime candidate for a FIT-test by the way.

Relying on tests as a design specification is lazy and unprofessional because you are only testing a very small portion of the solution space of your application (and of course, your tests can have bugs). 

Why would you only test “a very small portion of the solution space of your application”?

Tests also fall extremely short of having the expressiveness needed to articulate the subtle shades that a real specification need to cover to be effective.

This is my main gripe with Cedrics rant. He seems to be completely oblivious to the great emphasis on customer interaction that agile methods make, which promotes a two way dialogue.

A specification written in a document is a one way communication. Even in high school psychology I learned how much more information was conveyed in a spoken dialogue than in writing.

This claim is part of a broader and more disturbing general Agilist attitude that is usually articulated like ‘Your code is your spec’, along with some of its ridiculous corollaries such as ‘Documentation gets out of date, code never does’.

What is so ridiculous with the last statement? I have never been involved in a large scale project where the documentation did not get out date.

As for the code being your spec: when you have code and documentation, and the latter does not correctly describe the former, it is out of date, which will you trust? And what do you read to know what the real world looks like? Map, meet terrain.

I am currently getting acquainted with a brand new project that is not even very big, and while I understand Java fairly well, there is no doubt in my mind that for ten minutes I spend trying to understand how a certain part of the application works, a five-line comment would have given me this knowledge in ten seconds.

Sure, if it is up to date, which you will have to read the code to find out. My general rule: if you feel the need, comment on why the code does what it does if it is not obvious. If you feel the need to comment on what the code does, the code is not clear enough. Refactor until done.

Very often, Agilists simply forget that their job is to produce software that satisfies customers, not software that meets some golden software engineering scale.

Again, this is simply ridiculous – all agile methods try to get customers as close as possible to produce just what they want. Anyone even remotely knowledgeable with agile methods knows that.

Frankly, it takes all of ten minutes to explain Test-Driven Development to a developer who’s never heard of it:  ‘Write a test that fails and doesn’t compile.  Make it compile.  Then make it pass.  Repeat’.

I actually find it quite hard to get developers to grasp TDD; people find testing something that does not exist confusing. This is of course the basis for behavior driven development, but let’s just be happy for Cedric now.

Some might find it picky, but leaving out ‘refactor’ in the TDD loop tells me that you somehow has not grasped the concept completely. But then Cedric might throw in a comment instead :) .

‘What should we test now?’ ‘How about:  if we pop an empty stack, we get an exception’ ‘Mmh, no, let’s not do that’

This is quite easy to test, so I do not see why he could not add it. Read Jeffs answer

Stack s = new Stack();
try {
  s.pop();
  fail("Should not get here");
}
catch (Exception e){
  //Ignore
}

But I am dead sure Cedric knows this , too bad the presenter did not.

To be honest, I am becoming quite suspicious of Agile practices for that reason:  all the presentations I have attended and books that I have read are always using toy implementations as examples.  Stack, List, Money, Bowling…  enough already!

Ignoring the fact that Cedric again confuses TDD and agile, he does have a point. Too many TDD presentations uses examples that are way too simplistic. They should point out the need of a modular architecture, and the fact that using TDD actually helps you get a clean, high cohesion – low coupling architecture.

And please, avoid smug and useless answers such as: ‘A lot of the classes I have to test are hard to isolate, do you have any advice regarding mocks?’ ‘Well, if you had started with TDD in the first place, you wouldn’t be having this problem today’.

It is certainly not a helpful answer, but it is true nonetheless.

Fundamentally, I am disturbed by the Agilists’ dishonesty when it comes to presenting their arguments.  They offer you all these nice ideas such as Test-Driven Development and Pair Programming but they never — ever — disclose the risks and the downsides.  To them, Agility is a silver bullet that is applicable in all cases with no compromises.

Just to give one example, “Practices of an Agile Programmer” clearly states that agile is not for everyone.

The truth is that these practices come at a price, and for a lot of organizations, the price gets high very quickly.  Agile development will never go far if its proponents keep ignoring these organizations and make condescending comments to its members.

Here Cedric is spot on. Yay!

I like Test-Driven Development.  I really do, and I’m fortunate enough to work on a project that lets me use TDD most of the time.  But the truth is:  at times, I don’t do TDD because implementing a feature quickly is more important than a fuzzy feeling.  And I’m also aware that TestNG is an open source project with less than five developers, all of them on the bleeding edge and aware of the latest advances in software engineering. And this is my main beef with Agilists:  I strongly suspect that most of them are spending their time on open source projects with like-minded fellows, but none of them have any experience what companies whose survival depends on shipping software have to go through to organize huge code bases growing thousands of lines of code every day under the combined push of hundreds of a developers, all with their personal background, education and bias.

My main beef with people opposing agility is that they basically say that too many of the developers out there are morons who cannot perform unless closely supervised and given clear instructions, and that there is no hope that that will ever change. It is a weird combination of pessimism and elitism

Now Cedric has a history of not liking agile methods, and that is fine with me. Whatever makes him happy. But his retoric in this case is like watching somebody who does not know karate perform a round house kick – lots of power and effort but misses the target completely.