In my previous blog, Go Away Ruby, Andy Oliver got a little upset with me in the comments section. In typical Andy style, he likes to strut the one thing he knows to show how much smarter he is than everybody else. His usual tactic is to state the one bug he found in an application to show how much the thing or the individual who wrote the thing sucks (to Andy, everything sucks) and how clever he was in finding this bug. Sounds like I dislike Andy, but I don’t. Andy is one of those rare people that know how to create an open source project, promote it successfully, and recruit talented volunteers to help him out. His mail project at Buni.org is a testament to this (cool stuff BTW, you should check it out).
Anyways, Andy had to go on a long rant on how clueless I was on Ruby. Maybe I am totally clueless, but I think he missed my point on what I disliked about Ruby and other languages like PHP, Perl, Tcl, VB, and Python. The last five of which I have written at least one project in. What I dislike is that these languages do not require type declaration in their syntax. Take this from the Ruby Language homepage:
# The Greeter class class Greeter def initialize(name) @name = name.capitalize end def salute puts "Hello @name" end end # Create a new object g =Greeter.new("world") # Output "Hello World!" g.salute
I dislike the fact that the initialize method does not require a return type and that the parameters of the method declaration don’t require a type either. Also, the ‘g’ variable has no syntactically assigned type either. I just don’t see how the refactoring and code analysis tools that Intellij and Eclipse have for Java could ever be mirrored in Rubyland, or even Python, Perl, Tcl, VB, or PHP for that matter. Maybe Andy is married to his VI editor, but I just can’t go back to the days of having grep and sed as my sole refactoring tools.
I am guilty though of using incorrect vocabulary to define my beef with Ruby or Andy. I should not have used typeless or dynamic typing and stuck purely to type-safety. Maybe things are clearer now?
If dynamic typing sucks, JBoss AS must suck
In the Go Away Ruby comments Andy state that if I think dynamic typing sucks (I don’t), then in turn I must also think JBoss AS sucks. In Andy’s world, java.lang.Proxy and JBoss’s Invocation object are just a workaround for the lack of dynamic typing in Java. Dynamic typing, in my mind at least, means that type is assigned at runtime and can even by augmented at runtime. JBoss is not trying to provide dynamic typing for the user, we’re trying to take a statically typed interface that the user defines and tunnel it over a generic construct. We are neither assigning type at runtime, nor are we augmenting types at runtime. The JBoss interceptors do not care or even interact with the arguments or return type of a method invocation. Yes, the transport layer need to use Java Serialization to marshal and unmarshal these objects, but, last I heard, reflection != dynamic typing. Even if JBoss’s use of proxies fell under the Andy Oliver definition of dynamic typing our use of it still does not fall under my beef with Ruby and other dynamically typed languages that don’t require type declarations. Our use of these constructs does not prevent me from using any of the powerful tools available in Intellij and Eclipse for refactoring or analyzing JBoss’s code base.
JBoss AOP and dynamic typing
JBoss AOP does try to mimic some of the features of dynamically typed languages. Or, as Andy would say, it tries to work around the fact that Java isn’t dynamically typed. Specifically, introductions and mixins. It would be cool if Java made it easier for JBoss AOP to provide this type of feature. BUT….not at the expense of relaxing type safety.
Could care less about performance Andy
And, yo Andy, when did I ever say in my blog I didn’t like languages like Ruby because they weren’t compiled? I don’t align myself to any performance debate when comparing interpretted or JITed dynamically typed languages. The debate sounds too similar to the C++/C vs. Java junk that flew around in the late 90’s. In any database or networked application, any overhead Ruby et al. have will probably be negligible compared to DB access. CPU power is cheap anyways.
Why Groovy is different
Now, in my last statement in Go Away Ruby blog, I talked about pushing Groovy over Ruby. Groovy is cool because you can write pure type-safe Java and get the zero turnaround. You get much of the nice syntax sugar that the Ruby guys have. Here’s an idea, what if we strip down Groovy and pull out all the untype-safe (vocab again π ) things to get Dynamic Java?
Can I go back to my vacation?
Anyways, Andy now that you have proved how smart you are and what an idiot I am, can I go back to my vacation?
Sep 12, 2007 @ 04:36:49
One thing I know…bah…
Okay so what about ECMAScript? You don’t HAVE to (in which case the type is Object) but you CAN and most often do/should:
var foo = new Object();
var bar:Bla = new Bla();
In some cases the type declaration is fairly redundant though (the above cases for instance). You sound kind of white bearded.
I’m insecure? You went personal just because I argued with you! I was just interested in the intellectual debate… I’ve had to use Vista for nearly a week and haven’t been able for various logistic reasons (involving my regular laptop’s like 4th trip to the repair shop and bad network speed) to write much Buni stuff. So I was looking for a little mental stimulation…instead I get personal jabs…sheesh.
BTW Thanks for the plug.
Sep 12, 2007 @ 13:03:40
Maybe I am white bearded, but its not like I have never coded with one of these languages. Adding all these type declarations doesn’t hurt my productivity, I don’t understand what the fuss is. Yeah, maybe a poorly skilled developer would have an easier time not worrying about type, but then bad code still is bad code you have to maintain. Declaring types just makes it a little bit easier to dive in and figure out what these unskilled developers have actually written.
I’ll strike out some of my jabs if you want to….Not angry anymore π
Sep 12, 2007 @ 13:13:22
One jab removed, i’ll leave the “not wanted” comment for reference though.
BTW, I never thought you were ‘nobody’. I just plainly forgot you had left. I tried to make up for it with a later post on that TSS thread, but muffed that up too.
Sep 19, 2007 @ 04:04:25
Well for the record, you still don’t quite get it, but maybe I’m not explaining it well. It isn’t that “types are hard let’s get rid of them” it is that static typing and lack of a language meta-model is rather limiting and a lot of what you’ve spent a lot of time doing is working around that. Moreover, DAMN Flex’s (ECMAScript) REST support via dynamic objects and binding is EASY and requires next to NO code. I do create types out of it, but for the transport it is SOOO nice. The idea is that with a more dynamic language you can BUILD a type and avoid JavaAssist and classloader foo and other things that while “neat” are hacks around limitations in Java. The other thing is that if you code even a little bit in Ruby (not talking about Rails and ActiveRecord/bla which blow frankly) you’ll find that forget the “scriptiness” of it…they lack that JCP feel of the APIs where you don’t have to get a factory to get a locator to get a factory to an object.. Do a simple socket send and receive in Ruby and you’ll see what I mean. Its cleaner API design done better. Java has a lot to learn from Ruby and Ruby needs the JVM to not suck :-)… I’m just saying…Java ain’ all that and playing with other languages keeps you fresh and open minded and makes you a better developer π
Sep 19, 2007 @ 04:34:10
Andy, what I think you don’t get is that I messed up by bashing typeless Ruby (when its not) and then you got me twisted around saying what I didn’t like was dynamic typing, when what I really didn’t like was the lack of type-safety. I fucked up all the vocabulary. I do like limited dynamic typing, ala AOP introductions. I agree with you that using Javassist to do this stuff is really a workaround, but all that has nothing to do with my original argument. Type-safety is a must.
IMO, Ruby is just another scripting language (yes, one that could be JITed, but WTF cares?). No I don’t have an open mind on it because, well, as I said before, I’ve already been there with Python (worked on a python project off and on for over a year), Tcl, Perl, VB and even a little bit PHP. I’ve also done Vax Assembly, DCL, cshell, Fortran, Ada, C and C++ at previous jobs. The one I’m missing though is Smalltalk. Developers whose programming foundation was built upon Smalltalk, IMO, code very differently than the rest of us and approach problems differently as well.
And, BTW, just because something has a bug, a bug that may have caused you problems doesn’t mean it sucks. So, the JVM doesn’t suck. You suck. Name a better more mature VM out there.
Sep 27, 2007 @ 12:27:33
Okay strong dynamic typing == good. Lack of type checking is bad. Sometimes “Variants” are useful though (esp for binding). But Ruby doesn’t suck just because of one thing :-). In fact as I said Java has a lot to learn from Ruby in terms of API design IMO. Your API design looks a lot more like Ruby than like JCP-java.
You’re doofy with “the language is the most popular runtime of the language” only a java developer would think that there are “scripting langauges” and non-scripting languages.
You got it wrong or I messed up the grammar, I said “Ruby needs the JVM (for Ruby) to not suck”. Being a VM buff, I don’t think you really think that I think the VM sucks. I do however think Java classloading sucks, but so do most people (and I think I just quoted Scott). More clearly I think that tying type to classloaders to encapsulate the concept of “isolates” is a mistake and that the implementation at the VM level of classloaders is poorly done..
Sep 27, 2007 @ 12:41:00
Although type safety would be a strong enough reason not to use Ruby (or Python, PHP, etc…) Other suckies? No Annotations (correct me if I’m wrong only glanced quickly). As Jason Greene would say, “It is painful for me to write code in languages that assign special meaning to whitespace”. So, if I had to code in anything besides Java, I’d probably do it in Groovy.
online typing jobs
Oct 09, 2007 @ 05:29:45
Nov 22, 2007 @ 12:48:36
Hey java smart-arse … you suck big time because you all make waves arround your java java java … and want to control everything just like your microsnoft neighbour … yoiu should realy try to put your hands on some real stuff … like c/c++, objective C …
It’s realy easy to open up eclipse and play the smart-arse with how cool java is and how cool groovy is … wake up, php is there since … many years … and most of the web development is done in php, nowdays ruby and python seem to catch up to this …. but hey, … nobody is showing that superior arrogant attitude like the java guys do … I mean … come on … i understand that many ibm years and a lot of bloated enterprise sh_t has passed through your hands … all these acronyms … all these app servers that require expensive hardware to run … my guess is that you’re just the victims of a super-evaluated marketing campaign … taht almost brainwashed you …
Remember the KISS principle ? … nevermind
virtual machines suck … there’s no direct memory acces, no pointers, no fun P
Cheers
Jan 07, 2008 @ 07:39:32
Damn are talented programmers destined to pointless bickering on blogs? Ruby is good, Java is good, everything is useful for someone. Even visual basic.