Angry Bill

tech talk radio

Archive for February, 2008

Resteasy Project: JAX-RS Restful Web Services implementation

Posted by billburke on February 25, 2008

I’m pleased to announce the first beta release of the JBoss Resteasy JAX-RS implementation!

After about 4 months of on and off development, I finally have a working version of the new JSR-311, JAX-RS specification. For those of you who don’t know, JSR-311 is a RESTFul Web Services implementation for Java and is slated to be included within Java EE 6. The spec is still a bit of a moving target, but its still pretty useful. Let me know what you think!

Features:

  • JAX-RS implementation (almost full, still have a few minor things here and there)
  • Portable to any app-server/Tomcat that runs on JDK 5 or higher
  • EJB 3.0 and Spring integration
  • Client framework to make writing HTTP clients easy (JAX-RS only define server bindings)

Where can I find out more?

All information, including where to download it, is available on our Resteasy WIKI.

Posted in REST, Webservices, java, jboss | 10 Comments »

Maven would be cool if…

Posted by billburke on February 22, 2008

Maven would be cool if the plugins weren’t so god awful!  I mean, are these plugin developers idiots?  Do they even use their crap?  I just spent a good day trying to get the maven-ear-plugin to work only to give up and do an assembly, only to run into different problems there.  Beyond being totally unintuitive, these specific plugins have horrible horrible documentation.  Add to this fact that the assembly plugin doesn’t even check its syntax.  For example, I had <fileset> and didn’t know why the stupid plugin wasn’t creating the fileset in the jar.  Well, its because I didn’t capitalize the ‘S’  <fileSet>.  Of course no error message.  I had to ditch maven-ear-plugin because it didn’t correctly put transitive dependencies in the directory I wanted automatically.

I just can’t believe people haven’t cleaned up this shit.  Are people really using Maven?   I WANT to like Maven, I WANT to use Maven.  Its too bad its so freakin painful.

Posted in java, maven | 11 Comments »

Scannotation fix for /WEB-INF/classes

Posted by billburke on February 14, 2008

I have a confession.  I didn’t really test the code that allowed you to scan /WEB-INF/classes for my Scannotation project.  In the old code, if you run within Tomcat, you’ll get a “jndi:” protocol based URL that my code doesn’t understand yet how to scan

Instead, I obtain the URL by doing a ServletContext.getRealPath(”/WEB-INF/classes”).  Unfortunately, this is not guaranteed to work by the specification, so, if you run into this problem, you’re gonna have to find another way to scan this directory portably.

I’ve released a version 1.02 of Scannotation that has this RealPath fix along with a few other minor bug fixes I found while using the library.

Posted in jboss | No Comments »

JBoss Unit Testing with Maven

Posted by billburke on February 13, 2008

Recently, I had the need to do some JBoss integration testing in a Maven environment. I had to piece together how to do this and couldn’t find one reference point that just gave me all the maven XML I had to cut/paste. So, I thought I’d log it here for others to reference. First of all, in your src/test/resources directory you need a jndi.properties file:

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
java.naming.provider.url=jnp://localhost:1099

This isn’t used by any of the maven plugins i’m going to show you, but you will need it in your test code if you want to connect at all with JBoss. Next, here’s the build fragment of what you need in your pom.xml

   <build>
      <finalName>jsr311-war</finalName>
      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jboss-maven-plugin</artifactId>
            <configuration>
               <jbossHome>/Users/billburke/jboss/jboss-4.2.2.GA</jbossHome>
            </configuration>
            <executions>
               <execution>
                  <id>jboss-deploy</id>
                  <phase>pre-integration-test</phase>
                  <goals>
                     <goal>deploy</goal>
                  </goals>
                  <configuration>
                     <fileName>${basedir}/target/jsr311-war.war</fileName>
                  </configuration>
               </execution>
               <execution>
                  <id>jboss-undeploy</id>
                  <phase>post-integration-test</phase>
                  <goals>
                     <goal>undeploy</goal>
                  </goals>
                  <configuration>
                     <fileName>${basedir}/target/jsr311-war.war</fileName>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
               <skip>true</skip>
            </configuration>
            <executions>
               <execution>
                  <id>surefire-it</id>
                  <phase>integration-test</phase>
                  <goals>
                     <goal>test</goal>
                  </goals>
                  <configuration>
                     <skip>false</skip>
                  </configuration>
               </execution>
            </executions>
         </plugin> ...
      </plugins>
   </build>

First things first, is to use the Mojo JBoss plugin. This allows you to deploy/undeploy to JBoss. You must configure it to point to the JBoss home directory. I have it hardcoded, but you should use an environment variable. There are two executions that are run. One deploys a file I have in my projects target directory, the other undeploys it. These must run in the pre-integration-test phase and post-integration-test phase.

The next blob of XML deals with the Surefire test framework. Surefire will try to run tests before you have packaged and deployed your target archive. This is because in Maven’s lifecycle, testing comes before packaging and Surefire is automatically bound to run tests in the “test” phase. We turn this off and instead tell Surefire to run during the “integration-test” phase after our archive has been packaged and deployed to JBoss.

The mojo plugin also allows you to start and stop jboss. I could not get this to work with JBoss 4.2.2. Since I prefer to run JBoss manually when integration testing anyways, I was too lazy to investigate further.

Posted in jboss, maven | 4 Comments »

EJB maintains its dominance

Posted by billburke on February 13, 2008

EJB was created almost 10 years ago to solve the component needs of application developers. Since then thousands of successful applications have been written and deployed using this technology. Although I don’t do much with EJB nowadays as I have other responsibilities at JBoss, I still wonder how it is doing in the industry. Recently, I became privy to various bits of knowledge that EJB is still going strong and maintaining its dominance in Java application development. Consider this job trends graph from indeed.com:

EJB job graph

Over 3 years EJB jobs have remained pretty much constant. This is very encouraging news considering recent Rod Johnson propaganda. EJB really did not have an alternative in the Java space until 2004/2005 when Spring started to be known and popular. It is very interesting to see that although EJB has had a serious competitor, it has maintained its dominance in Java application development over the years. You could even extrapolate from these numbers that EJB is an upper bound on the number of Java component jobs out there and that Spring has only recently matched this. This is proven by the fact that the Spring and Java graph trends are the same since they converged 6 months ago.

This trend pretty much correlates with download numbers I posted on our EJB implementation awhile back on TSS in June 2007.

I can give you a few from two perspectives:

downloads on sf.net for JBoss and Hibernate projects related to EJB3 and JPA:

* Downloads of a standalone distribution of the JBoss EJB3 project since 10/2004: 183199

* JEMS installer which bundles EJB 3.0 (not same as JBoss Appserver download): 201923

* JBoss 4.2 which bundles EJB 3.0: ~65000

* JBoss 5 betas which bundles EJB 3.0: ~80000

* Hibernate’s JPA implementation: 135269

* Hibernate Annotations (which is JPA based): 202561

So, total downloads solely related to JPA: ~337K
Total downloads solely related to EJB3: ~550K
Total EJB3 + JPA related downlaods: ~ 887K

Compare that to Spring 2.x downloads: ~600K
Spring 1.x downloads: 946K
Hibernate 3.x downloads: 1445K
Hibernate 2.x downloads: 495K

Now that’s just JBoss. You also have Glassfish, Open JPA, Oracle, and now Geronimo communities not included in these numbers.

Also, my EJB 3.0 book has been out a year and has sold ~12K copies +/- a thousand (haven’t gotten check yet from last quarter).

So, all and all I think there is pretty compelling evidence that EJB3 and JPA has momentum.

Its hard to continue any analysis on JBoss specific download numbers as we basically encourage our user base to download JBoss 4.2.x or 5 as it is bundled with our EJB3 implementation.

There’s some other encouraging numbers as well. In 2005 I was offered by O’Reilly to take over Richard Monson-Haefel’s EJB series.  “EJB 3.0, 5th Edition” was published in May, 2006. Even after being out for almost a year and half, sales are still going strong. Just last quarter we sold 1700 copies, very good for a technical book. When I went to Krakow in October, I also found that my book had been translated into Polish. I believe its also been published in Chinese. All indicators of broad adoption by the technology.

So, as you can see, even after almost 10 years, EJB is still going strong and maintaining its dominance. With the emergence of Seam and Web Beans being incorporated into EE 6, I predict this trend to continue.

Posted in ejb3, seam, spring | 18 Comments »

Yahoo/Zimbra acquisition opportunity for Buni?

Posted by billburke on February 7, 2008

Recently, I was browsing around reading about the possible Yahoo! acquisition by Microsoft.  One Washington Post article in particular talked about how Zimbra customers are spooked by the acquisition.  Zimbra is a commercialized open source mail server distribution that competes with Microsoft Exchange.   This got me thinking, Andy Oliver must be really happy right about now as it creates a nice opening and opportunity for his company Buni.  Buni was originally the JBoss Mail project.  I remember Andy 2 years ago presenting his project and business opportunity to JBoss’s technical board of directors.  Back then, it was pretty impressive what he and his project contributors had accomplished.  Since then, Andy left Red Hat shortly after the acquisition to pursue his entrepreneurial ambitions for his mail project after we failed to give him the support he needed to make it succeed at JBoss.  I can only imagine how much better his distribution has become since he was able to work on it full time.  I know they have some solid reference customers and a thriving community.

Posted in business | No Comments »

Anti-IDE Myths

Posted by billburke on February 6, 2008

Well, if you were wondering who my evangelist colleague was in my “Dynamic Languages: Rationalizations and Myths” blog, wonder no more. Please go read Steve Vinoski’s comments, they are a good read. One of my major points against dynamic languages was the inability for an IDE to provide reliable refactoring for them. Steve attacked this with a considerable amount of drivel. Here’s some good blurbs:

“The contrived Ruby example that Bill uses to “prove” [that dynamic languages can't do reliable refactoring] is, well, contrived. Why would anyone write code like that or suddenly get the urge to rename init to init2? I’m no Ruby expert, but I’d probably rename the method and then stick a method_missing in there to catch any call instances I might have missed with my editor. “

Contrived my ass…Like I said in my previous blog. I write sucky code. I am constantly renaming methods, extracting methods, combining methods, renaming classes, deleting unneeded methods, fields, classes all the time. I never get things right the 1st time and rarely get them right the nth time. Steve, 99% of us are not the uber programmer you are. And, what Steve? Am I going to have to do a constant edit/test/edit/test continuously until I get my edits right? Sounds a lot less productive than having the IDE automatically and reliably do it for you with one click. Again Steve, I used to be in your world. Not as long as you, but still a considerable amount of time.

“I asked him if these magical modern IDEs that raise productivity and eliminate common errors also eliminate defects caused by missing or misunderstood requirements, missed use cases, or just plain ol’ bad programming. Again, no answer. The reason I asked this is that those are the bad bugs; syntactical errors are really the least of your worries. Even if the IDE spits out common idiom/pattern skeletons for you, it’s still quite possible to screw up the code logic, and neither the IDE nor the compiler is going to prevent that.”

Nice strawman Steve. When did I ever say or infer this? How is implementing in a dynamic language going to “eliminate defects caused by missing or misunderstood requirements”? It sure is going to be a hell of a lot easier to refactor your codebase to fix these problems, but eliminate? So Steve, are what you really saying is “IDE’s are not going to eliminate your bugs or poor design”? Thanks for stating the obvious. What I keep telling you is that I’m going to be 10 times more productive with a statically typed IDE when I try to fix these poor designs and logic.

“Considering how old Java is, it’s obvious that it’s taken quite a bit of time to get these IDEs to where they are today. I asked Bill if everyone should have to wait a long time, on the order of 10-15 years, before an IDE truly becomes valuable for a given language. No answer. Personally, I’d rather stick to my emacs and UNIX tools, with their infinite applicability and flexibility that can be used for development in pretty much any language, than wait around for someone else to give me a far less functional IDE that barely addresses only one language. But then again, if one language is all you got, then I guess you have no choice.”

Reality: One, I don’t remember him asking me this. Two, I think that IDEs (at least Intellij) are so well designed now that they can easily support a variety of languages fairly quickly. Add to this fact that their APIs are open (not OSS, but open) and have a great community. For instance, on a quick search I found plugins for Ruby, Python, AspectJ, XML, XML Schema, and Scala. The interesting thing about Intellij, is that it also has support for frameworks. For example, it has syntax checking and code completion for embedded Hibernate/JPA QL. Refactoring integration between Spring, JavaEE and Java. I haven’t looked at their RoR support, but I bet it is awesome. I continually find it AMAZING how these guys bang things out. They are either an army of people (doubtful) or just have an incredibly architected product (probable).

“I asked Bill if he’s ever considered that Java IDEs are the way they are due to issues with the Java language itself that must be compensated for. Consider its verbosity, for example, which is why IDEs spit out those skeletons.”

Reality: Let me go through the list of Code Gen and Refactoring items and see what is not useful in, let’s say, Ruby. There are 30 refactorings in IntelliJ + Java. Only 8 out of 30 are NOT useful to Ruby. For the “Generate..” code generation tab. 2 out of 5 are not useful for Ruby. I think the “Surround With..” tab is useful. The thing is, out of these 35 things, I *DO* use one of them *at least* every 10 minutes. This is of course assuming you believe that the unuseful things are because Ruby is a better language (I don’t beyond the closure stuff). I will admit that only 5 of the refactorings require a statically typed language to be *reliable*, but, at least for me, I do use these particular ones very very often, especially after the first prototype. (rename, move, safe delete, change method signature, inline). At least with Intellij, parameter types are also extremely useful with code completion. Good code is self documenting and with IDE code completion, I don’t have to look at a manual or source code comments to find out how to execute a method on an object. BTW Steve, what “skeletons” are you talking about? MDA bullshit? Or the crap I rarely use?

“Saying that “my buddy Jason was on a team that had to put type names in their Python function names” is certainly not even close to being solid evidence of your claim, Bill.”

Steve, I think Jason’s experience was a relevant experience.  I wrote about it because  I thought Jason’s experience was the funniest story I’ve heard. It sure isn’t the only horror story people have had with lack of static typing.

Posted in flame bait, java, ruby | 10 Comments »

I feel responsible for Pats loss

Posted by billburke on February 5, 2008

I just found out some information that for some reason makes me feel responsible for the Patriots loss. Know who Plaxico (Giant’s wide receiver who caught game winning touchdown) Burress’s QB was in college? BILL BURKE! Yes, this is not a misprint Bill BLEEPIN Burke!!! Check out this article I found on a game Bill Burke and Plaxico played together in college.

Well, it seems Mr. Burke beat Michigan to remain undefeated at the time. Guess who was the Michigan QB? YUP, FREAKIN TOM BRADY!!!! I almost shit my pants.

Know how I found out about this?  Well, I was looking at my blog stats and found that somebody had found my site by searching “Bill Burke vs. Tom Brady”.  I was like WTF would somebody do a search like that?  Lo and behold….

Posted in sports | 2 Comments »

Other dynamic language propaganda

Posted by billburke on February 4, 2008

One of the commenters of my last blog reminded me of yet another myth:

If you learned to code in the XXX dynamic language way you’d need to rely a lot less on your IDE.

And Joe Johnson wasn’t the first to say that to me.  :)  Another tactic I can’t stand with the zealots in the dynamic language community (and any other religious communities I might add.)  Attack your criticizer’s insecurities.  This comment translates to, “Java has made you a sucky programmer, if you program in Ruby, you will no longer be a sucky programmer” Or, simply:  “Ruby will make you an UBER programmer”  or, even simpler “You are a sinner, you must be saved”.  This is an awesome way to promote your language.  Why?  Well, because most of us programmers are geeks.  We were laughed at in school for wanting to spend our free time copying game code from magazines.  Even beat up.  So, we are inherently insecure and eager to be accepted by any crowd.

The problem with this argument is, for me personally, what happens when I switch to Ruby and miss the productivity I had with my Java IDE?  Does this mean I’m a horrible programmer and still a loser?  You readers know how insecure I am.  So, I just can’t switch to Ruby.  When I fail at becoming the uber programmer I always wanted to be after switching to Ruby, my insecurities and closet-Rod-Johnson-loving, fragile ego will just shatter me and I will end up  crying myself to sleep every night.  Sorry no thanks.  I already had enough heartache watching the biggest choke in NFL history yesterday.  I can’t take anymore.  The reality is that I know I am a horrible programmer and switching to Ruby won’t change that fact.  At least if I stay with Java, others will have the tools to productively clean up the messes I leave behind.

Ruby jobs have grown 500%!

Many are still scared by the dot.com bubble burst.  Many were laid off at least once.  So, its only natural to prey on these types of insecurities as well.  The reality is, if you read the fine print, Ruby is still only a tiny percentage of the Java market.  Even if it continues at this growth rate it will be at least 3 years before it overtakes Java.  Which is fine for me as, about that time, I have to start looking for another job as, obviously, SpringSource will have put JBoss out of business by then.  I’m fine with that.  3 years is enough time for me to collect the rest of my stock and get my wife back to work to take care of my ultimately unemployed ass.

The non-programmers of the world need a simple language to code in

Beautiful!  You mean my 94 year old grandma can help me code?  The problem with this is that this leaves a huge mess to clean up after the fact.  That’s great for the $100-200/hour consultant out there cuz they can bill thousands of hours.  Sucks for the company paying the bills.

Posted in flame bait, java, ruby | 4 Comments »

Dynamic Languages: Rationalizations and Myths

Posted by billburke on February 4, 2008

The Patriots loss in the Superbowl has gotten me so depressed and down that I need to take it out on somebody. I need to rant about something, so why not about some things that have annoyed me over the past few months about the dynmaic language community.

I recently emailed the mandelbrot benchmark to a dynamic language evangelist colleague. Although benchmark results are usually pure propaganda, poor representations of how a language or framework is used in the real world, or even just plainly out of date with the latest versions of the technology, still, the performance of dynamic languages compared to Java in the example is quite embarrassing. Ruby, for example, is 500 times slower! Yeah, its hard to take seriously a benchmark that outputs to stdout, but still, if you look at the code you’re thinking, WTF is Ruby doing that causes so much overhead?

Now, when I forwarded this benchmark to my evangelist colleague, he immediately accused me of trying to put down or stamp out any challenge to the “One True Language” (Java). Its not about putting down or stamping out. Its about testing whether or not a language is a viable application platform. The thing is, if the dynamic language crowd is going to position itself as a replacement for Java in application development then they are going to have stop giving silly rationalizations for their shortcomings and promoting myths about their language and Java. This, and this alone is what irritates me about this crowd. Let me give you some examples about the rationalizations and myths they try to pull over on us:

RATIONALIZATIONS

Dynamic Language XXXX didn’t do well against Java in XXXX benchmark

Rationalization: “Benchmarks indicate very little practical information about the overall utility and performance of a given language or runtime.”

Reality: Although benchmarks are either propaganda, out-dated, or not a good representation of real-world usages, glaring differences must be recognized. A 5%, 10%, or even 100-200% difference is probably as a result of tuning or some simple undiscovered bug. In the grand scheme of things, those kind of numbers ain’t very relevant. But a 50000% difference? For such a simple benchmark? Something is seriously wrong here.

This reminds of 2002, when I first ran JBoss against the J2EE SpecJ benchmark. We had some pretty embarrassing numbers at first way back then. Although SpecJ is clearly a silly, non-real-world benchmark, it allowed us to identify many major and minor bottlenecks and helped our project to mature. For some dynamic languages like Ruby, I think what the mandelbrot benchmark showed was that the VMs/implementations of dynamic languages like Ruby are still very immature compared to Java. I don’t believe that it shows anything seriously wrong with the language syntax of these dynamic languages themselves though. Java received similar attacks in the mid 90s when it came out. Since then, the JVM has improved dramatically and according to the mandelbrot benchmark, only 10% slower than C. I expect the same out of the Ruby guys eventually. I’ll have to see how this benchmark improves under JRuby.

Ruby VM cannot support kernel threads

Rationalization: “Green threads are good enough.” OR: “Who cares, I can just run multiple processes.”

Reality: Even the basic laptop nowadays has parallel computing power. Green threads don’t take advantage of this. Blocking I/O also creates huge problems with Green Threads. Solving the problem by running many processes is a poor solution. A process is just too heavy weight compared to a thread which is why we have threads in the first place. It is very common for server-side Java applications to service hundreds of concurrent users. Besides, running multiple single-threaded processes starts to negate some of the benefits of simple design patterns like caching.

If dynamic languages like Ruby want to position themselves as a viable alternative to Java for an application platform, they are going to have to solve these issues. Many will say, “Its probably good enough for simple apps”, but it is not uncommon for project leaders to underestimate how much traffic they will get, or how much they have to scale.

Dynamic languages like Ruby, Python, etc… are not typesafe/statically typed

Rationalization: “Type-safety makes my code too verbose and makes me less productive.”

Reality: Why can’t these people learn how to type? Modern IDEs make this point totally moot with code completion and code generation. Besides, why can’t we have a dynamic statically typed language?

Lack of type safety doesn’t scale well to large teams

Rationalization: Anybody noticing the “Any software written by a large team will ultimately fail.” articles floating around in the community? Am I paranoid, or is this yet another attempt at brainwashing us into believing dynamic languages are the next fad in software development?

Reality: There are a lot of large applications in the industry being written. This reminds me of a story my colleague Jason Greene told me. He was working on a very large python project. Lack of static typing ending up being such a coordination and maintenance problem they ended up having a coding policy where everybody had to embed type information into the variable names of method parameters. Funny, eh?

Lack of static typing does not allow for reliable refactoring in modern IDEs

Rationalization: “The productivity of dynamic language XXXX makes refactoring irrelevant. Anyways, there are IDEs for Ruby out there that support refactoring”. OR, my favorite: “I don’t use an IDE, what do I care?”

Reality: I was a VI/Emacs user up until 2002 when Intellij came out with refactoring capabilities. Up until then, I was as productive with emacs, find, grep, and sed as I could be with any IDE out there. After finally becoming familiar with Intellij and its refactoring capabilities, I found that I was 5, 10 times more productive with my IDE than I was before. Now, Ruby fanboys will argue, “Intellij and Netbeans have refactoring capabilities for Ruby!” My answer is, it is not reliable refactoring. Take this example Cedric Beust gave on a recent TSS thread:

def f1(o)
  o.init
end   

def f2(o)
  o.init
end   

class C
  def init
    ...
  end
end    

class D
   def init
     ...
   end
end

If you rename C.init to C.init2, how can the IDE know which o.init must be renamed in f1 and f2? The IDE could either do these refactorings automatically (dangerous) or prompt you to confirm at each replacement point (tedious). In either case, any productivity you’ve gained with the elegance of Ruby is lost 10 times over.

So, these are just some of the rationalizations the dynamic language crowd gives when confronted with criticism. Now let’s talk about some of the myths and propaganda that is being fostered.

MYTHS

Software Engineers should use the best language for the job

Reality: I don’t know about the rest of you, but throughout my career I’ve either been developing middleware or writing applications. What other job is there really out there? Or maybe they are saying, “XXX dynamic language is good enough to solve certain application requirements”? Good enough has never really been good enough for me.

Besides, its hard enough to find an expert in one language. Its a maintenance and integration nightmare to have a project written in multiple languages. This can be bridged, to a degree, with dynamic language implementations that run on the JVM: JRuby and Jython are good examples. But unless these implementations become mainstream, they can quickly become out of date, i.e. Jython.

More lines of code means more bugs, thus dynamic languages are better.

Reality: Modern IDEs fills this gap. TDD is viable in type-safe languages too! I’m probably doing my own rationalization here, yes… JBoss 5, for example, is the 3rd major refactoring of the JBoss Application Server that I’ve lived through. I just can’t imagine doing it without the reliable refactoring that modern Java IDEs provide.

I am more productive in XXX dynamic language because the syntax is cleaner, more elegant, and more powerful.

Reality: Because Modern IDEs with a statically typed language can do reliable refactoring, this productivity gain has diminishing returns as your project gets larger. Even with small, one man projects, this reliable refactoring offsets any productivity gain you get with the dynamic language. At least, that’s what I’ve experienced.

I’ve done a decent sized project in Python before. I did find I was more productive with the first implementation. The problem is, I’m not a very clean programmer, so I end up iterating and refactoring constantly. In my case, a powerful IDE has made me incredibly more productive. Something I just could not get with a dynamic language.

Am I just a Java fanboy?

Maybe, but I don’t think so. Throughout my career I’ve done projects in Pascal, assembly, C, C++, Fortran, Tcl, Perl, Python, Visual Basic, Java, and even hacked around a little bit with PHP. While I don’t believe that Java is the one langauge to RULE THEM ALL, I do believe it is vastly superior to anything out there to build applications with. I also do not believe that Java is the end all, be all of existence. It still needs elegant, typesafe closures to complement annotations as a way to implement DSL. It needs a standard, non-code generating way of adding behavior to annotations. It needs a structural syntax to make initialization easier. AOP support might be nice too, or at least JVM support to make it easier to implement AOP-like features. Better zero-turnaround development features in both the JVM and APIs like Java EE, Seam, Hibernate, Spring, and JBoss AS would help out tremendously as well. Really, I’d be fine to dump Java for a language that supports all these things but the new language must:

  • Be typesafe, statically typed
  • Have an IDE that supports the same features as modern Java IDEs
  • Have a rich set apis and libraries to build my applications from
  • Have a viable commercial ecosystem
  • Have a vibrant open source community

While current dynamic languages do have some of these attributes, none contain all, so until then Java is my choice and I will remain a boy who is a Java fan.

Finally, I hope you realize that I’m not trying to stamp out dynamic languages, but rather hoping, in vain, that the dynamic language community admits their faults. I do wish that a statically typed dynamic language would come of age, but until then, I’ll stick with Java. Really, I don’t know why somebody hasn’t done it it. Is static typing really that hard to implement well? For example, why not gut Groovy and have Dynamic Java? Or do the same with Scala? Or add static typing to Python and get Jython up-to-date?

Well thats it, expect more ranting in the next few weeks/months on a variety of subjects. Its gonna take a long long time to get the Pats loss out of my system….

Edited: 2/22/08

Many people have been confused on what I meant by statically typed dynamic language.

1) Typesafe introductions/mixins to either an instance or a class

For example:

class Foo {}
class Mixin implements MixinInterface {}
Mixin.add(Foo.class, new Mixin(), MixinInterface.class);
Foo foo = new Foo();
 MixinInterface intf = (MixinInterface)foo;

Or:

Foo foo = new Foo();
Foo bar = new Foo();
Mixin.add(foo, new Mixin(), MixinInterface.class);
(foo instanceof MixinInterface) == true
(bar instanceof MixinInterface) == false

2) Ability to do AOP things like field/method/constructor interception without having to do bytecode magic
3) Ability to plug in at runtime annotation processing (not the Javac crap).
4) An instrument library that allows you to make schema changes to classes. (didn’t state this before)


Posted in flame bait, java, ruby | 58 Comments »