Archive for the 'Java' Category

Groovy is what it says on the tin

Tuesday, 27th February, 2007

I can’t believe I never stumbled across this before; I’ve seen a few posts about Groovy on dzone.com previously and just ignored them. A couple of weeks ago however I bother to investigate this language - how I wish I’d done this earlier!

I recently bought the second edition of Agile Web Development with Rails, which is good and all but when I scour the net to see where Ruby is on the job front, it’s pretty bleak (at least in the UK if you don’t live in London).

Back to Groovy though; the first time I stumbled across some of the source I smiled - this is what I’ve been waiting for… I can see how the reduction in syntax could make purists turn red faced but from a productivity standpoint, not having to write such overly verbose code that is Java really appeals to me! (probably my nasty PHP habits)

It’s made Java fun again, dare I say it, it’s made Java groovy :) (please put down those tomatoes).

I think stumbling across Groovy now is no co-incidence, what with version 1.0 just out the door and numerous books making it to the shelves. Things went from good to great when I Googled around for some Grails tutorials - the amount that can be achieved in such a succinct amount of code was a breath of fresh air.

Working with PHP all day (not exactly a verbose language), Grails looked like a significant improvement in productivity. Perhaps it’s the pedigree of the developers that have forged Groovy and Grails - PHP has always suffered from it’s low barrier to entry - Grails looks well designed and time will confirm this for me.

I’ve ordered Groovy in Action, and PHP in Action just for the hell of it (I saw Marcus Baker (who ran the PHP London user group until Mar 2007) in the authors list and thought this has to be a decent read since I’ve seen him speak nothing but sense on SitePoint’s PHP Application Design forum).

I’m not the only one who’s enthused… hopefully given Groovy’s heritage and the volume of Java programmers that can make an easy switch; commercial acceptance may be faster than that of Ruby, or at least taken more seriously/readily by big(ger) business.

Java impressions

Saturday, 25th November, 2006

This was meant to be a lengthy comparison of the stumbling blocks I found learning Java having come from PHP. However learning Java is currently on the back burner so I thought I’d post what I have anyway.

Back in September I purchased Head First Java (I had to see what all the fuss was about with the Head First series). This book has a prerequisite of previous programming experience which I don’t think is necessary, the first few chapters cover very basic of programming concepts.

I’d recommend this book to other PHP developers looking to branch into OO, I think OO concepts are better learnt from the Java community than PHP at present.

Behaviour that stood out compared to PHP:

  1. Java is strong typed but you can do this:

    boolean a = true;
    boolean b = a;
    System.out.println("If a is true, b is " + b);

    Output: If a is true, b is true

    I thought being a strong typed language b would have to be cast as a string or explicitly have its type changed but this appears to be automatic. My initial thinking was __toString was being called on these variables but in hindsight these are primitives and not objects.

  2. Java is not a web centrict technology consequently there’s additional complexity to deal with the peripheral elements of it that aren’t of use to web programming.
  3. Java feels like it’s more complicated than it needs to be, the core language is fine (POJOs etc) but getting things like JSPs working on Tomcat was a headache.
  4. The deal breaker: learning Java isn’t as fun Ruby.

Umm’ing and arrh’ing

Saturday, 27th May, 2006

We’re moving offices soon at work, in the process we’re having a serious clear out due to the reduced space we’ll have at the new premises. As a result I’ve picked up a couple of unwanted Java books. I never appreciated how similar OO PHP5 code is to Java, infact it looks like a complete rip off! I had also not appreciated how many OO concepts I’d become familiar with…

This of course got me thinking, I might stretch my programming legs and have a look at Java over the summer. I can’t see it being much of a leap from the PHP5 code I’ve been writing in my own time. There’s a few new things in there like inner classes, nested interfaces and threads but with the majority of the concepts I feel I’m already comfortable. Continued squabbles on the PHP internals list only encourage me to do this, who knows, there’s a whole lot more Java jobs out there (which are better paid too!).

This is a turn around from the time I spent over Christmas looking at C# :)

You are currently browsing Greg’s blog (software development and operating systems) archives in the Java category.

Categories

My Bookshelf

PHP in Action: Modern software practices for PHP Agile Web Development with Rails
xhtml 1.1 compliant   xhtml 1.1 compliant