Archive for the ‘Java’ category

Magazines targeting JRuby and Jython

January 17th, 2010

Are you interested?  I’m looking at bringing the same style product that we’ve been delivering to the Groovy community to the JRuby and Jython communities, respectively.  If there’s enough interest, we’ll move forward.  Care to register interest?  Sign up at http://jrubymag.com and/or http://jythonmag.com and let me know what you’d like to see covered.

Next magazine topic survey – winner announced

December 23rd, 2009

A few weeks ago, I posted a survey asking for input on the next magazine topic for Web Dev Publishing to pursue.  The results were interesting, but unfortunately the results were not definitive, and I’m left with the same quandry as before – which topic to choose.

The winner of the survey, selected at random, was Mark McDonnell.  Congrats Mark, I’ll be sending your Amazon Gift Card over today.

The top vote getters were (in no particular order)

  • MySQL
  • NoSQL
  • JVM Languages (jruby, jython, scala, clojure, etc)
  • Zend Framework
  • Database technologies

The votes were pretty evenly split between all of these topics, which leaves me with no clear direction as to which, if any, of these topics would make sense to pursue (from a demand standpoint).   There already was a MySQL PDF magazine, which has transitioned in to a “open source database magazine”, covering more technologies than just MySQL.  NoSQL, while interesting, has been criticized as just a ‘flavor of the month’ (though the interest shown in this survey was significant).  Zend Framework and JVM Languages are the two that seem the most promising.

Do you have any thoughts on this?

Learning new languages harmful?

December 22nd, 2009

After having spent much time with Groovy/Java, and a bit with Ruby and a bit with C#, I have a newer perspective on learning new programming languages.  Much of my thoughts are summed up by this post from Gustavo Duartes.  I liked his choice of words at the top – “language dabbling” – which largely describes my C# and Ruby experience.  I’ve done a little bit in them – some paid in C#, some not – but the bulk of my work is in PHP, with a small but growing bit in Grails.

It’s interesting to note his acceptance of “more than one”, but focusing on the “minimal required set”.  We tend to think of languages as Java,C#, Python, etc., but competent web developers need to have a handle on SQL and JavaScript as well.  Many also get into Flash/Flex/Silverlight too, and while CSS isn’t a *language* specifically, it’s something most web developers should be acquainted with.  So, regardless of your serverside language of choice, there’s going to be 2-4 other technologies you need to be at least competent, if not proficient, with.  This may be more the realm of small shop and independent developers – people working on larger teams or in companies with divided responsibilities may be able to get away without knowing any SQL or JavaScript, for example.

One of Gustavo’s points was that you lose momentum on your main language when you start dabbling with others.  There may be a point there, but I suspect some people end up looking at other languages when they reach a plateau in one.  That was certainly my point I reached with PHP.  Having used it since early 1996, there’s only so much more I feel I can do with it.  Yes, the language is evolving slowly, and I’m not keeping up with the ‘best practices’ of namespacing and such in 5.3, and I could probably architect my apps somewhat more strictly using some of the bigger frameworks out there.  However, one of the things you end up learning when you look at other languages is where some of the defects are in your primary language.  You may start to see the new ‘best practices’ as work-arounds in language deficiencies.

It’s easy to point at PHP and talk about how “it sucks” and all that, but I’ve had experiences with some friends who’ve moved from Java over to PHP.  While this was a somewhat unwelcome move at first, given PHP’s reputation amongst the ‘enterprise crowd’, at least one of my friends is really enjoying being able to be much more productive – more functionality in fewer lines of code – and rethinking some of his approaches to web development.  Moving from any statically typed language to a dynamic one is certainly a shift for people to make (and the reverse movement is true as well!), and rethinking those problems we’ve taken for granted can be a real eye-opener.

In the short term, yes, it’s a productivity loss, as Gustavo points out.  In the longer term, it can really provide you with many more tools in your toolkit for attacking new problems.

One caveat I’ve noticed to this is the old saying “choose the right tool for the job.”.  Great in spirit, but my experiences have borne out that rarely is the definition of “right” able to be agreed on.  ”Right” for who?  The DBA?  The sysadmin?  The developers?  I had a project I’d recently prototyped in Grails (after an initial first pass prototype in PHP 6 months earlier).  The Grails environment allowed for much more rapid prototyping and modeling of data, relationships, screens, and so forth.  However, when it came time to accept it, I was told we could *only* build the app on a traditional LAMP stack (I was looking forward to using PostgreSQL on this project as well).  Why?  Because the limited system administration staff didn’t have the time to learn new skills to manage the new technology choices.

While initially I was bummed out, I can understand the decision making process.  I was able to take the db tables from Grails and wrap another PHP ORM layer around them so I didn’t lose all my work, but it certainly put to rest the maxim “right tool for the job.”  Who gets to decide?

So, even if you learn new languages and technology, you might not always be able to use the most appropriate tool from a pure technology/productivity standpoint.  And sometimes knowing that there are better options out there that you *can’t* use for various reasons adds a level of frustration to the mix that you wouldn’t have.  Perhaps we should all stick to just knowing one language and one language only, right?  :)

PPP PHP question v2 – the humbler post

March 22nd, 2009

Obviously I rubbed some people the wrong way, and didn’t explain my question(s) clearly enough from the outset, then got wrapped up in taking some offense from some of the responses.  Reviewing everything today I can see where I could have responded differently, and more clearly, earlier on.  Apologies to anyone who was offended (if anyone was).

I do think the original point(s) were somewhat lost.  To the original poster who offered the banking analogy – thank you.  However, I don’t think it’s enough, and is clearly at odds with some of my other experiences with Java/Groovy.  Let me show two code samples here (assuming WP doesn’t mangle the code too much – I need to get one of those code display plugins in here!)

In Groovy (Java), if I run this:

===========================
class person {
private email = “person email”
protected phone = “person phone”
public name = “person name”
def showInfo() {
println this.email + ” ” + this.name + ” ” + this.phone
this.onlyInUser()
}
}
class user extends person {
private email = “user email”
protected phone = “user phone”
public name = “user name”
def onlyInUser() {
println “I’m in the user class definition”
}
def showInfo() {
super.showInfo()
println this.email + ” ” + this.name + ” ” + this.phone
}
}
def u = new user()
u.showInfo()
===========================
I get this output:

===========================
person email person name person phone
I’m in the user class definition
user email user name user phone
===========================

*All* the *this* property accesses are class-bound, it seems, but the this.onlyInUser() call still calls the method in the child class.

In C# (my C# isn’t hot, but this *seems* to be a correct re-implementation of the same logic) if I run :

===========================

using System;
class person  {
public string name = “person name”;
protected string email= “person email”;
private string phone = “person phone”;

public virtual void showInfo() {
Console.WriteLine(“In the person showInfo method”);
Console.WriteLine( this.name + ” ” + this.phone + ” ” + this.email);
}
}

class User : person {
public new string name = “user name”;
protected new string email= “user email”;
private new string phone = “user phone”;

public override void showInfo() {
base.showInfo();
Console.WriteLine(“In the user showInfo method”);
Console.WriteLine( this.name + ” ” + this.phone + ” ” + this.email);
}

// Main begins program execution.
public static void Main()
{
User u = new User();
u.showInfo();
}
}

===========================

I get

===========================

In the person showInfo method
person name person phone person email
In the user showInfo method
user name user phone user email

===========================

Running seemingly equivalent code in PHP (5.2.5)
===========================
<?php
error_reporting(E_ALL);
class person {
private $email = “private person email”;
protected $phone = “protected person phone”;
public $name = “public person name”;
public function showInfo() {
echo $this->email.” – “.$this->phone.” – “.$this->name.”\n”;
$this->onlyInUser();
}
}
class user extends person {
private $email = “private user email”;
protected $phone = “protected user phone”;
public $name = “public user name”;
public function onlyInUser() {
echo “I’m in the user class definition\n”;
}
public function showInfo() {
parent::showInfo();
echo $this->email.” – “.$this->phone.” – “.$this->name.”\n”;
}
}
$u = new user();
$u->showInfo();
===========================
I get the following output:

===========================
private person email – protected user phone – public user name
I’m in the user class definition
private user email – protected user phone – public user name
===========================

There’s clearly a difference here, and it’s likely related to an logical difference between super and parent.  My limited Java-fu and C#-fu being what they are, I’m not able to quite grok why there’s a difference in behaviour between the examples ago.

Hopefully this is humble enough to garner some collective wisdom.  I’m not bashing PHP here, nor anyone’s contributions or anything of the sort.  Simply asking – why are these behaving differently?

Groovy and Grails presentation at Lexis Nexis

March 14th, 2009

My friend Curtis Mitchell invited me to speak to some of the developers at Lexis Nexis about Groovy and Grails.  I was honored to speak, but also slightly nervous.  For some reason I’d got it in to my head that they were a Java development shop.  *Me* presenting to experienced Java developers makes me slightly nervous.  I don’t know all the terms or have the battle scars to relate to them.  I’ve not done EJB work, nor J2EE work (JEE now?), etc – so that was making me a bit nervous.

I got there a bit early, then realized I’d forgotten my stupid macbook vga adapter (one of the more acute drawbacks of having a macbook).  Then I realized they were mostly a .net shop, which made me even more nervous.  Why was I here?  How would I relate on a technical level?

I ended up using my slides for “Groovy/Grails for non-Java developers” which seemed to work out OK.  There were a few aspects of Groovy they seemed impressed with over C#.  At least one specific point I remember is the automatic private properties and automatically compiled get/set  methods – I think that appeared cleaner to some of the devs there. 

I got some good questions about some of the Java aspects, and just some of the dynamic aspects of Groovy.  Some of the devs seemed pretty up on dynamic language stuff in general, and talked of some of the stuff going on in the upcoming .net DLR.  I learned about extension methods in .net 3.5, which seem to be a similar way to modify existing classes (like adding new methods on to the sealed String class, for example).  Whether or not you can add stuff at runtime with extension methods, I dunno – forgot to ask.

All in all, after a few minutes I relaxed more.  I quickly changed my brain from thinking about Groovy/Grails specifically, to 1) talking more generally about dynamic languages (some slides had Ruby and PHP example code too) and 2) bashing Java the language for its verbosity relative to dynamic languages like Groovy.  Once I’d made the presentation more about “here’s what’s going on in Java re: dynamic languages”, it felt more comfortable to me, and hopefully to the audience.  I wasn’t there to get them to switch from .net (no good reason to do that!) but I think it gave some of them a fresh view of what’s going on in other camps, and also what dynamic languages bring to the table re: productivity.

Thanks Curtis and the L/N gang for your invitiation and hospitality (and cheap sodas!)  :)

Groovy and Grails training classes

February 5th, 2009

GroovyMag has recently announced Groovy and Grails training classes. These are web-based and able to be taken anywhere you’ve got a computer with Flash and an internet connection.

I’m excited about offering them, and working with Robert Fischer (of SmokeJumperIT) to finish putting together the course materials. He’s taught Groovy and Grails classroom-style before, as have I (well, PHP, not Groovy), but we’re working on reorganizing the material to work better over the web.

You can read more about the class offerings here, and read a bit more rambling about the training here.

If you’re interested in taking the class, or just have some questions about the training or Groovy in general, give me a call at 919-827-4724.

January GroovyMag out

January 4th, 2009

The January 2009 issue of GroovyMag is out. Grab it now!

This issue includes:

  • Community News from Dave Klein
  • Grails WebFlow walkthrough from Brian Doyle
  • Regular Expressions with Groovy from Ted Naleid
  • Feed Plugin overview – once again from Dave Klein!
  • Rich Swing Apps with Groovy from Andres Almiray
  • Interview with IBM’s Project Zero team
  • Excerpt from Grails In Action – Glen Smith and Peter Ledbrook

This issue clocks in at 40 pages, and is pretty content-rich, if I do say so myself.  Unlike many other tech magazines, we don’t rely on advertising.  Yeah, I know, you kinda like looking through ads sometimes.  Go to the web for about 9 seconds and get your fill, then come back to GroovyMag.

Honestly, it’s not like we have a strict ‘no ads’ policy – there’s one ad in the December and January issues each, and we might have another one in February.  However, the point of the magazine is content – stuff to help make you a better developer and expose you to new techniques.  Helping you find new writers that you haven’t heard of before is a nice side benefit of publishing Groovymag.

The first couple issues I was a bit embarrassed by having ‘only’ 33 or 36 pages.  And this issue, with 40 pages, still is small compared to many magazines you get on the newsstand.  But then I compared GroovyMag with an ASP magazine I picked up.  Cover price is $6.95 (IIRC) for 60+ pages, but 20 of them were ads.  Dollar for dollar, I think we’re delivering a pretty good value.  And apparently many of you do too, judging by the growing number of purchases between November, December and now January.

If you’ve purchased your January GroovyMag already – thank you!  If not, what are you waiting for?  Grab it now!

Are traditional object models enough? Can we evolve usefulness in OO models?

December 15th, 2008

Just a quick thought here after looking at someone’s code I just stumbled on. This person had a “isReadOnly()” method inside of a generic “set” method which would allow them to determine if a property should be allowed to be modified or not.

It got me to thinking again how the traditional notion of “visibility” in OO is, imo, broken. Perhaps that’s going a bit far. It doesn’t address the day to day needs most developers have. I’d say more developers need some sort of a way of making properties “read only” than they do dealing with “public, protected, private” PPP notions which we get in traditional OO implementations. What PPP gives is all-or-nothing – you get full access to this property (or method) or you don’t get any at all.

Short port (I gotta run) – why do we not have some sort of default “read only” property modifier in OO implementations? The Groovy approach would be to create a setXXX() method that was empty, effectively overriding the default setXXX() method to not perform any manipulation at all. It’s not *bad*, and is pretty clear, but some modifier like, oh, I dunno:

readonly String name

would be useful, no?

Java, JavaFX, mobile apps – my rant

December 7th, 2008

Just had some random thoughts about Java, Javafx and mobile apps.  I want to be wrong, but the recently launched JavaFX feels like ‘too little too late’.  I was listening to some Sun podcasts and they did a good job of making me interested in JavaFX.  When it was first announced last year I said “too little too late”, but wanted to give it another chance after it launched.  I’ve been wholly underwhelmed by the demos and JavaFX rollout.  Frankly, I’m not sure what they could have done to impress me, but this wasn’t it.  I’m not entirely writing the whole thing off – I’d like to dig in to it some more – but coming up with a new language seemed a mistake, imo.  Would have preferred they’d used Groovy (for somewhat obvious reasons) as their primary language, or perhaps even come up with a way to compile actionscript down to Java – that would have been an immediate boon to developers wanting to leverage their Flex skills in this new land.

On a related note, I’m wholly unimpressed by the “Java is on all mobile devices” argument that Sun and Java advocates advance when touting Java’s viability.  It may have other benefits, but simply having Java *on* 2 billion devices, or is embedded in 4 billion smart cards, or whatever other massively large device numbers are trotted out, doesn’t do *me* as a developer much good.  

I dare say it doesn’t really do *most* Java developers all that much good, because *most* developers won’t be writing stuff for those markets.  And a market with 4 billion *locked down* hardware devices doesn’t necessarily even need to employ that many people – you’re cranking out commodity volumes at that point.  You need a small number of highly skilled people (Java devs in that mix) but 4 billion Java devices around the world really doesn’t do very much for the Java developer marketplace *because those devices are locked down*.  I’ve not used a mobile Windows device in many moons, but I have colleagues who’ve told me it’s pretty easy to write software for Windows mobile devices.  That’s great, and is a good first step.  The next step is distributing those apps.  There may have been (or may be) some decent ways in the Windows ecosystem to do that on a public scale – I presume most Windows mobile apps written and distributed on large scales have been for corporate workforce-style apps – internal apps for companies (might be wrong on that).  It seems that it wasn’t until Apple’s app store that the idea of just wirelessly grabbing apps from a variety of people (and being able to easily monetize those) that this market has been somewhat legitimized.

Bear in mind I did some limited Palm development back in the late ’90s, and there was (maybe still is?) a decent ecosystem there.  But trying to become part of that world seemed *very* daunting.  Trying to write any moderately complex Palm app was a relative nightmare, and then trying to get approved to distribute it was a whole ‘nother matter.  I think I only personally know one person who did it, and that was me being in that world for over a year.  In less than 5 months I’ve run across close to a dozen iPhone app developers, and they’re making some money at it.

Contrast that with Java and the Java mobile story.  Yes, Java’s on a huge number of mobile phones out there.  This means pretty much nothing for most Java devs because there’s pretty much no way for them to write apps and get those apps installed on those devices.  The devices are locked down.  Apple’s proved the viability of a model like this – 10s of millions of app installations every month, and developers sharing a piece of that revenue.  Java – arguably one of the most widely installed systems ever – and who can benefit from that?  Certainly not 99% of the developers out there who’ve spent their time investing in learning Java skills.

Sun *really* seems to be dropping the ball here.  This isn’t a one time event here – I mean they’ve consistently dropped the ball for years when it comes to having a good mobile story (have they ever even had the ball to drop it in the first place?).  I’m just not sure JavaFX will be enough to turn the mobile story around.  From the marketing podcasts I heard, they seem to think so, but it’s their own marketing people, so I’m not sure I’d expect any less.

 

Did you get your GroovyMag yet?

December 4th, 2008

Yes, yes, a minor blatant plug for GroovyMag here :)

Current December issue has articles on building Swing apps with Groovy, developing iPhone-oriented apps with the iUI plugin, an article on GORM’s strengths, an interview with ContentSieve on their use of Groovy/Grails (their entire stack is now Grails-based), community news and an overview of the Testing plugin (to help with unit testing of controllers).

Upcoming issue topics include

  • more Swing apps with Groovy :)
  • using regular expressions with Groovy
  • Grails’ webflows tutorial
  • a preview of the upcoming Grails In Action book
  • a look at the feeds plugin
  • how to write a Grails plugin
  • community news
  • more interviews with real-life companies using Groovy and Grails in production settings
Other topics you’d like to see?  Definitely let me know!

If you haven’t picked up your copy yet, I’m interested in knowing why. Email mgkimsal@gmail.com, or post a comment here – either is fine. Is it just something that’s a bit too pricey for you right now? Do the topics not interest you enough? Are you on the fence about Groovy or Grails?