667514 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 770 Messages: 770 Messages: 770 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Beyond Java

Posted by: Rick Hightower on October 15, 2005 DIGG
Rumor has it that after Bruce Tate and Justin Gehtland finished working on a web application written in Spring, Hibernate, and Webwork, they were able to recreate the application in Ruby in 4 nights. From that point on Bruce and company began questioning Java's applicability in different problem domains. The book Beyond Java came pouring out after several epiphanies from this Ruby porting experience.

Read more about Bruce's latest in this article.


Could Ruby and frameworks such as Ruby on Rail be the next big thing?
  Message #187968 Post reply Post reply Post reply Go to top Go to top Go to top

beyond... what?

Posted by: Timur Evdokimov on October 17, 2005 in response to Message #187896
I couldn't comment on RoR since I've never used it. And it's just a matter of personal taste indeed, but I find its syntax, such as
 link_to_remote "Delete this post",
     :url => { :action => "destroy", :id => post.id },
     :update => { :success => "posts", :failure => "error" }
...well, let's say I find it "aesthetically challenged".

Nevertheless, it's not about aestethics. There's more to Java than the language, VM or even web frameworks. Namely, a lot of APIs, tons of premium quality open-source code, not to mention such mundane things as talent availability, industry momentum and vendor commitment.

What I do see is that RoR tries persistively and desperately pretend it _is_ a next big thing. Well, it is next, but not that big. I admit there might be some reasonably good ideas in RoR, but to overthrow Java it would need to become much more than it is now.

So far, when I need to make quick'n'dirty webapp, I'd rather resort to PHP. Especially when it's likely that the customer needs to maintain the application for a while without me.

  Message #187971 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Juozas Baliuka on October 17, 2005 in response to Message #187896
It looks like there is nothing to write about or nobody buys books about old good things and writers are looking for a next big thing.

  Message #187972 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Steve Zara on October 17, 2005 in response to Message #187896
they were able to recreate the application in Ruby in 4 nights...

Right then. Someone then says 'Sorry wrong database - we need this on a different vendor's system and it will need to cope with future schema changes'.

Rapid development does not always (or I would say 'often') outweight long-term maintainability.
Could Ruby and frameworks such as Ruby on Rail be the next big thing?

No, of course not. The reason is that there never has been a 'next big thing'. In spite of hype and epiphanies IT has always moved on by evolution not revolution. There have been many revolutionary languages (Algol, Simula, Smalltalk, LISP etc) but these almost never become general purpose. Instead the mainstream adopts their good ideas, often in a diluted form.

Also, I have to say that the article does contain some statements which are, at the very least, highly questionable:

-Java is moving away from its base. Hardcore enterprise problems may be easier to solve, but the simplest problems are getting harder to solve.

Exactly how? I have found the much of Java 5.0 has made the simplest problems far, far easier to solve, with less verbose and faster code. There is nothing at all about Java that changed so as to make simpler problems harder to solve.

-Java is showing signs of wear, and interesting innovations are beginning to appear outside of Java.

As Spring, Hibernate and other technologies start to move into the mainstream of Java use, and as the latest release of Java (5.0), which has more changes than any release of Java for years, moves into mass use, saying Java 'is showing signs of wear' seems a bit strange.

With new and exciting systems like real-time Java showing practical usefulness, to say that Java is lacking in innovation seems also somewhat far from what I see as reality.

Java has shown an ability to adapt and add new features. It will continue to do so.

  Message #187973 Post reply Post reply Post reply Go to top Go to top Go to top

Isn't that for script hype, repeating PHP story

Posted by: Alex Vasseur on October 17, 2005 in response to Message #187896
Coding time is not the main factor in choosing a language (a platform should I say at least for Java).

Given the script features going on with Java 6, Groovy and such, clearly, "beyond Java" includes scripting, groovy on rails or whatever you like as a developper, but it does includes "Java" as a platform - not Ruby.

  Message #187974 Post reply Post reply Post reply Go to top Go to top Go to top

Making Java more Dynamic

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #187896
Java needs to maintain a balance between being stable enough to be used in a conservative corporate environment while evolving rapidly enough to keep up with dynamic languages like Ruby and Python.

I've never used Ruby, but I've used Python a lot. Python is great for short programs, but I wouldn't want to use it for anything more than a couple thousand lines or on a project hat involved several people. The bigger the program gets, the harder it is to live without static checking.

However, the interesting thing about Python programs is that if you are smart they tend to shrink as much as they grow. If you notice something repetive occuring in your attributes, you write a special descriptor to handle it. A pattern in the form of your classes? Write a new metaclass that applies the pattern. So code grows as you implement functionality, and shrinks as you refactor common behavior into metaobjects.

From a practical standpoint, you could conceive of this as compile-time programming, because (at least in my experience) the metaprogramming code is all done before the application code starts executing.

  Message #187975 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Pedro Costa on October 17, 2005 in response to Message #187971
+1

  Message #187980 Post reply Post reply Post reply Go to top Go to top Go to top

I Hate JavaBeans

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #187896
Look at the (very rough) code below and start thinking about how many LOCs could be saved by introducing the illustrated "attribute" language feature, especially for more sophistacted usages...
public class Foo {
private String msg = "Hello, ";
private String name = "World";
public String getMsg() { return msg; }
public void setMsg(String inMsg) {
if (inMsg == null) throw new IllegalArgumentException("msg cannot be null!");
if (inMsg.equals("")) throw new IllegalArgumentException("msg must not be blank!");
msg = inMsg;
}
public String getName() { return name; }
public void setName(String inName) {
if (inName == null) throw new IllegalArgumentException("name cannot be null!");
if (inName.equals("")) throw new IllegalArgumentException("name must not be blank!");
name = inName;
}
public void sayHello() { System.out.println(msg + name + "!"); }
}

with a new java construct..
public abstract attribute Attribute<T> {
public instance T get(); // invoked when accessed via syntax obj.attrName
public instance void set(T value); // invoked via syntax obj.attrName = newValue;
}

and...
public attribute NonBlankString implements Attribute<String> {
// this constructor is execucted at compile time or maybe class load time
public NonBlankString(String defValue, String nullMessage, String blankMessage)
{
if (defValue == null) throw new IllegalArgumentException("defValue cannot be null");
if (nullMessage == null) throw new IllegalArgumentException("nullMessage cannot be null");
if (blankMessage == null) throw new IllegalArgumentException("blankMessage cannot be null");
defVal = defValue;
nullMsg = nullMessage;
blankMsg = blankMessage;
}
public instance String get() { if (value == null) return defVal; return value; }
public instance void setValue(String inVal) {
if (inVal == null) throw new IllegalArgumentException(nullMsg);
if (inVal.equals("")) throw new IllegalArgumentException(blankMsg);
value = inVal;
}
private instance String value;
private String defVal;
private String nullMsg;
private String blankMsg;
}

and finally
public class Foo {
// introduce the arrow operator for compile-time assignment
public String name <- new NonBlankString("World", "name cannot be null", "name cannot be blank");
public String msg <- new NonBlankString("Hello, ", "msg cannot be null", "msg cannot be blank");
public void sayHello() { System.out.println(msg + name + "!"); }
}


  Message #187982 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Bruce Tate on October 17, 2005 in response to Message #187896
I'll blog a little more about my experiences today, but I thought I should talk about them some here first, because this community has meant so much to me. I should probably point out what I have to lose.

- All of my clients are Java clients.

- I've got 3 JavaOne best sellers in 4 years. All of my best books are about Java.

- I've worked to establish a brand in the Java business. Indeed, my company name, is based on the Java brand.

Look...no technical book is going to make an author a lot of money. Generally, for a book like this, I'll get less than two bucks a book. A very good Java book sells around 10,000 copies, and if you put much effort into it at all, you can see that you'd make more money flipping burgers. Writing is about the love of the craft. So you should be asking yourself, why would a Java evangilist cut his own throat like this? And the answer is this: for my readers, I think it's the right thing to do. For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive. I didn't understand either until I used the framework in anger. What's different?

- Rapid turnaround time. Save and reload. That's it. Very compelling.

- Starting point. You start with basically a working CRUD app per table. Windows to do list, show, edit, delete, new. Sure, you'll rewrite some, but you can put something in front of your customer instantly. That's compelling. To get all of this, you can either do a one-time code generation pass (it's not that much code in Rails), or you can do a scaffold :person command.

- Reduced configuration. For us it was a 10-1 reduction. I think that's fairly typical. More for some extreme struts apps, less if you don't count annotations (but I think we're often making a big mistake with annotations.)

- Better mapping strategy for the Rails problem set. Here's an active record class, that maps a Person class to a table called people, and belongs to a department:

class Person < ActiveRecord::Base
  belongs_to :department
end

End of story. You want syntax? That's syntax. You get a property for every column in the database, custom finders like find_by_last_name, and other goodies to manage the belongs_to relationship. No repetition of column names. No code generation.

- Much better AJAX, and cleaner view technology.
As to quick and dirty, I used Java because it was clean, although slow. I didn't use PHP or Perl because I think they are quick and dirty. I think Ruby on Rails is quick and clean.

But it's not for every Java project. I think that several areas are basically safe for Java: hard core ORM, heavy threading, two-phased commit. Rails is for one well-defined niche, but it's probably the most important one, and that niche is rapidly expanding. More comments in my blog today...stay tuned.

  Message #187983 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Dennis Bekkering on October 17, 2005 in response to Message #187896
they were able to recreate the application in Ruby in 4 nights.

how long did they worked on the original , 2 nights;-) Now serious, this statement doesn't mean anything. The second time you build something it goes always faster, regardless wherein. I do agree though with "the next thing". It is coming, it is there already but it hasn't become "the thing" yet.

I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!

  Message #187984 Post reply Post reply Post reply Go to top Go to top Go to top

Reduced configuration...

Posted by: James Waldrop on October 17, 2005 in response to Message #187982
I'm learning Ruby now, so I can't really say a whole lot about it. However, having tried out Rails, the reduced configuration is really nice.

That said, it's only nice until you have to do something out of the ordinary. The Rails list and IRC channel are *full* of people asking how to do things a little different from the standard way, and the response is basically that you have to recreate some or all of that configuration that you initially lost. Doing portlet-style development is one example, your mapping file doesn't look that different from a typical Spring configuration before long.

Maturity of the APIs and the developers is a big ding against Rails. I don't want to get into a philosophical debate over DB constraints, but I think a lot of experienced developers here appreciate why DB constraints are valuable. More importantly, our ORM tools in the Java world can model simple constraints like foreign key refs with no problem. In the Ruby world they're still arguing that your constraints should be enforced solely at the controller layer, and ActiveRecord, convenient as it is, has no knowledge of foreign key constraints.

If you're writing an app which can be written in 4 days, it's likely that these sorts of concerns don't really pertain. I will posit that a significant percentage of the web apps which get written today in Java are good candidates for the Rails framework. Perhaps the percentage is as much as half. However, for those of us who live in a world where we don't control our schema, or where our schema has lived beyond 3 major revisions to the app, or where we need the rich, enterprise-class APIs that exist in the Java world, Rails is not really a compelling solution.

I think everyone who writes Java apps should also know how to write Rails apps. You should be able to judge when something you're writing is trivial enough to throw away most of the complexity you get writing big Java applications. But the need to write big Java applications isn't going to go away, and there are still going to be plenty of Java jobs around. They'll probably pay better too, because if you need that complexity, you realize it costs, at all levels. ;)

--james

  Message #187985 Post reply Post reply Post reply Go to top Go to top Go to top

I Hate JavaBeans

Posted by: peter lin on October 17, 2005 in response to Message #187980
I fail to see how fewer lines of code make it easier for someone else to maintain the code once the original author has moved on to some other jobs. I'm getting the feeling that many programmers don't get why business like Java or having something that is verbose with well defined practices. business want to reduce risk, that often manifests itself in the form of development process, best practices and lots of documentation.

since I've done quite a bit of contract/consulting work the last 8 years, my experience is that languages that encourage sparse one line style coding has a higher tendency of being difficult to maintain. C# improved on Java by providing properties, but it's a mix bag. If there's only one person writing an application, then who cares about LOC. In contrast, a medium, large or extremely large project it's inappropriate to put LOC first. Clean, well implemented and documented code is far more important in medium to large projects.

just look at .NET 1.0 XSD.exe. the classes it generated was very terse and used public fields. In .NET 2.0, they switched to make the fields private and used properties. LOC isn't an argument for or against Ruby or ROR in my mind. I would say LOC is only valid for a 1-man project. my bias opinion.

peter

  Message #187986 Post reply Post reply Post reply Go to top Go to top Go to top

Some predictions

Posted by: Wille Faler on October 17, 2005 in response to Message #187896
Could Ruby and frameworks such as Ruby on Rail be the next big thing?

I predict a new three-letter acronym will arise in the enterprise software sector before the year 2008 that will be hailed the end-all, save-all Silver Bullet(tm) to cure all ills of the world and problems in enterprise software.

Large vendors will rush headlessly after said acronym, providing value-added toolsets supporting the acronym that will "require no programming!".

Now, will anyone dare to put up some money against my wager?

  Message #187988 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Juozas Baliuka on October 17, 2005 in response to Message #187982
I didn't use PHP or Perl because I think they are quick and dirty. I think Ruby on Rails is quick and clean.
So try PHP or Perl, probably it is not so dirty as you think ( but I am afraid it is too late to write best sellers about this stuff).

  Message #187989 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Keith Donald on October 17, 2005 in response to Message #187896
they were able to recreate the application in Ruby in 4 nights

One thing I just can't buy into about such a "rumour" is how it completely ignores the most challenging part of building a software application: understanding, modeling, and addressing the problem domain. Last time I tried to solve the same problem twice (ahem, never), I'm sure I'd get it done in four days as well.

Bruce says that most apps best fit for Java are those requiring "hardened ORM" or "two phase commit" or "heavy threading". Frankly, that is a techy, somewhat shortsighted answer. Most enterprise applications solve problems in complex domains (think about a currency exchange system, a flight planing system, or a intrusion detection system), and integrate a wide range of systems (some legacy, some new) (think about a payment processing engine, or a warehouse management system, or systems to support a supply chain). Developing and testing non-trivial business logic becomes the key problem, as does enterprise integration.

I personally would prefer to read more books about how to address the issues above rather than how to implement simple CRUD logic productively. Thank goodness for DDD.

I also don't take to how Bruce blurs the line between what productivity benefits are realized because of Ruby the language and what is because of Rails the framework (the same goes for the Java side of the coin). Much of Rails is directly translatable back to a Java framework, particularly the convention-over-configuration for basic CRUD. The RIFE framework is doing exactly this right now, and you can expect Spring to be offering solutions in this area as well.

Rails is a good technical solution for isolated (departmental) CRUD webapps. But it does imply an obvious paradigm shock and loss of leverage that will hamper adoption. Furthermore, much of the RoR innovation is (and is being) directly translatable back to today's leading Java frameworks.

Keith

  Message #187990 Post reply Post reply Post reply Go to top Go to top Go to top

Reduced configuration...

Posted by: Bruce Tate on October 17, 2005 in response to Message #187984
Great discussion, and thanks. Some comments:
I'm learning Ruby now, so I can't really say a whole lot about it. However, having tried out Rails, the reduced configuration is really nice.That said, it's only nice until you have to do something out of the ordinary. The Rails list and IRC channel are *full* of people asking how to do things a little different from the standard way, and the response is basically that you have to recreate some or all of that configuration that you initially lost.
Doing portlet-style development is one example, your mapping file doesn't look that different from a typical Spring configuration before long.Maturity of the APIs and the developers is a big ding against Rails. I don't want to get into a philosophical debate over DB constraints, but I think a lot of experienced developers here appreciate why DB constraints are valuable. More importantly, our ORM tools in the Java world can model simple constraints like foreign key refs with no problem. In the Ruby world they're still arguing that your constraints should be enforced solely at the controller layer, and ActiveRecord, convenient as it is, has no knowledge of foreign key constraints.

A good, and fair criticism. I've also made this point.
If you're writing an app which can be written in 4 days, it's likely that these sorts of concerns don't really pertain. I will posit that a significant percentage of the web apps which get written today in Java are good candidates for the Rails framework. Perhaps the percentage is as much as half.

This is the crux of my argument in Beyond Java. But I think this application set represents Java's original base. I actually argued slightly more than half. Most of us take a big fat relational database and front it with a web UI. Rails just solves this stuff much better than Java does. More if you add better ORM into Rails, and it's coming, with a pluggable Active Record. ORM is new in Ruby, but I think OG has a whole lot of things right. This is a matter of time to me.
However, for those of us who live in a world where we don't control our schema, or where our schema has lived beyond 3 major revisions to the app, or where we need the rich, enterprise-class APIs that exist in the Java world, Rails is not really a compelling solution.I think everyone who writes Java apps should also know how to write Rails apps. You should be able to judge when something you're writing is trivial enough to throw away most of the complexity you get writing big Java applications. But the need to write big Java applications isn't going to go away, and there are still going to be plenty of Java jobs around. They'll probably pay better too, because if you need that complexity, you realize it costs, at all levels. ;)--james

I absolutely agree.

  Message #187991 Post reply Post reply Post reply Go to top Go to top Go to top

PHP and Perl

Posted by: Bruce Tate on October 17, 2005 in response to Message #187988
I didn't use PHP or Perl because I think they are quick and dirty. I think Ruby on Rails is quick and clean.
So try PHP or Perl, probably it is not so dirty as you think ( but I am afraid it is too late to write best sellers about this stuff).

I don't think history is on your side here. You don't have to try either one for very long to know that they are excellent prototyping languages, but will have trouble scaling. I think Ruby on Rails is different. It's much cleaner, from a design perspective, and just as productive...even more so.

  Message #187992 Post reply Post reply Post reply Go to top Go to top Go to top

One point on configuration and defaults.

Posted by: Bruce Tate on October 17, 2005 in response to Message #187984
I'm learning Ruby now, so I can't really say a whole lot about it. However, having tried out Rails, the reduced configuration is really nice.That said, it's only nice until you have to do something out of the ordinary. The Rails list and IRC channel are *full* of people asking how to do things a little different from the standard way, and the response is basically that you have to recreate some or all of that configuration that you initially lost. Doing portlet-style development is one example, your mapping file doesn't look that different from a typical Spring configuration before long.

But you almost never have to replace *all* of the configuration. That's the point. By providing meaningful defaults, you save your users lots of work. Ruby in general is this way, not just Rails. I'd kill for named parameters and defaults in Java. So I can do something like this:

class Item < ActiveRecord::Base
  belongs_to :person
end

and do nothing to use the expected person_id column for the expected case... or this:

class Item < ActiveRecord::Base
  belongs_to :person, :foreign_key => "ssn"
end


This is about Ruby, not Active Record. You get meaningful defaults and convention over configuration where it works, and you can override the defaults where it works. I think Java has much to learn here.

  Message #187993 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your comments, Keith.

Posted by: Bruce Tate on October 17, 2005 in response to Message #187989
Well reasoned reply as always. If Web Flow is any indication of where you're taking Spring, Java will indeed close the gap. I'll continue to promote Spring where it fits. To your points:

You should be aware that in both cases we started with a working data model, and we started from a working user interface (though a poor one). Justin blogged about the second and third generations of the app.

But your points are valid. I do not think that the one month per night is an accurate reflection of Java vs. Ruby productivity. It was enough of a jolt to make me take notice. I do, howerver, think that a whole lot of Java application development today is primarily about web-enabling a big, fat relational database. And Rails is very good at it. If I can stay within the Rails domain, I'm very productive. And I'm finding that a whole lot of Java applications today fit. Not all, but certainly a significant percentage. I say in Beyond Java that this problem set was the base for Java, and frameworks are abandoning that base. Java's too hard and not productive enough.

You see a blurry line between what's Rails and what's Ruby becasue the line between the two *is* blurry. Rails uses metaprogramming to dynamically add behavior and attributes to classes, and implement domain specific languages (Active Record uses a Ruby DSL for ORM).

  Message #187995 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: David McCoy on October 17, 2005 in response to Message #187982
I'll blog a little more about my experiences today, but I thought I should talk about them some here first, because this community has meant so much to me. I should probably point out what I have to lose.- All of my clients are Java clients.- I've got 3 JavaOne best sellers in 4 years. All of my best books are about Java.- I've worked to establish a brand in the Java business. Indeed, my company name, is based on the Java brand.Look...no technical book is going to make an author a lot of money. Generally, for a book like this, I'll get less than two bucks a book. A very good Java book sells around 10,000 copies, and if you put much effort into it at all, you can see that you'd make more money flipping burgers. Writing is about the love of the craft. So you should be asking yourself, why would a Java evangilist cut his own throat like this? And the answer is this: for my readers, I think it's the right thing to do. For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive. I didn't understand either until I used the framework in anger. What's different?- Rapid turnaround time. Save and reload. That's it. Very compelling.- Starting point. You start with basically a working CRUD app per table. Windows to do list, show, edit, delete, new. Sure, you'll rewrite some, but you can put something in front of your customer instantly. That's compelling. To get all of this, you can either do a one-time code generation pass (it's not that much code in Rails), or you can do a scaffold :person command. - Reduced configuration. For us it was a 10-1 reduction. I think that's fairly typical. More for some extreme struts apps, less if you don't count annotations (but I think we're often making a big mistake with annotations.)- Better mapping strategy for the Rails problem set. Here's an active record class, that maps a Person class to a table called people, and belongs to a department:class Person < ActiveRecord::Base&nbsp;&nbsp;belongs_to :departmentendEnd of story. You want syntax? That's syntax. You get a property for every column in the database, custom finders like find_by_last_name, and other goodies to manage the belongs_to relationship. No repetition of column names. No code generation. - Much better AJAX, and cleaner view technology. As to quick and dirty, I used Java because it was clean, although slow. I didn't use PHP or Perl because I think they are quick and dirty. I think Ruby on Rails is quick and clean.But it's not for every Java project. I think that several areas are basically safe for Java: hard core ORM, heavy threading, two-phased commit. Rails is for one well-defined niche, but it's probably the most important one, and that niche is rapidly expanding. More comments in my blog today...stay tuned.

Here's is my problem. I rarely want my class attributes names to mirror my database columns. When we've had to support bizzare databases with ungodly poor databse names, the LAST thing I want is the be tied to it. So what happens to that example when you add mapping that DB name to something more intuitive. I'm pretty sure any of the OR mappers allow you to reduce the configuration if you want to do straight mapping. Worst case, generate it and you never have to look at it.

I stand by previous statements. I'd rather use something that takes a little more work for smaller projects but scales up to the larger ones. I am on the last legs of a project with two new people. They both ramped up very quickly BECAUSE we are using Struts, Spring, and Hibernate(SSH). In addition, I can put anyone on one of the smaller 3 page apps using SSH and they can move to the one I'm finishing and they just have to understand the core business logic, because structurally, the apps are the same.

I'd rather people be portable across many projects. Despite the attempts, I just haven't seen a single clear advantage that Ruby is bringing to the table.

  Message #187996 Post reply Post reply Post reply Go to top Go to top Go to top

Ok, not really about LOCs

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #187985
It's about avoiding duplication. It's about grouping related related pieces of information together (which .NET attributes somewhat achieve for properties).

But most of all, in my opinion, it's about making the code better reflect the intent of the programmer rather than the mechanics of the program. It's about being able to explicitly code a pattern with some parameters, and then use it over and over, rather than thinking about the pattern, and then coding it over and over again.

I'm not sure how much sense I'm making. There's some Python code I've written in the past that I wish I could post, that I think really show how good use of metaprogramming can drastically change the balance between imperative and declaritive code.

I'm really not sure how to explain it. I'm a huge believer in static code checking (actually in fail-fast behavior, with compile-time being ideal), which frequently makes Python drive me crazy. But once you really really get into metaprogramming, it feels like another plane of existence. I really want to see a language that effectively combines the two, and I think a JVM based language could do it (but I'm not sure about a Java derivitive).

  Message #187998 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Thomas Dyer on October 17, 2005 in response to Message #187896
I can't argue with the points made in this article.

-Java is moving away from its base. Hardcore enterprise problems may be easier to solve, but the simplest problems are getting harder to solve.
 
-Java is showing signs of wear, and interesting innovations are beginning to appear outside of Java.

-It's time to start paying attention again. It's time to look at the horizon, beyond Java.

Rails seems to be "the next big thing" for a particular class of app. Somewhat reminds me of Appfuse.

I saw Bruce Tate at a nofluff awhile ago and his points where made very well. Gotta, at least, sit up and listen when people like Bruce and Dave Thomas talk.

I'm learning alot from Ruby and Rails and they allow me to focus more on the domain, aka DDD.

  Message #187999 Post reply Post reply Post reply Go to top Go to top Go to top

Ruby and DSLs

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #187993
You see a blurry line between what's Rails and what's Ruby becasue the line between the two *is* blurry. Rails uses metaprogramming to dynamically add behavior and attributes to classes, and implement domain specific languages (Active Record uses a Ruby DSL for ORM).

This is a key point. Ruby's metaprogramming facilities allow it to *feel* like coding in a DSL without taking away all the capabilities of a general purpose language, or introducing new syntax, etc.

Java should have a way to do the same.

  Message #188000 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Bruce Tate on October 17, 2005 in response to Message #187995
For that project, I think I would have chosen the same technologies. When you need to map, use a mapper. Rails uses a wrapping strategy.

  Message #188001 Post reply Post reply Post reply Go to top Go to top Go to top

Ok, not really about LOCs

Posted by: peter lin on October 17, 2005 in response to Message #187996
It's about avoiding duplication. It's about grouping related related pieces of information together (which .NET attributes somewhat achieve for properties).But most of all, in my opinion, it's about making the code better reflect the intent of the programmer rather than the mechanics of the program. It's about being able to explicitly code a pattern with some parameters, and then use it over and over, rather than thinking about the pattern, and then coding it over and over again.I'm not sure how much sense I'm making. There's some Python code I've written in the past that I wish I could post, that I think really show how good use of metaprogramming can drastically change the balance between imperative and declaritive code.I'm really not sure how to explain it. I'm a huge believer in static code checking (actually in fail-fast behavior, with compile-time being ideal), which frequently makes Python drive me crazy. But once you really really get into metaprogramming, it feels like another plane of existence. I really want to see a language that effectively combines the two, and I think a JVM based language could do it (but I'm not sure about a Java derivitive).

I agree with that. Having the language more accurately express the functionality and intent of the application is a noble goal, but I seriously doubt it is achievable. I hope I'm wrong though. The reason I think it's impossible is based on the fact that every programmer is different. What I consider to be clear, will most likely appear like a pile junk to someone else. Some people love LISP, while others hate it. I'm bias, but my gut tells me these debates will never be resolved. languages be it programming or spoken language aren't inherently better, they're just different. same is true of ROR.

peter

  Message #188002 Post reply Post reply Post reply Go to top Go to top Go to top

Ok, not really about LOCs

Posted by: Bruce Tate on October 17, 2005 in response to Message #187996
It's about avoiding duplication. It's about grouping related related pieces of information together (which .NET attributes somewhat achieve for properties).But most of all, in my opinion, it's about making the code better reflect the intent of the programmer rather than the mechanics of the program. It's about being able to explicitly code a pattern with some parameters, and then use it over and over, rather than thinking about the pattern, and then coding it over and over again.I'm not sure how much sense I'm making. There's some Python code I've written in the past that I wish I could post, that I think really show how good use of metaprogramming can drastically change the balance between imperative and declaritive code.I'm really not sure how to explain it. I'm a huge believer in static code checking (actually in fail-fast behavior, with compile-time being ideal), which frequently makes Python drive me crazy. But once you really really get into metaprogramming, it feels like another plane of existence. I really want to see a language that effectively combines the two, and I think a JVM based language could do it (but I'm not sure about a Java derivitive).

Exactly. Rails may just be a stepping stone, or it may just fill a niche. The real meat is behind metaprogramming. How do you take a building block, and integrate it into the very core of the language? That way, your language grows with your domain. It feels like you are coding on a higher plane, becasue you *are* coding on a higher plane. Abstractions will inherently rise up over time.

The point in Beyond Java is that this is just the sort of catalyst that could cause a new langauge to emerge. Keep in mind that with Java, Netscape and Applets were the catalysts, but they just exposed us to a better programming language that we now use in other ways.

  Message #188003 Post reply Post reply Post reply Go to top Go to top Go to top

I Hate JavaBeans

Posted by: Victor C. on October 17, 2005 in response to Message #187985
I agree about JavaBeans.
We use collections... w/ Groovy.
No way we could have done Groovy w/ J2EE. Groovy can use Java jars... unlike ruby.

.V

check out http://roomity.com for latest tech stories.

  Message #188004 Post reply Post reply Post reply Go to top Go to top Go to top

Behind Java

Posted by: Alain Rogister on October 17, 2005 in response to Message #187896
Could Ruby and frameworks such as Ruby on Rail be the next big thing?
No.
The only valid conclusion is that, for people who should probably not have been using J2EE in the first place because they build small CRUD-like web apps deployed on Tomcat with a single CPU, it makes more sense to use ASP.NET or PHP or Python or Ruby. Is anyone surprised ?
This is actually quite far from saying that the whole Java/J2EE platform will be displaced by an "innovation" like Ruby on Rails. Java will be displaced someday (just like COBOL was... no, wait!) but it will take considerably more than a tiny little Ruby framework. The innovations that Microsoft is working on for the CLR e.g. are much much more important and substantial than Rails: LINQ, C#3.0, the ML- and Haskell-inspired work done my MS Research...
Also, considering the investment done by the industry to adopt Java/J2EE over the past years, it is extraordinarily naive to imagine that entreprises are going to change course for a small, theoretical gain in development time that would affect only trivial web apps developed by teams of 2-3 and thrown away within 6 months. I don't foresee either any massive retraining of enterprise developers to Ruby. Nope, it's a fine language that has its place but it is foolish to imagine that it is compelling enough to replace an industry heavyweight standard like Java.
Out of curiosity, is anyone predicting that Common Lisp will displace Java ? Why not ? It's more powerful than any scripting language, it's an ANSI standard, it has industrial-grade commercial implementations, development is amazingly fast... Isn't there any consultant willing to publish a book about Common Lisp, the "next big thing", and bet his career on that ?

  Message #188005 Post reply Post reply Post reply Go to top Go to top Go to top

DSL Java

Posted by: Wes Biggs on October 17, 2005 in response to Message #187999
Absolutely agree, Erik. Java needs metaprogramming facilities that make it easily usable as a domain-specific language.

  Message #188006 Post reply Post reply Post reply Go to top Go to top Go to top

I don't get it

Posted by: geoff hendrey on October 17, 2005 in response to Message #187896
I don't understand why people talk about Ruby On Rails as a replacement for java. It's like saying "an apple is a replacement for food."

Ruby on Rails is for writing web applications, right? So while Ruby on Rails is a possibly better alternative to one of Java's many web frameworks - FOR WEB APPLICATIONS - I don't see how Ruby on Rails is in itself cpompetitive with Java.

Same goes for the whole inane argument that "php is better than java". Can I write a compiler in PHP? WTF?

What we do need to do, as a community is listen to what developers want in a language. In my opinion, Java 1.5 brought numerous not-so-good features to Java, at a very high development cost.

  Message #188008 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: David McCoy on October 17, 2005 in response to Message #188000
For that project, I think I would have chosen the same technologies. When you need to map, use a mapper. Rails uses a wrapping strategy.

But why use Rails? I mean, I've moved from C->C++->Java, so I'm not married to Java! Why use Rails for one and Java for another when the Java stuff can be coded *almost* as fast. I mean, we've seen the same arguments for say ColdFusion and Java, so Rails is nothing new on that front.

"Code twice as fast in half the code!!"

If you are willing to live within these confines. "But the confines aren't that bad.", says Person.

What exactly is the advantage of using Ruby, PHP, and Java for three different projects as opposed to one common code base where the common-code gets tested and improved for each project?

Raw coding speed? I'm asking...why introduce a new element? What am I gaining over what I have?

  Message #188010 Post reply Post reply Post reply Go to top Go to top Go to top

Metaprogramming == Attribute == Annotations == MDA/MDD

Posted by: Lofi Dewanto on October 17, 2005 in response to Message #188002
<quote>
The real meat is behind metaprogramming. How do you take a building block, and integrate it into the very core of the language? That way, your language grows with your domain. It feels like you are coding on a higher plane, becasue you *are* coding on a higher plane. Abstractions will inherently rise up over time.
</quote>

... therefore we have annotations in Java5
... therefore we are working towards MDA/MDD

Cheers,
Lofi.

BTW. AndroMDA supports directly the creation of CRUD functions/screens from the UML models

  Message #188012 Post reply Post reply Post reply Go to top Go to top Go to top

Groovy...

Posted by: Carl Mueller on October 17, 2005 in response to Message #187896
Groovy can do lots of the things that Ruby and other scripting langs can do. It is still rough, and I think they need to define better how it integrates with Java, but it can use java classes and the java API, and adds tons of neat features.

SInce it's JSR'd, it should rapidly develop into a formal scripting language for java-land, but I imagine its close association with Java may hamper its toolset and infrastructure, relative to Ruby which has full freedom to start anew.

  Message #188013 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Gabriel Guerrero on October 17, 2005 in response to Message #187896
Bruce I think you should take a look of http://jboss.com/products/seam
i think that and EJB3 are the future of java.

  Message #188014 Post reply Post reply Post reply Go to top Go to top Go to top

Common LISP

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #188004
Out of curiosity, is anyone predicting that Common Lisp will displace Java ? Why not ? It's more powerful than any scripting language, it's an ANSI standard, it has industrial-grade commercial implementations, development is amazingly fast... Isn't there any consultant willing to publish a book about Common Lisp, the "next big thing", and bet his career on that ?

Because I don't think anyone can explain Common LISP to the average programmer.

Maybe we can create a *real* role for the fabled "software architect."

It's the architect's job to implement the metaprogramming functionality that allows the rest of the team to work more efficiently.

Thinking that way is hard. Communicating it is even harder. If someone can do it, and do it repeatedly, then they really do deserve a lofty title.

  Message #188015 Post reply Post reply Post reply Go to top Go to top Go to top

10:1 compression of config?

Posted by: Carl Mueller on October 17, 2005 in response to Message #187982
Is this because you get to "cheat" and make code configuration? I have been playing with groovy, and by using GroovyMarkup, I can make config files that are automatically compiled to complex structures, since the config files are basically code scripts that are just defaulting variables.

What would you attribute the 10:1 compression of config? Because most config in java frameworks might not be useful to you, but it is there for a reason.

The big danger of dynamic compilation or interpretative langs is greying the code-configuration difference too much. Then systems become difficult to deploy and tweak, without having to risk changing code that may have ramifications elsewhere.

  Message #188017 Post reply Post reply Post reply Go to top Go to top Go to top

BINGO!

Posted by: Carl Mueller on October 17, 2005 in response to Message #187984
You nailed RoR's weakness on the head: Wizard code.

Why? It's basically a bunch of wizards. As we all know from code wizards, if you need to do something they don't do, you're stuck having to do it from the ground up again. But in RoR's case, since the entire community assumes that won't happen, there is very little documentation on how to do stuff from the ground up in Rails. Once it does happen, and less standard applications are documented, then the configuration will probably equal most mature java frameworks.

Ruby will always have advantages due to its superior syntactic sugar though.

This factor-of-ten statements being thrown around are almost always snake oil. There's fundamental complexity in systems, folks, and when the rubber hits the pavement in ugly legacy enterprise environments, there is no magic Ruby bullet, just like there isn't a magic Indian Outsourcing bullet, and there's no magical code generation layer bullet.

  Message #188018 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Konstantin Ignatyev on October 17, 2005 in response to Message #187982
For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails.
I would say that for this and all other types of web applications it would be crazy not to consider
DreamWeaver + Tapestry+ (Spring|HiveMind)+ Hibernate+ (Eclise+Spindle|IntellijIDEA) combo.

DW allows creating entire UI for the application in the DW and present/discuss/change it with customers! – before anything else is done – enormous time saver.

Tapestry allows using the DW output for development ( VERY noticeable difference from PHP/JSP when developers have to redo everything based on designers input)

Tapestry allows using DW for maintaining page and component templates (wow!).

(Spring|HiveMind) – does the plumbing

Hibernate – takes care of your database schema if we own the schema or allows us to play nicely with whatever schema is forced on us.

(Eclise+Spindle|IntellijIDEA) – enormously help with code creation and navigation – things which do not exist in the world of RoR.


PS: Thing to consider: RoR does not have decent i18n support...

  Message #188020 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Steve Zara on October 17, 2005 in response to Message #187982
For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive.

Then call me crazy! I have had just such an application. I used a well-regarded scripting language (Cold Fusion), as I had to take over the website and this is what the previous developers has used.

The problem is that the website (not just the schema) evolved. It required some high-performance database access and cacheing of data. It required some computation for things like best-offer calculation. Then, one day, the website was publicised in the media, and it died. It could not cope with the demand. Fortunately I had been working on a port to a Java-based version. Sooner than I had hoped, this port was put on-line, and the performance problems were solved.

Since then I have refused to go near a scripting or low-performance language for the development of a website where there is even the slightest possibility of increased requirements.

  Message #188021 Post reply Post reply Post reply Go to top Go to top Go to top

Service applications

Posted by: peter lin on October 17, 2005 in response to Message #187896
I haven't used ROR, but I have explored Ruby in the past as a potential platform for writing a RETE rules engine. The last time I worked on web UI was a few years back, but I'm curious to hear people's experience building service applications using ROR.

Back when I worked on web UI, it was service applications that had to support internationalization and co-branding. By co-branding, I mean services that can use one or more UI templates with a common business layer. Think of a portal that provides a variety of applications/features as discrete modules. From customer to customer, the UI requirements will change drastically and the data has to move between systems in a relatively seamless manner.

When data changes, it's not just 1 database. It's several service calls between 4-8 systems. Has anyone attempted to build this type of service using ROR?

I'm just curious.

peter

  Message #188023 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Bill Burke on October 17, 2005 in response to Message #187896
Please tell me how you can refactor in untyped languages. Just go down the list of IntelliJ's refactoring menu and describe to me how it is even possible to do it without a type system.

  Message #188024 Post reply Post reply Post reply Go to top Go to top Go to top

Metaprogramming == Attribute == Annotations == MDA/MDD

Posted by: Pavel Tavoda on October 17, 2005 in response to Message #188010
I would like to say same. We are using aproaches similar to MDA for 7 years now with great success. With new project we jumped to AndroMDA because of XMI/UML support for many UML tools. Again with great success. Please all of you which speak for Rails. Are you looking deep enough to Java:
- MDA
- Annotations
- AOP
- APT in Java 6.0

I hope somebody at sun understand importancy of APT tool in Java 6. Together with Abstract Syntax Tree it will be great thing and allow translate following code:
############################
class A {
@NonNull String name;
@NonNull @GetOnly Integer age;
}
############################

To:
############################
class A {
String name;

public String getName() {
return name;
}

Integer name;
public void setName(String newName) {
if (n==null) throw ...
name=newName;
}

public Integer getAge() {
return age;
}

}
############################
Or multitier classes or anything you want.

  Message #188025 Post reply Post reply Post reply Go to top Go to top Go to top

4 days porting != development

Posted by: Bill Burke on October 17, 2005 in response to Message #187896
Porting an app is 1000 times easier than actually writing an app. Especially if you are already an expert at the new language u r porting 2.

  Message #188026 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Brian Miller on October 17, 2005 in response to Message #187982
You start with basically a working CRUD app per table. Windows to do list, show, edit, delete, new. Sure, you'll rewrite some, but you can put something in front of your customer instantly. That's compelling.
Methodologically speaking, that's an executable model. Didn't Sun's Rave and Ace projects already have that fully tooled before RoR? Also other open source projects predated RoR, such as middlegen and JAG.
Much better AJAX, and cleaner view technology.
Interesting.

  Message #188027 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Steve Zara on October 17, 2005 in response to Message #188023
Please tell me how you can refactor in untyped languages. Just go down the list of IntelliJ's refactoring menu and describe to me how it is even possible to do it without a type system.

I'm not sure what you mean by untyped (this and the term 'dynamically typed' still confuse me, after decades). However, take a look at any good Smalltalk implementation. Smalltalk is untyped (or dynamically typed) in the same way that Ruby is, but has a huge amount of refactoring tools. In fact some of the first uses of the term 'refactoring' were regarding Smalltalk.

  Message #188028 Post reply Post reply Post reply Go to top Go to top Go to top

Expressivity is not it

Posted by: Guglielmo Lichtner on October 17, 2005 in response to Message #187896
The fact that this application (typical 3-tier app, it sounds like) could be written more quickly with a more expressive language is not surprising. After all, it's more expressive.

To me Java's success is due to the following:

1. The syntax is C's syntax. No other syntaxes have made it big in strongly typed languages so far.

2. It was (wisely) designed to be a relatively incremental change on an existing language (C++). That's a safe approach, and it paid off big time.

3. The differences with C++ are designed to make the average developer much more effective.

So Java did well because it's designed with staffing requirements in mind. People who use it mostly get by, but it's got problems for very simple programs and for very complex programs.

To me the next big thing will come when someone figures out a set of languages designed to support different operations, but which are designed in concert so that they integrate cleanly and also efficiently.

The question is, would people get on board with this? And I think the answer is yes. People already know HTML, JavaScript, Java, SQL, etc. and many many APIs which contain as much information as a language would.

Guglielmo

  Message #188029 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: dylan stamat on October 17, 2005 in response to Message #187896
After coding an app in RoR, I felt refreshed.
It was nice to be able to get something up and running so quickly.

However, I'm going to give a +1 to what Konstantin Ignatyev noted. The i18n support is almost non-existant at the moment.

  Message #188030 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Henrique Steckelberg on October 17, 2005 in response to Message #187982
RoR's specific niche is a very dangerous one, which may be too narrow for too many types of projects: if app grows too complex, which BTW is what I've seen in 90% of the projects I've worked on, I wonder how will RoR behave. Will it have too many growing pains? If so, the immediate gains would be lost down the road when people try to maintain the unmaintainable, as further on your system will need to integrate with other systems, migrate to a diferent database, etc, as usually happens specially in big corporates. At least where I work, this happens very often. Does someone know how RoR compares to Java WRT maintainability and scalability?

  Message #188034 Post reply Post reply Post reply Go to top Go to top Go to top

Expressivity is not it

Posted by: Steve Zara on October 17, 2005 in response to Message #188028
People who use it mostly get by, but it's got problems for very simple programs and for very complex programs.

I use Java for very simple programs (things others might use a scripting language for) when I need performance (simple data transforms, for example). It works fine, just in the same way that many UNIX developers will use C to write simple programs. As for complex programs, how much more complex can you get than a rich IDE or App server?

I don't just get by with Java. In combination with a powerful IDE I find it rich and reasonably expressive. It has faults, but what doesn't?

I'm not saying you are wrong, but I would be interested to know what you mean; what the issues are.

  Message #188037 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Bill Burke on October 17, 2005 in response to Message #188027
Please tell me how you can refactor in untyped languages. Just go down the list of IntelliJ's refactoring menu and describe to me how it is even possible to do it without a type system.
I'm not sure what you mean by untyped (this and the term 'dynamically typed' still confuse me, after decades). However, take a look at any good Smalltalk implementation. Smalltalk is untyped (or dynamically typed) in the same way that Ruby is, but has a huge amount of refactoring tools. In fact some of the first uses of the term 'refactoring' were regarding Smalltalk.

So, if you have dynamic typing, how can you do something as simple as find all usages of a specific class? Or how about renaming a method/field in your entire code base? Those are the simple things. What about more complex things like moving methods around between classes and being automatically warned where things will get messed up?

I don't know smalltalk, but have used tcl, perl, python, php. Please, i'm open minded, elaborate.

thanks, bill

  Message #188038 Post reply Post reply Post reply Go to top Go to top Go to top

OR you can do same thing in JAVA!!

Posted by: Nitesh Neema on October 17, 2005 in response to Message #187896
see
https://trails.dev.java.net/

its not mature yet, but promising.

if you can do same thing with evolution instead revolution its preferable.

  Message #188039 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Andrew McVeigh on October 17, 2005 in response to Message #188037
...So, if you have dynamic typing, how can you do something as simple as find all usages of a specific class? Or how about renaming a method/field in your entire code base? Those are the simple things. What about more complex things like moving methods around between classes and being automatically warned where things will get messed up?I don't know smalltalk, but have used tcl, perl, python, php. Please, i'm open minded, elaborate.thanks, bill

I've used smalltalk commercially, and the browsers supported finding all possible usages of the class etc. You tend to look at all possible examples of the message send "foo:" which tends to give you sometimes more than you want.

On the refactoring front, however, you may be surprised to learn that the early refactoring work was actually done with Smalltalk. In particular, Will Opdyke's thesis introduced a refactoring smalltalk browser. Refactoring is about preserving invariants.

Cheers,

Andrew

  Message #188040 Post reply Post reply Post reply Go to top Go to top Go to top

RoR and frameworks in general

Posted by: Bryant Harris on October 17, 2005 in response to Message #187896
I spent about half a day playing with Ruby on Rails when the hype started a few months back (particularly when someone mentioned it as a potential 'disruptive technology' for those of you familiar with Clay Christensen).

I think the most compelling lesson from RoR is the fact that the frameworks allow you to create working code so quickly. Every time I try a new open source product I know I'll inevitably hit a point where things stop working and I have to start digging around in the config for a typo. Work completely unrelated to the job I'd like to be focusing on.

The fact that RoR lets you spit out the files its automagically creating is a great head start and one that Java frameworks could emulate. Imagine if in struts you could just imply a link between an action and jsp through something like a naming convention (e.g. MyAction, My.jsp) and it just worked. No need to explicitly specify it in a file.

Or even better, if while writing my action I just put beans I need to display in a certain well known location of one of the contexts such as /output/MyBean, /output/AnotherBean and then don't even bother with writing the JSP, something just displays the beans and its attributes.

It would be a huge time saver. Then as the project starts to mature and I need multiple outputs for and action I would get it to spit out a 'proper' struts config, and generate the display JSPs as starting points for creating a real UI and tightening down the configuration.

I'd rather focus on the code I need to write instead of plumbing. Of course at some point I'll need to refine the plumbing, but a lot of these frameworks making plumbing a requirement at all times.

  Message #188042 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: David McCoy on October 17, 2005 in response to Message #188020
For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive.
Then call me crazy! I have had just such an application. I used a well-regarded scripting language (Cold Fusion), as I had to take over the website and this is what the previous developers has used.The problem is that the website (not just the schema) evolved. It required some high-performance database access and cacheing of data. It required some computation for things like best-offer calculation. Then, one day, the website was publicised in the media, and it died. It could not cope with the demand. Fortunately I had been working on a port to a Java-based version. Sooner than I had hoped, this port was put on-line, and the performance problems were solved.Since then I have refused to go near a scripting or low-performance language for the development of a website where there is even the slightest possibility of increased requirements.

Exactly. Why not, instead, start with a base that you KNOW can scale up. I told our management that I can do anything Coldfusion can, at least *almost* as quickly. At least. Except, any of our java guys can maintain this project. And if it grows, the systems will grow with it.

  Message #188043 Post reply Post reply Post reply Go to top Go to top Go to top

Expressivity is not it

Posted by: Guglielmo Lichtner on October 17, 2005 in response to Message #188034
People who use it mostly get by, but it's got problems for very simple programs and for very complex programs.
I use Java for very simple programs (things others might use a scripting language for) when I need performance (simple data transforms, for example). It works fine, just in the same way that many UNIX developers will use C to write simple programs. As for complex programs, how much more complex can you get than a rich IDE or App server?I don't just get by with Java. In combination with a powerful IDE I find it rich and reasonably expressive. It has faults, but what doesn't?I'm not saying you are wrong, but I would be interested to know what you mean; what the issues are.

As for simple programs, it's a compiled language. If all I have to do is some trial-and-error, it's easier with an interpreted language.

And IDE or App server are not that complex. I am no expert on complexity, but a simple way for me to understand it is pattern density. Well-designed IDEs have lots of patterns (same with app servers.) Whereas an insurance brokerage application, for example, has very simple code but a very large amount it, and it's all business logic, because it has to implement rules defined in each of the 50 US states.

I didn't mean to say that there are other things that are better than Java right now. In fact, I meant to say that Java is a success because it was designed for use in a corporate environment, not in a lab.

As someone said, perfection is achieved only on the point of collapse.

  Message #188044 Post reply Post reply Post reply Go to top Go to top Go to top

BINGO!

Posted by: Ian Schumacher on October 17, 2005 in response to Message #188017
You nailed RoR's weakness on the head: Wizard code.

I have not used RoR, but I strongly suspect that the main reason it is more productive initially is because it is essentially a wizard/template i.e. a web framework generator.

Is this a good idea? Sure why not. Is this something that is somehow unique to RoR and can only be done with the Ruby language? I fail to see how or why. Exactly what language feature exists in Ruby that makes this impossible in Java?

Back when I used to do ActiveX programming, Microsoft had a whole template and wizard system for generating ActiveX objects. Click new project, select ActiveX wizard, presto change-o instant working ActiveX component. Talk about productivity :-) ActiveX programming can be a little tricky and so wizards like this can seem amazingly productive to newbies. However, the code was very hard to understand, and doing something outside of the "anticipated" could turn out to be extremely difficult. Similar to GUI builders back in the day I assume (I did not do GUI). Really impressive for quickly generating an application, but difficult to maintain and customize. From my anecdotal experience, the more expert a programmer is, the less likely they are to use these wizards/templates ... why is that? Many companies had started off with this approach (the ActiveX templates to create OLE DB drivers in this case), and this got them 80% quickly, but then they became so stuck that they ended up coming to the company I worked for to buy a hand coded toolkit (also just another template :-)

So templates can get you very far very fast for niche solutions, but deviating outside of the "model" can result in disaster -- again from my anecdotal experience. Are things different this time around for RoR?

Ian

  Message #188045 Post reply Post reply Post reply Go to top Go to top Go to top

DoD Common Higher Order Language Program

Posted by: Guglielmo Lichtner on October 17, 2005 in response to Message #187896
This was behind the ADA language, and I think it indirectly influenced C++.

It's interesting that the language requirements set forth here are designed for embedded, military systems. That's what we are using.

http://www.adahome.com/History/Steelman/steeltab.htm

In 1975 the U.S. Department of Defense (DoD) established a "Common High Order Language" program with the goal of establishing a single high order computer programming language appropriate for DoD embedded computer systems. A High Order Language Working Group (HOLWG) was established to formulate the DoD requirements for high order languages, to evaluate existing languages against those requirements, and to implement the minimal set of languages required for DoD use. The requirements were widely distributed for comment throughout the military and civil communities, producing successively more refined versions from Strawman through Woodenman, Tinman, Ironman, and finally Steelman. Steelman was released in June 1978 [DoD 1978]. An electronic version of Steelman is available at "http://www.adahome.com/History/Steelman/intro.htm". The original version of the Ada computer programming language was designed to comply with the Steelman requirements.

  Message #188046 Post reply Post reply Post reply Go to top Go to top Go to top

Common Lisp, Scheme, Perl, Tcl, zorglub ...

Posted by: Jean-Christophe P on October 17, 2005 in response to Message #188014
> Because I don't think anyone can explain Common LISP to the average programmer.

Come on Common Lisp is *far* simplier that Java or Ruby ....
(and even CLOS is far easier than java 5.0)
and at least closure are not first class citizen in CL.
And why someone did invent a so complex syntax (Ruby)
on top of scheme ????


BTW I still do not understand why people argue
on Perl vs Python vs Ruby ...
THEY ARE ALL THE SAME
(except for some syntactic sugar: dynamic, OO,...)
and what this big deal concerning
the differences between Java and Ruby ?
What is so innovative in Ruby ... (I mean by 200x stnadards and not back in 80's ...) ...
humm
(browsing the doc ....)
(the syntax which seems even worst than perl)
Bingo ... Ruby do have closure ....
humm that's all
and Java is stronger typed ... fair enough ....

So I bet that they used a lot of closures in
Beyond Java :P

Think differently ...

  Message #188049 Post reply Post reply Post reply Go to top Go to top Go to top

BINGO!

Posted by: Konstantin Ignatyev on October 17, 2005 in response to Message #188044
You nailed RoR's weakness on the head: Wizard code.
....
 Are things different this time around for RoR?Ian
I would say yes. With RoR it is different because RoR is a not that of a wizard but more like DSL (Domain Specific Language ).
I am a big fan of DSL and believe that DSL is the Next Big Thing when tools like JetBrain’s MPS will mature enough ( the idea of DSL is around for decades and that verifies its viability IMO).

In the meantime I would more trust ‘internal’ DSL simulation by the means of traditional languages which benefit enormously from the help of mature tool and infrastructure.

Neal Ford hosted very good session on DSL at the last NFJS, highly recommend both.

  Message #188050 Post reply Post reply Post reply Go to top Go to top Go to top

On Java!

Posted by: Cameron Purdy on October 17, 2005 in response to Message #187983
I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!

The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?

Peace,

Cameron Purdy
Tangosol Coherence: The Java Data Grid

  Message #188052 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: peter lin on October 17, 2005 in response to Message #188050
I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!

The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?
Peace,
Cameron PurdyTangosol Coherence: The Java Data Grid

that's the question I asked myself when the thread first appeared. clearly, the JVM can support a language like jython, so it should be able to support ruby. I'm sure the .NET team is working hard to make the CLR more friendly towards scripting languages like IronPython. Would anonymous types in .NET make it easier to write a ruby interpreter? Maybe someone from the jython or groovy team can shed some light.

peter lin

  Message #188053 Post reply Post reply Post reply Go to top Go to top Go to top

BINGO!

Posted by: Ian Schumacher on October 17, 2005 in response to Message #188049
You nailed RoR's weakness on the head: Wizard code.
....&nbsp;Are things different this time around for RoR?Ian
I would say yes. With RoR it is different because RoR is a not that of a wizard but more like DSL (Domain Specific Language ).

DSL's are an interesting idea, I was not aware that Ruby could be used to write DSLs. That is a pretty nifty language feature -- I guess I will have to look into how it does this finally. Been putting off this whole investigating RoR thing ;-)

  Message #188058 Post reply Post reply Post reply Go to top Go to top Go to top

PHP and Perl

Posted by: Cedric Beust on October 17, 2005 in response to Message #187991
I don't think history is on your side here. You don't have to try either one for very long to know that they are excellent prototyping languages, but will have trouble scaling. I think Ruby on Rails is different. It's much cleaner, from a design perspective, and just as productive...even more so.
Actually, it seems to me that history is not really on your side either...

PHP has thousands of visible applications out there (and who knows how many more internal), some of which very big, and I would argue that its scalability to cover 95% of possible web applications has been solidly established.

Ruby on Rails is nowhere near there. And don't take this as a jab against it, I love Ruby and I love Ruby on Rails, but there's a difference between loving and falling in love :-)

Ruby itself has some dire performance problems that will probably prove to be challenging for Ruby on Rails.

Again: not saying that these problems will materialize, just that so far, neither Ruby nor RoR have really proved themselves in the field. And they probably never will it they don't get accepted at ISP's around the world.

--
Cedric

  Message #188059 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring!

Posted by: Bruce Tate on October 17, 2005 in response to Message #188023
In many ways, refactoring is much easier in dynamic languages. Here are a few examples:

- I need to change a type. Like an integer overflows. In Java, it hits the instance variable, and all method interfaces that it touches, and all usages of those instance variables. Ruby, Smalltalk or Python, one line of code.

- I need to get a mock object into a hard-to-reach place. In Java, base everything on a loosely coupled architecture, with DI throughout all of the major layers of your app. In Ruby, I just change the setter on the live class.

- Crosscutting concerns. In Java, invent AOP. In Ruby, use a mix in or code an interceptor (around 3 lines of code, plus whatever the interceptor does.

I think refactoring in Ruby is much, much easier...thus the term dynamic language. I'll grant that if you've got a language that's as full of repetition as Java, it's more of a problem for you. You have to "refactor" an attribute, because of the repetition.

I also miss the IDEs for statically typed languages. But they will come for Ruby.

  Message #188060 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Bruce Tate on October 17, 2005 in response to Message #188042
For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive.
Then call me crazy! I have had just such an application. I used a well-regarded scripting language (Cold Fusion), as I had to take over the website and this is what the previous developers has used.The problem is that the website (not just the schema) evolved. It required some high-performance database access and cacheing of data. It required some computation for things like best-offer calculation. Then, one day, the website was publicised in the media, and it died. It could not cope with the demand. Fortunately I had been working on a port to a Java-based version. Sooner than I had hoped, this port was put on-line, and the performance problems were solved.Since then I have refused to go near a scripting or low-performance language for the development of a website where there is even the slightest possibility of increased requirements.
Exactly. Why not, instead, start with a base that you KNOW can scale up. I told our management that I can do anything Coldfusion can, at least *almost* as quickly. At least. Except, any of our java guys can maintain this project. And if it grows, the systems will grow with it.

Ruby is much more dynamic, and handles complexity very well. It's a model-view-controller style design pattern. It defaults everything, but many Java developers confuse this with hard wiring. It isn't. And Ruby metaprogramming gives me things Cold Fusion could only dream about.

  Message #188061 Post reply Post reply Post reply Go to top Go to top Go to top

PHP and Perl

Posted by: Bruce Tate on October 17, 2005 in response to Message #187991
I didn't use PHP or Perl because I think they are quick and dirty. I think Ruby on Rails is quick and clean.
So try PHP or Perl, probably it is not so dirty as you think ( but I am afraid it is too late to write best sellers about this stuff).
I don't think history is on your side here. You don't have to try either one for very long to know that they are excellent prototyping languages, but will have trouble scaling. I think Ruby on Rails is different. It's much cleaner, from a design perspective, and just as productive...even more so.

Good points. But I could simply replace C++ and Java, and change the date on your post, and it would apply. I'm watching many of the Java visionaries ramp up to do Ruby on Rails. Some of the people I trust the most, Martin Fowler, Dave Thomas, James Duncan Davidson, Mike Clark and David Geary all are going to make money this year on Ruby on Rails. Some still do some Java, and others don't.

Re. PHP and Perl, both have enormous maintenance problems. Both can be done well; both usually aren't. I think you know that and are being argumentative. The Perl community is being gutted as we speak by Perl. And PHP makes it easier to do the wrong thing than the right thing. Ruby on Rails is quick, and clean.

  Message #188062 Post reply Post reply Post reply Go to top Go to top Go to top

On Java!

Posted by: Erik Engbrecht on October 17, 2005 in response to Message #188050
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?

I don't see that as the issue.

In my opinion, for every thing dynamic languages give you, they also take something away.

Depending on your application you may be better or worse off for the trade.

I want the best of both worlds.

I've used Python a lot, and I don't buy the argument that dynamic typing makes things easier. Maybe I'm just too stuck in the C++/Java way of thinking, but I like having static types. I also like metaprogramming. In fact, I think metaprogramming would be more powerful with static typing than without.

  Message #188063 Post reply Post reply Post reply Go to top Go to top Go to top

10:1 compression of config?

Posted by: Bruce Tate on October 17, 2005 in response to Message #188015
Convention over configuration. Look at a typical Spring context and tell me how much could be defaulted. And I think that Spring one of the most productive Java frameworks. Look at the amount of Struts configuration related to navigation. Could you short circuit that?

When you make assumptions about naming and navigation, and suggest those conventions, you only have to break your rules a small fraction of the time.

  Message #188064 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring!

Posted by: Cedric Beust on October 17, 2005 in response to Message #188059
In many ways, refactoring is much easier in dynamic languages.
It's easier because it's much more limited :-)

Your examples only touch the very easy (and somewhat rare) cases of refactorings. They also only show dynamic refactorings as opposed to simple static (at the text editor level, not design).

With dynamic languages, something as simple as renaming a method in a class can pretty much only be done by text replacing, which is of course unacceptable.

People who say that Smalltalk showed that it was possible have obviously never used Smalltalk IDE's, which only did the simplest refactorings (such as extracting methods).

Modern Java IDE's have raised the bar very high in terms of refactorings, and as far as I can tell, it's just plain impossible to reach that bar with dynamic languages.

Now, somebody prove me wrong and write a killer Ruby Eclipse plug-in, and *then* we might be talking about the Next Big Thing.

--
Cedric

  Message #188065 Post reply Post reply Post reply Go to top Go to top Go to top

4 days porting != development

Posted by: Bruce Tate on October 17, 2005 in response to Message #188025
What if you're not familiar to the language? As far as I know, Justin had never written a line of Java code.

But my productivity has held up in Ruby.

  Message #188066 Post reply Post reply Post reply Go to top Go to top Go to top

Java = mandated complexity

Posted by: Marc Stock on October 17, 2005 in response to Message #187896
To me, the interest in RoR by the Java community stems from a degree of desperation for something that's not retardedly complex ALL THE TIME. There's a certain culture to the Java world that seems to lean toward complexity. Even the Java frameworks that are created to reduce complexity are released, they are merely half steps away from more complex solutions. I think if someone were to build something that wasn't complex the Java community would make a mockery of them. It's sad.

Many years ago I was working for an company that wanted to do a technology comparison between VB and Java. So I built the same application twice in both languages. I was stunned how rediculously complex Swing was to build a UI with. Building the same UI in VB was many times faster. Now, there's certain things you cannot do in VB that you can do in swing like mixing a tree with a table but how many people actually need to do that? Not many. I've never seen an app that does. Unfortunately, Sun never opted to implement some decorators and whatnot to cover the complexity of Swing for the 95% of the projects that don't need their more complex options.

I'm no fan of RoR, but what the Java community needs to take away with them is the idea that we don't always need to design things to handle every possible contingency. And where possible provide higher layers to more complex APIs that allow for easier use by projects with more meager requirements.

The language also could use some sprucing up. I get very angry every time I have to generate getters in setters (yes, I'm angy all the time). Seriously, can't we move beyond this? It's pathetic. Sun needs to get a clue and get off their ass and make the language more useable and worry less about inbedding javascript engines...wtf.

Finally, when we build new APIs, we need to seriously work on our logging. Sometimes its truely pathetic. JSF is brand new and it's logging is absolutely horrid. I'm on a project using the latest version of the Sun reference implementation and if it were up to me I would have told them to avoid JSF like the plague simply because their logging is shameful. I will go so far as to say that it's simply incompentent.

The KISS principle just doesn't exist in the java community and it's a shame. Are we all so worried about job security?

  Message #188067 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: Bruce Tate on October 17, 2005 in response to Message #188029
After coding an app in RoR, I felt refreshed.It was nice to be able to get something up and running so quickly.However, I'm going to give a +1 to what Konstantin Ignatyev noted. The i18n support is almost non-existant at the moment.

An excellent point. I'd add 2pc, orm, and database constraints.

  Message #188068 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: David McCoy on October 17, 2005 in response to Message #188060
For at least one class of applications, web-based apps on a relational database where you control your own schema, you'd be crazy not to consider Rails. It's just too productive.
Then call me crazy! I have had just such an application. I used a well-regarded scripting language (Cold Fusion), as I had to take over the website and this is what the previous developers has used.The problem is that the website (not just the schema) evolved. It required some high-performance database access and cacheing of data. It required some computation for things like best-offer calculation. Then, one day, the website was publicised in the media, and it died. It could not cope with the demand. Fortunately I had been working on a port to a Java-based version. Sooner than I had hoped, this port was put on-line, and the performance problems were solved.Since then I have refused to go near a scripting or low-performance language for the development of a website where there is even the slightest possibility of increased requirements.
Exactly. Why not, instead, start with a base that you KNOW can scale up. I told our management that I can do anything Coldfusion can, at least *almost* as quickly. At least. Except, any of our java guys can maintain this project. And if it grows, the systems will grow with it.
Ruby is much more dynamic, and handles complexity very well. It's a model-view-controller style design pattern. It defaults everything, but many Java developers confuse this with hard wiring. It isn't. And Ruby metaprogramming gives me things Cold Fusion could only dream about.

But ColdFusion is simpler, right? If I need to do things that ColdFusion can only dream about I'm still back at java.

I have to tell you, I'm just not convinced. If Ruby handles complexity so well, why is everyone talking about CRUD operations and prototyping small apps.

I just don't buy it. My interpretation of the examples that you and others have given indicate to me that handles simple cases simply and would not handle grow well. You yourself said that if you need to map class attributes to names that are different that database columsn that use an ORM.

That is a very reasonable example I gave that already appear to neutralize the terseness of the example you gave.

Ah well, I guess we'll all see how it plays out...

  Message #188069 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Bruce Tate on October 17, 2005 in response to Message #188030
RoR's specific niche is a very dangerous one, which may be too narrow for too many types of projects: if app grows too complex, which BTW is what I've seen in 90% of the projects I've worked on, I wonder how will RoR behave. Will it have too many growing pains? If so, the immediate gains would be lost down the road when people try to maintain the unmaintainable, as further on your system will need to integrate with other systems, migrate to a diferent database, etc, as usually happens specially in big corporates. At least where I work, this happens very often. Does someone know how RoR compares to Java WRT maintainability and scalability?

The structure of RoR applications is much cleaner than Java counterparts. I'd guess the maintenance will be simpler, but I can't say for sure.

  Message #188070 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: Bruce Tate on October 17, 2005 in response to Message #188050
I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?Peace,Cameron PurdyTangosol Coherence: The Java Data Grid

I'm very interested in JRuby. I'm about ready to start promoting unit tests for Java in the Ruby language. JRuby is not there yet, but it's getting very close. I think it's passing more than 90% of the existing Ruby test cases now.

  Message #188071 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Michael Galpin on October 17, 2005 in response to Message #187972
Right then. Someone then says 'Sorry wrong database - we need this on a different vendor's system and it will need to cope with future schema changes'.

You're not too familiar with RoR are you? It uses an O/R layer, similar in some ways to Hibernate, to hide DB specific code/queries from the application developer. In addition, its "out of the box" functionality make it so that a schema change is automatically reflected in the UI, with no code change at all. So if you add a column to table and have a web page that lists entries from that table or one that shows details about a row of data, this pages will show the new column without any code being written, or even any configuration files changed.
Rapid development does not always (or I would say 'often') outweight long-term maintainability.

And long-term maintainability is grossly overvalued. I don't know how many times I've seen projects where the architecture was designed for the application to last for decades and wither any "big" changes in business model. Then the inevitable "big" change in business model happens. A quick adjustment is either attempted unsucessfully, or it is just recognized that major code changes are going to be needed despite the original grand architecture.

I've seen this happen to big software products. I've seen it happen to numerous Fortune 100 companies, not to mention smaller companies and start-ups as well. In almost every case, they would have benefitted more from a rapid development than from "flexible" architecture. It's these real-world lessons learned that have spurned the development of things like RoR.
Exactly how? I have found the much of Java 5.0 has made the simplest problems far, far easier to solve, with less verbose and faster code.
Have you seen some of the great new Java 5 syntax? How about we compare the signiature (from the Javadoc) for Collections.binarySearch(). Searching a collection for something is pretty simple task, right? First the old JDK 1.4.2
public static int binarySearch(List list,
                               Object key)
Now JDK 5.0:
public static <T> int binarySearch(List<? extends Comparable<? super T>> list,
                                   T key)
How can that be described as anything but more complex? Other examples of extra complexity introduced in Java 5.0 are annotations and the concurrency packages. As an experienced developer, I welcomed these additions as they provided extra power to the programmer. But you must recognize that for somebody new to Java, these things can look like voodoo.
As Spring, Hibernate and other technologies start to move into the mainstream of Java use, and as the latest release of Java (5.0), which has more changes than any release of Java for years, moves into mass use, saying Java 'is showing signs of wear' seems a bit strange.
Actually it's the emergence of projects like Spring and Hibernate that showcase Java's age the most. If you wanted to teach newbie programmer to write a simple web application, would you just tell him to learn JDBC and JSPs? Or would you tell them to learn JDBC and JSP, then JSTL, then JSF, and then EJBs? Or would you tell them to learn JDBC and JSP, then Struts, then Hibernate, and maybe then also Spring? Struts, Hibernate, and Spring all came about because of the shortcomings of "standard" Java technologies. It winds up being a huge stack of technologies to learn and you really see the age of things as you see how these incremental technologies cover up the wrinkles of the standard technologies they were built on and complement.

  Message #188072 Post reply Post reply Post reply Go to top Go to top Go to top

Groovy...

Posted by: George Coller on October 17, 2005 in response to Message #188012
... SInce it's JSR'd, it should rapidly develop into a formal scripting language for java-land, but I imagine its close association with Java may hamper its toolset and infrastructure, relative to Ruby which has full freedom to start anew.

I was in love with the idea of Groovy - about 2+ years ago when it seemed to have some promise. Talk about an extremely good idea left to rot out in no-man's land. Where is the community interest, books, injection into frameworks, tool support etc? The last serverside article I could find that directly was about groovy evoked a paltry 10 responses with 3 from the author.

And so what if it is a JSR? I'm sure the Java vineyard is riddled with JSRs that died on the vine. Not that I'm whining.

  Message #188074 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring!

Posted by: Dennis Bekkering on October 17, 2005 in response to Message #188064
how refactorable is the usual web app? not that much with all this expressions refering java methods. {$someAttribute.anotherProperty} , bean:write property=whatever etc etc. Still have to use a search/replace text tool.

I'v recently did a count on how many times a single entity's property is written somewhere in the project i am currently working on, 60 times!!! All I do is typing the same words all over and over and over again.

That together with the 2 minutes i have to wait for every change in an xml file or api change makes me wonder how many people will continue to buy it. What if there comes a stack that does not have all the problems of ROR, what if ROR eventually becomes that stack. Java was slow remember. If every java framework would make their xml reloadable after modifications and someone makes a hot code swap that supports API changes I won't go anywhere, i will not wait forever though.

  Message #188075 Post reply Post reply Post reply Go to top Go to top Go to top

invokedynamic

Posted by: Alain Rogister on October 17, 2005 in response to Message #188050
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?
See this for a start.

  Message #188076 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: Ian Schumacher on October 17, 2005 in response to Message #188067
After coding an app in RoR, I felt refreshed.It was nice to be able to get something up and running so quickly.However, I'm going to give a +1 to what Konstantin Ignatyev noted. The i18n support is almost non-existant at the moment.
An excellent point. I'd add 2pc, orm, and database constraints.

And the availability of a massive amount of high-quality open-source libraries and tools.

  Message #188077 Post reply Post reply Post reply Go to top Go to top Go to top

thanks for the link

Posted by: peter lin on October 17, 2005 in response to Message #188075
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?
See this for a start.

assuming this gets implemented in a future JVM, and there's a robust ruby interpreter for the JVM, wouldn't that mean java can accomodate ROR fans and provide an easier way to integrate java components?

peter

  Message #188078 Post reply Post reply Post reply Go to top Go to top Go to top

Common LISP

Posted by: Alain Rogister on October 17, 2005 in response to Message #188014
Because I don't think anyone can explain Common LISP to the average programmer.Maybe we can create a *real* role for the fabled "software architect."It's the architect's job to implement the metaprogramming functionality that allows the rest of the team to work more efficiently.Thinking that way is hard. Communicating it is even harder. If someone can do it, and do it repeatedly, then they really do deserve a lofty title.
A programmer who cannot grok Common Lisp will not grok meta-programming constructs or closures in Ruby either I'm afraid. You are right in saying that the meta-programming facilities can be used by technical leads for creating frameworks and domain-specific languages that abstract away some of that complexity for the more junior or less skilled developers.

  Message #188079 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: George Coller on October 17, 2005 in response to Message #187896
A lot of the posters here seem a tad, um - defensive. Many of the responses run the line of: 4 nights != development, blah blah.

It sure is easier to crank out a knee-jerk reaction to the serverside poster's one-paragraph summary than to take the time to read and possibly think about Bruce's article.

Here is an actual quote from that article to help clarify some of the lazier posts:
I was working an a project with Justin Gehtland with a small startup in Austin. We implemented a simple application with Spring, Hibernate, and Webwork, the classic lightweight stack of technologies for Java. We were pleased," recalls Tate. "On a whim, we both decided to try Ruby on Rails over the same weekend. I called Justin to tell him I'd implemented the model on Rails, but he told me he'd implemented the whole application, in four nights! We were both blown away. As a Java guy, I pulled back to do some research, and I found that compared to the so called dynamic languages, Java was limited. Further interesting innovations in dynamic languages were happening, and some of them were doing things that Java couldn't. Then, this book came pouring out.

Regardless of the details, Bruce was impressed with how productive RoR was on this task. This impression led Bruce to think about many of Java's "limitations" and then to write a book about it. Is that a controversy?

I think it is fairly certain that some development technology will come along to replace Java as king in the next few years if computer science history is any indicator. I don't think Bruce's point is that RoR is for sure that technology but that it spotlights some of the Java platform's weaknesses. It is those weak spots that newer technologies can overcome more easily. Why? Partly I think because the more successful a technology becomes the less it can (or is allowed to) change. See all the freak-out posts regarding Java 1.5's new features for proof. Every one of them was seen as the end of the world by some purists. Auto-boxing, Generics, Annotations, oh my!

Will Java ever die? Probably not in our career-span so relax your job is somewhat safe. Will it be sidelined? Most assuredly, so maybe start paying attention to the new ideas.

  Message #188081 Post reply Post reply Post reply Go to top Go to top Go to top

The community

Posted by: Bruce Tate on October 17, 2005 in response to Message #188076
And the availability of a massive amount of high-quality open-source libraries and tools.

Outstanding post!

That argument is the crux of it, isn't it? In the book, I listed Java's community and the JVM as the most important assets of Java. But despite community and momentum, old languages do get displaced, and new ones ramp up.

I don't know if Ruby on Rails is next. In Beyon Java, I just talk about the rise of Java, compromises that we had to make to establish it as the most successful language of all time, and then I look at the catalysts that could make another language emerge.

I don't exclusively trust my own opinions on this topic, so I interviewed other Java and programming language visionaries, and published those interviews with the book. I don't say this is next, or that is next. I just suggest that it's time to pick up our eyes, and start paying attention again. For a long time, it was more productive to ignore the rest of the world, because Java was so dominant compared to everything else. I think that will change soon, but I'm just one tiny voice.

  Message #188082 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: Alain Rogister on October 17, 2005 in response to Message #188077
assuming this gets implemented in a future JVM, and there's a robust ruby interpreter for the JVM, wouldn't that mean java can accomodate ROR fans and provide an easier way to integrate java components?peter
Absolutely. And here are some more links to innovations coming someday to a virtual machine near you (in this case mostly the CLR, sorry, but we can expect similar stuff for the JVM too):
Composable memory transactions
Language-integrated query
C-omega
F-sharp, an ML-derived language for the CLR
IBM's X10 programming language (targetting the JVM)
All these things explain why I get annoyed at the sheer ignorance of people who imagine that a simple-minded little framework for building toy apps in a currently non-scalable language is where the true innovation is. Ha! Happy reading.

  Message #188083 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: Bruce Tate on October 17, 2005 in response to Message #188079
A lot of the posters here seem a tad, um - defensive. Many of the responses run the line of: 4 nights != development, blah blah.It sure is easier to crank out a knee-jerk reaction to the serverside poster's one-paragraph summary than to take the time to read and possibly think about Bruce's article.Here is an actual quote from that article to help clarify some of the lazier posts:
I was working an a project with Justin Gehtland with a small startup in Austin. We implemented a simple application with Spring, Hibernate, and Webwork, the classic lightweight stack of technologies for Java. We were pleased," recalls Tate. "On a whim, we both decided to try Ruby on Rails over the same weekend. I called Justin to tell him I'd implemented the model on Rails, but he told me he'd implemented the whole application, in four nights! We were both blown away. As a Java guy, I pulled back to do some research, and I found that compared to the so called dynamic languages, Java was limited. Further interesting innovations in dynamic languages were happening, and some of them were doing things that Java couldn't. Then, this book came pouring out.
Regardless of the details, Bruce was impressed with how productive RoR was on this task. This impression led Bruce to think about many of Java's "limitations" and then to write a book about it. Is that a controversy?I think it is fairly certain that some development technology will come along to replace Java as king in the next few years if computer science history is any indicator. I don't think Bruce's point is that RoR is for sure that technology but that it spotlights some of the Java platform's weaknesses. It is those weak spots that newer technologies can overcome more easily. Why? Partly I think because the more successful a technology becomes the less it can (or is allowed to) change. See all the freak-out posts regarding Java 1.5's new features for proof. Every one of them was seen as the end of the world by some purists. Auto-boxing, Generics, Annotations, oh my!Will Java ever die? Probably not in our career-span so relax your job is somewhat safe. Will it be sidelined? Most assuredly, so maybe start paying attention to the new ideas.

Thanks for your reply. I have been defensive in the past too, so I completely understand the replies here. I mean, this isn't about bashing EJB. This is about saying, hey, maybe our baby is ugly. And that's a hard thing to recognize. At least, it was for me.

  Message #188084 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: Bruce Tate on October 17, 2005 in response to Message #188082
But don't those links suggest that there's more to life than the Java language? Im my book, I clearly state that the next successful language will need a credible JVM implementation.

In fact, in a conversation with Dave Thomas this weekend, I told him that JRuby, with Rails, was the most important Ruby project going. I still believe that.

  Message #188085 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: peter lin on October 17, 2005 in response to Message #188082
assuming this gets implemented in a future JVM, and there's a robust ruby interpreter for the JVM, wouldn't that mean java can accomodate ROR fans and provide an easier way to integrate java components?
peter

Absolutely. And here are some more links to innovations coming someday to a virtual machine near you (in this case mostly the CLR, sorry, but we can expect similar stuff for the JVM too):Composable memory transactionsLanguage-integrated queryC-omegaF-sharp, an ML-derived language for the CLRIBM's X10 programming language (targetting the JVM)All these things explain why I get annoyed at the sheer ignorance of people who imagine that a simple-minded little framework for building toy apps in a currently non-scalable language is where the true innovation is. Ha! Happy reading.

thanks for the links. I've read quite a few of those in the past. I wasn't aware of the Invokedynamic. I hope it gets the JSR stamp and implemented within the next 3 years.

peter

  Message #188087 Post reply Post reply Post reply Go to top Go to top Go to top

some links

Posted by: Tomek Klaudel on October 17, 2005 in response to Message #187896
http://article.gmane.org/gmane.comp.lang.ruby.rails/24863
here's some discussion about it:
http://weblog.rubyonrails.com/archives/2005/10/11/major-healthcare-application-switches-from-j2ee-to-rails

and this is nice:
http://www.garbett.org/?q=node/25

  Message #188088 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Henrique Steckelberg on October 17, 2005 in response to Message #188069
RoR's specific niche is a very dangerous one, which may be too narrow for too many types of projects: if app grows too complex, which BTW is what I've seen in 90% of the projects I've worked on, I wonder how will RoR behave. Will it have too many growing pains? If so, the immediate gains would be lost down the road when people try to maintain the unmaintainable, as further on your system will need to integrate with other systems, migrate to a diferent database, etc, as usually happens specially in big corporates. At least where I work, this happens very often. Does someone know how RoR compares to Java WRT maintainability and scalability?
The structure of RoR applications is much cleaner than Java counterparts. I'd guess the maintenance will be simpler, but I can't say for sure.
That can be said of VB programs too, but everyone knows what we got from that (in)famous language/tool. Let's wait and see if RoR will live up to its expectations.

  Message #188089 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: Alain Rogister on October 17, 2005 in response to Message #188084
But don't those links suggest that there's more to life than the Java language? Im my book, I clearly state that the next successful language will need a credible JVM implementation.In fact, in a conversation with Dave Thomas this weekend, I told him that JRuby, with Rails, was the most important Ruby project going. I still believe that.
There is definitely more to life than Java, we do agree on that. I just don't believe that RoR matters much in the greater scheme of things and I regret that it's given so much attention when there are so many more interesting and profound things to consider. Note also that all of the projects I mentioned target either the CLR or the JVM i.e. innovations happen in the development tools and languages but the runtime environment remains firmly in the continuity of what exists today. This is a key aspect I believe.

  Message #188091 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Bruce Tate on October 17, 2005 in response to Message #188088
That can be said of VB programs too, but everyone knows what we got from that (in)famous language/tool. Let's wait and see if RoR will live up to its expectations.

I don't like the structure of most VB applications. 10K of code hanging off of an OK button, over and over. The ui and the tool encourage you to tightly couple view and model logic. I don't see the same with Ruby on Rails.

  Message #188092 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: Bruce Tate on October 17, 2005 in response to Message #188089
The concepts behind Ruby on Rails are radical and important. RoR may not be the next great thing, but metaprogramming is extremely important. Look at how much effort we're spending on metaprogramming. Spring, Hibernate, and Seam. AOP. Annotations. EJB. JDO. All of these frameworks have thousands of lines of code invested in metaprogramming. But Ruby, Smalltalk, Lisp and even Python to some extent make metaprogramming much easier.

You say to look beyond the language to the JVM. I agree with the importance of the JVM, but I say to you "look beyond the tool to the language that enables it."

RoR could well be just the first in a wave of metaprogramming frameworks. That, with the configuration, conventions and defaulting stragegies, are what has me so excited.

The JVM needs to get more dynamic...closures, continuations, and dynamic typing are all very important to some of the most productive environments in the world.

  Message #188093 Post reply Post reply Post reply Go to top Go to top Go to top

10:1 compression of config?

Posted by: David McCoy on October 17, 2005 in response to Message #188063
Convention over configuration. Look at a typical Spring context and tell me how much could be defaulted. And I think that Spring one of the most productive Java frameworks. Look at the amount of Struts configuration related to navigation. Could you short circuit that? When you make assumptions about naming and navigation, and suggest those conventions, you only have to break your rules a small fraction of the time.

I'm with you on streamlining by obeying conventions.

  Message #188094 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: Dennis Bekkering on October 17, 2005 in response to Message #188083
A lot of the posters here seem a tad, um - defensive.
This is about saying, hey, maybe our baby is ugly. At least, it was for me.
LOL i wish i could say things as nice as you. I was to say that they are all scared of changes but that sounds so rude. The comfort zone is outside, not where we are right now.

  Message #188095 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: David McCoy on October 17, 2005 in response to Message #188071
Actually it's the emergence of projects like Spring and Hibernate that showcase Java's age the most. If you wanted to teach newbie programmer to write a simple web application, would you just tell him to learn JDBC and JSPs? Or would you tell them to learn JDBC and JSP, then JSTL, then JSF, and then EJBs? Or would you tell them to learn JDBC and JSP, then Struts, then Hibernate, and maybe then also Spring? Struts, Hibernate, and Spring all came about because of the shortcomings of "standard" Java technologies. It winds up being a huge stack of technologies to learn and you really see the age of things as you see how these incremental technologies cover up the wrinkles of the standard technologies they were built on and complement.

No, it is the emergence of Spring and Hibernate that show Java's maturity. There is NOTHING in Java language that is a shortcoming that is addressed Spring or Hibernate. I would say that the strength and vitality of Java is demostrated by the fact that it can successfully be all things to all people something Ruby or ROR hasn't proven.

By comparision Ruby is narrow and IMO restricted. And if the day ever comes with it can match Java's breadth of technologies, I suspect that it will look every bit as complex as Java does today. It is easy to look simple when a given tool doesn't do as much. That's why I've never bought into the arguements about why PCs cannot be as simple as toasters. A PC is more complex and can do more.

Again, many of these arguments are the same that were used for every scripting language that challenged the static accepted brother and as we've seen time and time again, the only thing that replaced a static langugage as another static language.

  Message #188096 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: David McCoy on October 17, 2005 in response to Message #188079
A lot of the posters here seem a tad, um - defensive. Many of the responses run the line of: 4 nights != development, blah blah.It sure is easier to crank out a knee-jerk reaction to the serverside poster's one-paragraph summary than to take the time to read and possibly think about Bruce's article.Here is an actual quote from that article to help clarify some of the lazier posts:
I was working an a project with Justin Gehtland with a small startup in Austin. We implemented a simple application with Spring, Hibernate, and Webwork, the classic lightweight stack of technologies for Java. We were pleased," recalls Tate. "On a whim, we both decided to try Ruby on Rails over the same weekend. I called Justin to tell him I'd implemented the model on Rails, but he told me he'd implemented the whole application, in four nights! We were both blown away. As a Java guy, I pulled back to do some research, and I found that compared to the so called dynamic languages, Java was limited. Further interesting innovations in dynamic languages were happening, and some of them were doing things that Java couldn't. Then, this book came pouring out.
Regardless of the details, Bruce was impressed with how productive RoR was on this task. This impression led Bruce to think about many of Java's "limitations" and then to write a book about it. Is that a controversy?I think it is fairly certain that some development technology will come along to replace Java as king in the next few years if computer science history is any indicator. I don't think Bruce's point is that RoR is for sure that technology but that it spotlights some of the Java platform's weaknesses. It is those weak spots that newer technologies can overcome more easily. Why? Partly I think because the more successful a technology becomes the less it can (or is allowed to) change. See all the freak-out posts regarding Java 1.5's new features for proof. Every one of them was seen as the end of the world by some purists. Auto-boxing, Generics, Annotations, oh my!Will Java ever die? Probably not in our career-span so relax your job is somewhat safe. Will it be sidelined? Most assuredly, so maybe start paying attention to the new ideas.

This is a typical arguement. The people who don't like something are somehow afraid or close-minded.

Perhaps we are just not impressed.

When the next real language innovation emerges, a statically typed one, no doubt, I'll be right there. But Ruby, yawn...

  Message #188097 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: James Strachan on October 17, 2005 in response to Message #188052
I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?Peace,Cameron PurdyTangosol Coherence: The Java Data Grid
that's the question I asked myself when the thread first appeared. clearly, the JVM can support a language like jython, so it should be able to support ruby. I'm sure the .NET team is working hard to make the CLR more friendly towards scripting languages like IronPython. Would anonymous types in .NET make it easier to write a ruby interpreter? Maybe someone from the jython or groovy team can shed some light.peter lin

Its pretty straight forward to port any language to the JVM - look at how many languages there already are.

http://www.robert-tolksdorf.de/vmlanguages.html

The only real issue is how the language & the JVM work together at the object/API level. What we tried really hard was to make Groovy a Ruby-ish language which mapped directly to regular Java objects with a minimum amount of impedence mismatch between the language objects and the JVM objects and to reuse as much of the JVM's APIs (Collections, Strings, Comparable etc).

Its pretty simple and easy to add new languages to the JVM. I'm a bit surprised that developers in the Ruby/Python worlds spend so much time on their own VMs when the JVM is so darned useful (those virtual method call inlines are really handy along with great garbage collection).

James
LogicBlaze

  Message #188098 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: Alain Rogister on October 17, 2005 in response to Message #188092
The concepts behind Ruby on Rails are radical and important. RoR may not be the next great thing, but metaprogramming is extremely important. Look at how much effort we're spending on metaprogramming. Spring, Hibernate, and Seam. AOP. Annotations. EJB. JDO. All of these frameworks have thousands of lines of code invested in metaprogramming. But Ruby, Smalltalk, Lisp and even Python to some extent make metaprogramming much easier. You say to look beyond the language to the JVM. I agree with the importance of the JVM, but I say to you "look beyond the tool to the language that enables it."RoR could well be just the first in a wave of metaprogramming frameworks. That, with the configuration, conventions and defaulting stragegies, are what has me so excited.The JVM needs to get more dynamic...closures, continuations, and dynamic typing are all very important to some of the most productive environments in the world.
On this last point we are in full agreement. This blog entry by Cedric Beust should also be of interest to you. If Sun needs 3 years to add a byte code to the JVM (if I may oversimplify a bit), then I'm afraid the fun is going to shift to .NET where innovation seems much faster nowadays...

  Message #188099 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Ray Harrison on October 17, 2005 in response to Message #188095
No, it is the emergence of Spring and Hibernate that show Java's maturity. There is NOTHING in Java language that is a shortcoming that is addressed Spring or Hibernate. I would say that the strength and vitality of Java is demostrated by the fact that it can successfully be all things to all people something Ruby or ROR hasn't proven.By comparision Ruby is narrow and IMO restricted. And if the day ever comes with it can match Java's breadth of technologies, I suspect that it will look every bit as complex as Java does today. It is easy to look simple when a given tool doesn't do as much. That's why I've never bought into the arguements about why PCs cannot be as simple as toasters. A PC is more complex and can do more.Again, many of these arguments are the same that were used for every scripting language that challenged the static accepted brother and as we've seen time and time again, the only thing that replaced a static langugage as another static language.

That's a very good point. Over the last 20 years, my primary languages (because it has been the primary language of my employers) have been C, C++ and Java. I actually still use each of these. Most of what I do doesn't involve web applications - maybe I write one a year and spend half a day doing it. The domain of problems solved by these languages is much(much) larger than what is currently envisioned by some of the so-called dynamic languages.

There is definitely a place for languages like Ruby - whether they will evolve into the "Next Big Thing" depends on the breadth of problems they solve.

Cheers
Ray

  Message #188101 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Steve Zara on October 17, 2005 in response to Message #188071
You're not too familiar with RoR are you?

Yes I am.
It uses an O/R layer, similar in some ways to Hibernate, to hide DB specific code/queries from the application developer.

No, it doesn't. You use DB-specific queries. The language you write anything but the simplest queries in is the native SQL of the database; something much of the Java community has started to move away from years ago.

This is why we use HSQL, JDOQL and EJBQL.
In addition, its "out of the box" functionality make it so that a schema change is automatically reflected in the UI, with no code change at all. So if you add a column to table and have a web page that lists entries from that table or one that shows details about a row of data, this pages will show the new column without any code being written, or even any configuration files changed.

Assuming this is correct (and I am not convinced - as I understand it scaffolding is a once-only process), this completely impractical for any serious web design. No-one who writes a professional looking web pages would want arbitrary new fields and controls appearing on their pages simply because someone changed the schema!
But you must recognize that for somebody new to Java, these things can look like voodoo.

And

@@name

to access class variables is simple? Sure looks like obscure voodoo to me.
As Spring, Hibernate and other technologies start to move into the mainstream of Java use, and as the latest release of Java (5.0), which has more changes than any release of Java for years, moves into mass use, saying Java 'is showing signs of wear' seems a bit strange.
Actually it's the emergence of projects like Spring and Hibernate that showcase Java's age the most. If you wanted to teach newbie programmer to write a simple web application, would you just tell him to learn JDBC and JSPs? Or would you tell them to learn JDBC and JSP, then JSTL, then JSF, and then EJBs? Or would you tell them to learn JDBC and JSP, then Struts, then Hibernate, and maybe then also Spring? Struts, Hibernate, and Spring all came about because of the shortcomings of "standard" Java technologies. It winds up being a huge stack of technologies to learn and you really see the age of things as you see how these incremental technologies cover up the wrinkles of the standard technologies they were built on and complement.

No, it is because good (not quick and dirty) web application IS difficult and full of wrinkles.

The fact that Struts, Hibernate and Spring have arisen shows that Java is flexible and is not pinned down to only the standards. It shows that new approaches and innovations can become mainstream in Java.

  Message #188102 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: peter lin on October 17, 2005 in response to Message #188098
The concepts behind Ruby on Rails are radical and important. RoR may not be the next great thing, but metaprogramming is extremely important. Look at how much effort we're spending on metaprogramming. Spring, Hibernate, and Seam. AOP. Annotations. EJB. JDO. All of these frameworks have thousands of lines of code invested in metaprogramming. But Ruby, Smalltalk, Lisp and even Python to some extent make metaprogramming much easier. You say to look beyond the language to the JVM. I agree with the importance of the JVM, but I say to you "look beyond the tool to the language that enables it."RoR could well be just the first in a wave of metaprogramming frameworks. That, with the configuration, conventions and defaulting stragegies, are what has me so excited.The JVM needs to get more dynamic...closures, continuations, and dynamic typing are all very important to some of the most productive environments in the world.

On this last point we are in full agreement. This blog entry by Cedric Beust should also be of interest to you. If Sun needs 3 years to add a byte code to the JVM (if I may oversimplify a bit), then I'm afraid the fun is going to shift to .NET where innovation seems much faster nowadays...

The trade off between moving forward and backward compatability is tricky. I'd argue it's much easier to screw that up than get it right. If Sun were to totally break the JVM compatability and introduce several new low level features, I'm sure there are plenty of businesses that would be furious. I'm sure there would be plenty of people who would be happy, but it's pretty hard to guess the reaction and impact. At the end of the day, if the developers of JRuby achieve their goals, then adding low level features might not amount to much.

there are several LISP interpreters for Java, but the learning curve is rather steep. I don't know if metaprogramming is the future. My bias opinion is it will be a gradual shift. it's anyone's guess how long the process will take.

peter lin

  Message #188103 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: Konstantin Ignatyev on October 17, 2005 in response to Message #188096
When the next real language innovation emerges, a statically typed one, no doubt, I'll be right there. But Ruby, yawn...
IMO: the NBF is here:
http://www.martinfowler.com/articles/languageWorkbench.html
And implementations are:
http://www.martinfowler.com/articles/languageWorkbench.html#TodaysLanguageWorkbenches

  Message #188105 Post reply Post reply Post reply Go to top Go to top Go to top

RoR's problem is that its too complex.

Posted by: David Crook on October 17, 2005 in response to Message #187896
I've looked at RoR and it just seemed way to slower and cumbersom to develop in. Sure, bonding the database schema to the domain objects with crazy glue was an okay start. It saves some time. But its still way too verbose. Who has time to learn all this complex relational algebra stuff? I have to make a name for every column? Thats just to much work! Having "foreign" keys just sounds suspicious. This stuff is just getting in the way.

But I have the solution. Its easier, less verbose, and its based on proven technologies.

Its VB on Excel. Now instead of wasting all that valuable time making up database tables all that other un-needed stuff you can use the most efficient data structure known, a flat table. No more dallying about making up column names, why bother when "A", "B", "C" and all their friends are available. Just add a simple ASP pages with a form and BLAM you got yourself a CRUD application. Heck, I cranked out 5 whole applications while I was writing this response.

RoR is totally yesterdays news, VOE is the wave of the future.

:-)

  Message #188106 Post reply Post reply Post reply Go to top Go to top Go to top

more links for ya

Posted by: Steve Zara on October 17, 2005 in response to Message #188092
The JVM needs to get more dynamic...closures, continuations, and dynamic typing are all very important to some of the most productive environments in the world.

Absolutely. I believe that Java (or some successor on the JVM) will evolve to add such features.

My concern is the current emphasis on RoR, which (in my view) does so much wrong, that it distracts from the above message.

  Message #188107 Post reply Post reply Post reply Go to top Go to top Go to top

jerk...

Posted by: Bruce Tate on October 17, 2005 in response to Message #188105
you made me spit my drink all over my keyboard. ;)

  Message #188108 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Jon Tirsen on October 17, 2005 in response to Message #188023
Please tell me how you can refactor in untyped languages. Just go down the list of IntelliJ's refactoring menu and describe to me how it is even possible to do it without a type system.

The first refactoring support to appear was for Smalltalk, a dynamically language as you know. Smalltalk and Ruby aren't "untyped", they are strongly but dynamically typed. They both have a very sophisticated type system.

To support refactoring in a dynamically typed language you have to use other techniques than static analysis: gather information at runtime, modify code at runtime, inference, heuristics and so on. Example: the rename method in the Smalltalk refactoring browser would insert a stub at the old name, when that stub got called it would at runtime modify the code of the call site to call the new method name. By using runtime analysis you can actually build up the same type graph that you get by doing statical analysis in a statically typed language. You can also to some degree infer types.

You can use similar techniques in Ruby. It does mean that your refactoring is only as effective as your test suite is, but you would be nuts not having a comprehensive test suite on a project with a dynamically typed language. Rename method is probably the hardest commonly used refactoring in a dynamically typed lanauage but for example extract method is much easier, and so are introduce variable, rename variable, rename field (all fields are private in Ruby), pull up method, introduce constant and so on.

I can't come up with one off the top of my head but there might be some refactorings that IntelliJ does that just aren't possible in a dynamically typed language, but given that I only use a fraction of the refactorings anyway I still think a dynamic typed language would get the upper hand in terms of productivity.

  Message #188110 Post reply Post reply Post reply Go to top Go to top Go to top

RoR's problem is that its too complex.

Posted by: David McCoy on October 17, 2005 in response to Message #188105
Heck, I cranked out 5 whole applications while I was writing this response.RoR is totally yesterdays news, VOE is the wave of the future.:-)

Heck, I'm sold. Sign me up for your RSS feed!

  Message #188111 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: Cedric Beust on October 17, 2005 in response to Message #188102
This blog entry by Cedric Beust should also be of interest to you. If Sun needs 3 years to add a byte code to the JVM (if I may oversimplify a bit), then I'm afraid the fun is going to shift to .NET where innovation seems much fas
ter nowadays...
The trade off between moving forward and backward compatability is tricky. I'd argue it's much easier to screw that up than get it right. If Sun were to totally break the JVM compatability and introduce several new low level features, I'm sure there are plenty of businesses that would be furious.
The point in my blog entry was actually to observe that adding a bytecode to the JVM is completely backward compatible, as opposed to changes such as adding keywords to the language (assert, enum), which, even now, are still wreaking havoc on existing codebases.

--
Cedric

  Message #188112 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: David McCoy on October 17, 2005 in response to Message #188098
The concepts behind Ruby on Rails are radical and important. RoR may not be the next great thing, but metaprogramming is extremely important. Look at how much effort we're spending on metaprogramming. Spring, Hibernate, and Seam. AOP. Annotations. EJB. JDO. All of these frameworks have thousands of lines of code invested in metaprogramming. But Ruby, Smalltalk, Lisp and even Python to some extent make metaprogramming much easier. You say to look beyond the language to the JVM. I agree with the importance of the JVM, but I say to you "look beyond the tool to the language that enables it."RoR could well be just the first in a wave of metaprogramming frameworks. That, with the configuration, conventions and defaulting stragegies, are what has me so excited.The JVM needs to get more dynamic...closures, continuations, and dynamic typing are all very important to some of the most productive environments in the world.
On this last point we are in full agreement. This blog entry by Cedric Beust should also be of interest to you. If Sun needs 3 years to add a byte code to the JVM (if I may oversimplify a bit), then I'm afraid the fun is going to shift to .NET where innovation seems much faster nowadays...

Well, I think MS will always have the advantage when it comes to tools. They control it all. Similarly, Apple can innovate faster for the OSX and its hardware. Imagine if MS said that they were dropping Intel for HP-Risc or some such.

When you are open, you are slower. People accept that because you are open.

  Message #188113 Post reply Post reply Post reply Go to top Go to top Go to top

I'd hammer in the morning...

Posted by: Warren Sprau on October 17, 2005 in response to Message #188110
Anyone else out there feel like becoming a carpenter? How the heck is a SW practioner supposed to have a real life these days, keeping up with every spasm/twitch that shakes the foundation of software development. Can everyone here imagine what our business users would make of this conversation? Could we imagine how we would feel if the same conversations happened on the building sites of our new homes and offices?

  Message #188114 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Cedric Beust on October 17, 2005 in response to Message #188108
The first refactoring support to appear was for Smalltalk, a dynamically language as you know.
As I said above, Smalltalk refactorings don't even come close to what we do today with Eclipse and IntelliJ. They were also working on projects that were much simpler than today's.

And it's not a coincidence: in my opinion, some of these refactorings are just plain impossible to achieve with dynamic languages (more details here).

This shouldn't come as a surprise: you gain some readability by omitting types here and there, but there is loss of information. Humans might be more comfortable with less typing information in the code they read, but IDE's surely aren't, and if you don't give them these types, they won't give you refactoring.

Again, I would love to be proven wrong, but I'm getting tired of hearing "IDE's for dynamic languages will appear any day now". By now, I am thinking that considering the amount of interest in dynamic languages of late, these IDE's should already be here. The fact that they're not (or in a very primitive form) sends a clear message.

 Smalltalk and Ruby aren't "untyped", they are strongly but dynamically typed.
I disagree: Ruby is not strongly typed (Groovy is not either by default, but it can be if you choose to use types). But let's not go into this rat hole if we can avoid it :-)
Rename method is probably the hardest commonly used refactoring in a dynamically typed lanauage but for example extract method is much easier, and so are introduce variable, rename variable, rename field (all fields are private in Ruby), pull up method, introduce constant and so on.
I don't really see why these refactoring are easier in dynamic languages. They are *easy* refactorings, whatever the language (except Intercal, but that's by design).

--
Cedric

  Message #188115 Post reply Post reply Post reply Go to top Go to top Go to top

Thanks for your thoughts.

Posted by: Steve Zara on October 17, 2005 in response to Message #188060
Ruby is much more dynamic, and handles complexity very well. It's a model-view-controller style design pattern. It defaults everything, but many Java developers confuse this with hard wiring. It isn't. And Ruby metaprogramming gives me things Cold Fusion could only dream about.

This is completely missing the point about my original post about Cold Fusion. Dealing with complexity was not the issue. The issue was performance. This is same reason I gave up (to my deep regret) Smalltalk years ago. For me a reasonable development language has to have four properties, and must not compromise to any degree on any of them:

1. It must have real cross-platform portability at the point of deployment (I don't want to have to produce and support multiple versions for different platforms).
2. It must be free.
3. It must be fast (and by this, I mean close to C or C++ speed).
4. There must be good IDEs for the language.

With any given Smalltalk implementation, I could get two or three of those, but not all four. With Java I do not have to compromise. Ruby (and other scripting languages) tend to fail badly on 3 and 4.

As far as I can tell, Ruby has a some way to go before it reaches anything like the development environment capabilities of Smalltalk as it was decades ago, let alone gaining the speed of C or Java.

  Message #188116 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: Bruce Tate on October 17, 2005 in response to Message #188112
Sun has been rightfully conservative with Java. They've invested in the brand, and the notion that the brand is the language. It makes sense for them: control the language to some extent to control mind share, and sell more hardware, services and software. Java's Sun's biggest asset. It's not that they can't extend the JVM. It's that changes in the JVM are more dangerous for the language.

Microsoft has another problem. They have invested in the brand of the operating system. They make another set of compromises, because they have a legacy to support, and the *want* to drive upgrades, and they need to support multiple languages to do so.

With the competition fueled from .NET, you can see some movement in this area: embracing Groovy, supporting a JSR to upgrade the JVM for dynamic languages, and so on. Sun needs to stay aggressive. It shouldn't be about protecting the Java, the language. It should be all about protecting Java, the platform, and the JVM. But we're going to have to change some attitudes to do so. And I'm not so sure that the community wants to change...yet.

  Message #188117 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Jan Vissers on October 17, 2005 in response to Message #187896
I'm guessing the guys who wrote the book are quite happy with this post. It generates a lot of additional noise and will sell additional books. Don't know what the actual business value is though.

  Message #188118 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: Frank Bolander on October 17, 2005 in response to Message #188111
The point in my blog entry was actually to observe that adding a bytecode to the JVM is completely backward compatible, as opposed to changes such as adding keywords to the language (assert, enum), which, even now, are still wreaking havoc on existing codebases.-- Cedric

That's an interesting point. Is there a point and time when forking and doing a new thing versus maintaining backwards compatibility makes more sense? I believe even in the Ruby space, "Matz" Matsumoto(the creator of Ruby) did a presentation on "How Ruby Sucks"

http://www.rubyist.net/~matz/slides/rc2003/

Where he feels that the best way to address problems and idiosyncracies are better served by going to a "nextgen" Ruby2 VM(aka RITE) with upfront admission of incompatibilities instead of kludging to maintain backwards compatibility.

Maybe Java should go the same route to absorb new ideas gleaned from the Ruby, Python, PHP people and upfront say that any new generation of the language will have backward compatibility issues. It might allow for a more aggressive refactoring path for Sun to address all the issues mentioned by the community without the burden of legacy support.

  Message #188119 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Steve Zara on October 17, 2005 in response to Message #188114
As I said above, Smalltalk refactorings don't even come close to what we do today with Eclipse and IntelliJ. They were also working on projects that were much simpler than today's.

This simply isn't true. I find very little difference between what Eclipse does and what a modern Smalltalk (such as VisualWorks) does in terms of refactoring.

And saying that they were working on simpler projects is plain wrong. Smalltalk has been used for just about everything, including web and app servers.
Again, I would love to be proven wrong, but I'm getting tired of hearing "IDE's for dynamic languages will appear any day now". By now, I am thinking that considering the amount of interest in dynamic languages of late, these IDE's should already be here.

They have been, for decades! From Smalltalk-80 to Squeak. What tires me is all these new languages (such as Ruby) saying they are based on Smalltalk and NOT providing IDEs. Smalltalk's great strength was always its IDE, where many things we take for granted (refactoring, units tests) originated.

  Message #188120 Post reply Post reply Post reply Go to top Go to top Go to top

Don't abandon Java just yet

Posted by: Geert Bevin on October 17, 2005 in response to Message #187982
I think it's a pity that Java developers are so quickly grasping for Ruby on Rails without even considering that the full J2EE/Spring stack isn't the only possible way to develop web applications in Java. There are many projects in the Java community that strive for the same benefits without developers having to leave behind the language, the toolset, the libraries and the enterprise features if you need them. I can only speak for our own project, RIFE, by going over the "what's different" points that Bruce wrote in the beginning of this thread:

* Rapid turnaround time

RIFE only needs restarts when you change your back-end APIs by introducing new methods or changing existing signatures. This is because the Java hot-swap has got this limitation. The actual declarations, elements (our actions), templates, dependencies ... are all reloaded on-the-fly and allow you to work in a very iterative fashion. Besides that, applications generally start up in a few seconds since they only require a basic servlet container like Resin, Jetty or Tomcat. You thus get most of the benefits here.

* Starting point

RIFE/Crud provides a similar approach to scaffolding but without code generation and completely at run-time. Through a rich meta-data API (constraints), you're even able to handle image uploads, XHTML validation, content transformation, etc etc without writing more that a single statement.
I think that the run-time generation is much more powerful since you can actually base yourself on the automated functionalities without having to manually maintain any generated code if a new version of the scaffolding comes out.

* Reduced configuration

There is a lot of preference involved here. I agree that XML configuration went overboard in many Java frameworks, but that shouldn't be mistaken with declaration. Even though I value quick results, I think it's extremely important to have one centralized declaration where all my elements, URLs, filters, flows, etc. are clearly available. Sure that might require one or two additional lines of code once in a while, but in the end clarity and maintainability gets a lot better. Apart from that, our site-structure declaration provides complete knowledge about all state transitions including data and logic. This is used by the engine to provide advanced features like behavioral inheritance, embedded elements (portlets), URL localization, ...
Sometimes you can't get something for nothing.

* Better mapping strategy

You have the 'association' or 'manyToOne' constraints in our meta-data API that do exactly the same. Personally I cringe when I see class properties being auto-generated from database tables. I think that's the wrong way 'round. We support optional auto-generation of the database tables from your domain objects according to the meta-data your declared there. That is really a single point of modification since everything is driven from there. You don't have bits that rely on the limited constraints that database tables provide and other bits that rely on meta-data that sits in your domain objects.

* Much better AJAX, and cleaner view technology

I can't speak for AJAX since I haven't done much with it, I'm an OpenLaszlo guy. As for view technology, Ruby's rhtml is anything but clean. Templates are once again not real templates and contain logic. Admittedly they contain very little logic, but they are not dumb layout blueprints. RIFE's template engine has a very simple, but unique design which doesn't require any logic in the template at all. Ruby's view technology is maybe quick, but it isn't clean.

Finally, I encourage people that are interested in RIFE or that think they know what it does from seeing a couple of examples to read the 'RIFE misconceptions' blog post I wrote a week ago. This will save everyone a lot of time ;-)

Don't throw Java away yet if you're looking for simpler approaches to develop (web) applications, looking at non-mainstream projects might just give you what you're looking for.

  Message #188122 Post reply Post reply Post reply Go to top Go to top Go to top

Don't abandon Java just yet

Posted by: Steve Zara on October 17, 2005 in response to Message #188120
I think it's a pity that Java developers are so quickly grasping for Ruby on Rails

I don't think there is any evidence that they are. All that is happening is that Ruby on Rails hype is being widely discussed.
Personally I cringe when I see class properties being auto-generated from database tables. I think that's the wrong way 'round.

+1

  Message #188123 Post reply Post reply Post reply Go to top Go to top Go to top

I'd hammer in the morning...

Posted by: Konstantin Ignatyev on October 17, 2005 in response to Message #188113
Anyone else out there feel like becoming a carpenter? How the heck is a SW practioner supposed to have a real life these days, keeping up with every spasm/twitch that shakes the foundation of software development. Can everyone here imagine what our business users would make of this conversation? Could we imagine how we would feel if the same conversations happened on the building sites of our new homes and offices?
That is really sad that business people do not have hot conversation about future of business practices. I am sure that they must start doing exactly that because business paradigm should change. Growth oriented madness should give way to sustainability oriented models on all levels of business and society.
Actually such shift happens right now but unfortunately with very slow pace.

Kenneth E. Boulding professor of Economics at the University of Michigan and elsewhere:
"Anybody who believes exponential growth can go on forever in a finite world is either a madman or an economist."

  Message #188125 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Java

Posted by: Kirk Pepperdine on October 17, 2005 in response to Message #187983
they were able to recreate the application in Ruby in 4 nights.how long did they worked on the original , 2 nights;-) Now serious, this statement doesn't mean anything. The second time you build something it goes always faster, regardless wherein.

I can say that my experience is different. I first implemented an SMTP client in Smalltalk and then followed that up with a port to Java. It took just as longer to implement the RFP in Java then in Smalltalk. Also I moved an application from Smalltalk to C++. That move took much longer then the first effort. On the other side of the coin, I replaced 4 man years of C code in 3 days of shell scripting.

I would attribute each of the slow downs and speedups in delivery time to the expressiveness of the languages being used and their applicability to the problem domain. IOWs, I'd not suggest that all programs should be replace with shell scripts, that is just plain nonsense. However, one should feel free to use another language if the situation calls for it.

  Message #188127 Post reply Post reply Post reply Go to top Go to top Go to top

dynamic stuff

Posted by: peter lin on October 17, 2005 in response to Message #188111
This blog entry by Cedric Beust should also be of interest to you. If Sun needs 3 years to add a byte code to the JVM (if I may oversimplify a bit), then I'm afraid the fun is going to shift to .NET where innovation seems much faster nowadays...

The trade off between moving forward and backward compatability is tricky. I'd argue it's much easier to screw that up than get it right. If Sun were to totally break the JVM compatability and introduce several new low level features, I'm sure there are plenty of businesses that would be furious.

The point in my blog entry was actually to observe that adding a bytecode to the JVM is completely backward compatible, as opposed to changes such as adding keywords to the language (assert, enum), which, even now, are still wreaking havoc on existing codebases.-- Cedric

I agree with that. adding a bytecode "should" be backward compatable, not that it necessarily is. adding new keywords definitely causes problems. I'm glad the decision isn't up to me. of course assert and enum never caused anyone to rewrite their code :)

excuse my silly joke

peter

  Message #188128 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Mike Perham on October 17, 2005 in response to Message #187896
I've been using Ruby on Rails for the last few weeks and I must say that I'm in the same boat as Bruce: I've been using Java since 1.0 and make a very good living as a senior member of J2EE development team. But Java simply isn't fun anymore - there's so much bloat and infrastructure needed to get even a simple db-based webapp working that it sucks the life right out of me even considering starting a new system that way.

Rails is completely different - there's next to no startup time compared to Java. A new project from scratch takes hours rather than days - set up your database, install Radrails or another IDE, install ruby and rails and start developing your schema. Rails's ZTT absolutely cannot be overstressed compared to the standard 2 minute J2EE deployment cycle. It makes development more about creativity rather than patience.

Remember what people said about Java in 1996, "it's slow and really only suitable for applets", and keep in mind that Ruby/Rails is only going to get better...

More here: http://www.perham.net/mike/log/?p=361

  Message #188129 Post reply Post reply Post reply Go to top Go to top Go to top

Refactoring?

Posted by: Jon Tirsen on October 17, 2005 in response to Message #188114
As I said above, Smalltalk refactorings don't even come close to what we do today with Eclipse and IntelliJ. They were also working on projects that were much simpler than today's.

Yes, you are correct and I think that is going to be the case with any refactoring you can do for a dynamic language. It's never going to be as good as IntelliJ. We can still get some level of support though.

I don't think Smalltalk systems were a lot simple. I've heard of some incredibly complex Smalltalk systems and I've myself built a system much more complicated than most of my Java projects in a dynamic language (Common Lisp). That said, I think most Ruby projects are pretty small and I don't think it's a good idea to kick off a really large project in Ruby until we get some more experience in how to properly do these projects.

And it's not a coincidence: in my opinion, some of these refactorings are just plain impossible to achieve with dynamic languages (more details here).This shouldn't come as a surprise: you gain some readability by omitting types here and there, but there is loss of information. Humans might be more comfortable with less typing information in the code they read, but IDE's surely aren't, and if you don't give them these types, they won't give you refactoring.Again, I would love to be proven wrong, but I'm getting tired of hearing "IDE's for dynamic languages will appear any day now". By now, I am thinking that considering the amount of interest in dynamic languages of late, these IDE's should already be here. The fact that they're not (or in a very primitive form) sends a clear message.
&nbsp;Smalltalk and Ruby aren't "untyped", they are strongly but dynamically typed.
I disagree: Ruby is not strongly typed (Groovy is not either by default, but it can be if you choose to use types). But let's not go into this rat hole if we can avoid it :-)
Strongly typed is usually defined as every single data item has a type. This is in contrast to for example Perl and TCL where 1+"2" would evaluate to 3. The type of a data item depends on the context and is a bit "flexible". This is what is usually defined as weakly typed languages. By this definition C and C++ are not very strongly typed (just a little bit) as you can actually cast a data item and interpreting it as a different type. Java, Ruby and Groovy are all fairly strongly typed as there is runtime information available saying exactly what type each object has and runtime checks are done to ensure that an object cannot ever be used as the wrong type. In Java you can actually cast a value of primitive type to start using that value as a different type, which is not possible in Ruby (you have to use a conversion method) so you could almost say that Ruby is more strongly typed than Java.

Ruby and Smalltalk are dynamically typed though, the type information is only available at runtime. C, C++ and Java are statically typed, you completely specify the type information at runtime and the compiler statically ensures that no operations that are not type safe occur.

All these things are well defined in CS literature, so no need to get in an argument. ;-)
They are *easy* refactorings, whatever the language (except Intercal, but that's by design).

Sorry, I wasn't clear enough. Yes, these are quite easy refactorings in any language. (Actually, Extract Method is pretty hard but coincidentally easier than Rename Method in a dynamic language because it doesn't require the call graph to be available.)

Building IDEs like IntelliJ and Eclipse are obviously quite significant investments. I don't think the market for a sofisticated Ruby IDE is yet big enough to warrant such an investement.

I do think it's possible to do some level of refactoring support for Ruby though and I described some of my ideas here.

  Message #188130 Post reply Post reply Post reply Go to top Go to top Go to top

Don't abandon Java just yet

Posted by: David Crook on October 17, 2005 in response to Message #188122
I think it's a pity that Java developers are so quickly grasping for Ruby on Rails
I don't think there is any evidence that they are. All that is happening is that Ruby on Rails hype is being widely discussed.
Personally I cringe when I see class properties being auto-generated from database tables. I think that's the wrong way 'round.
+1

I firmly believe auto-generation in either direction is just plain wrong. Maybe some fancy middlegen tool can create both from a common definition, but I think that if you are going to create a db schema from java objects or create java objects from a db schema then you are just going to make a mess of one of them. Just phoning in the database schema design is a sure way to cripple a project.

Taking the extra time to do both right will pay off dividens for YEARS to come for most projects. Sure, it doesn't mean anything for a throw away demo. But how many of those "throw-aways" suddenly become the initial production version.

  Message #188131 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Steve Zara on October 17, 2005 in response to Message #188128
Rails's ZTT absolutely cannot be overstressed compared to the standard 2 minute J2EE deployment cycle. It makes development more about creativity rather than patience.

Here is my J2EE database app. Under NetBeans 4.1 on my laptop I change a JSP. I redeploy ready for debugging in less than 20 seconds. What is this 2 minute deployment cycle?
Remember what people said about Java in 1996, "it's slow and really only suitable for applets", and keep in mind that Ruby/Rails is only going to get better...

The same has been said over many, many years about PERL, TCL, Python and now Ruby. There is as yet no evidence after several years that any of these scripting languages are truly general purpose. Java has had major development teams working on the VM in order to give close to C/C++ performance.

  Message #188132 Post reply Post reply Post reply Go to top Go to top Go to top

Beyond Ruby

Posted by: Jan Vissers on October 17, 2005 in response to Message #187896
I hardly think that "J2EE programming isn't fun anymore" and the like are good arguments to embark on yet another buzz train. I'm starting to think that just when Java/J2EE development is getting more stable, mature and productive some people just want to get their hands on new toys in order to stay "cool".

  Message #188133 Post reply Post reply Post reply Go to top Go to top Go to top

How long to come up to speed?

Posted by: Cory Wandling on October 17, 2005 in response to Message #188092
Obviously you did not port the app in 4 days AND learn ROR. How much time did you have to invest in the ROR learning curve to come up to speed so that you could port the app in 4 days?

  Message #188135 Post reply Post reply Post reply Go to top Go to top Go to top

Overloaded

Posted by: Brian Neal on October 17, 2005 in response to Message #187896
Good grief, the FUD-o-meter is overloaded!

Re: refactoring and dynamic languages:
Please don't make comments like "refactoring can't be done in dynamic languages" or "nothing like IDEA" or some such nonsense unless you know what you are talking about, or you at least google a little :). Someone at least mentioned Will Opdykes' paper (which in turn, if you at least read it before you comment, was influenced by work done by Ralph Johnson at UIUC and Brian Foote in the mid 80s). Anyone at all who used Smalltalk on any significant project can tell you about the refactoring browser, and the capabilities of most all Smalltalk IDEs, starting with Objectworks/ST-80. So saying "dynamic" languages don't support refactoring is just plain ignorance.

And as for ROR, use it. Read about it. Pick up the pickaxe book by Dave Thomas, and read about Ruby. Get the Agile book by Ruby's creator. Write some projects using Rails. Look at some applications created using Rails (try http://www.37signals.com for a few links). The creator of Rails, David Heinemeier Hansson, maintains a blog at http://www.loudthinking.com, where he discusses everything Rails related.

In other words, for Pete's sake, educate yourself. If you don't believe that Ruby is more productive than Java, or Rails lets you build Web applications easier, or Ruby or Rails somehow isn't ready for the "Enterprise" (whatever that means), then don't listen to Dave Thomas, or Andy Hunt. Or Bruce Tate, or Bruce Eckel, or James Duncan Davidson, or...

I didn't listen to them either. But then several months ago I tried Ruby, then Rails, and I saw for myself.

Maybe you will too.

I teach Java and J2EE to feed my kids. But when I want to write an application to solve a problem, its not what I turn to first, at least, not anymore. This community is starting to remind me a whole lot of the C/C++ community when I first learned Smalltalk so long ago, and the C/C++ community when I first learned Java so long ago.

As they say, those that forget history.....

--Brian

  Message #188136 Post reply Post reply Post reply Go to top Go to top Go to top

Great Topic - DRY

Posted by: Malcolm Edgar on October 17, 2005 in response to Message #187896
This is a great topic.

Most of the J2EE frameworks have a strong "architectural" bias towards loosely coupled layering.

The advantange of this approach is that you can that you can swap out the different pieces. For example you can swap JDO <-> Hibernate, and the Struts framework is not affected.

The disadvantage of this approach, is that we have to write all the glue code to support this loose coupling. Hence the importance of frameworks like Spring which help us with this task.

To see the problem with the current J2EE approach think about form valiation. We have a database table column with a not null column that has a maximum length of 10 characters. This database column maps to some Java object attribute. In a traditional J2EE we app we have this validation metadata information in:
* database schema
* ORM mapping files
* Business tier validation, e.g. Service layer, DAO etc.
* Appliation tier validation, e.g. struts Form
* JSP

If we change this column width to 15 characters we have to go through the entire appliction stack and make sure we haven't missed something.

This is daft, and is a case in point why J2EE web app development is so painful.

The RoR design principle of Dont Repeat Yourself (DRY) is very important, and will lead to more robust code and higher productivity. In OO terms this is encapsulation.

I believe emerging Java frameworks will take these important design principles on board and provide us with a high productivity development environment.


Malcolm Edgar
http://click.sourceforge.net

  Message #188137 Post reply Post reply Post reply Go to top Go to top Go to top

+1

Posted by: Michael Neale on October 17, 2005 in response to Message #188052
Use JRuby ! and support them. It actually works (no continuations yet).

  Message #188138 Post reply Post reply Post reply Go to top Go to top Go to top

Don't abandon Java just yet

Posted by: David McCoy on October 17, 2005 in response to Message #188130
I think it's a pity that Java developers are so quickly grasping for Ruby on Rails
I don't think there is any evidence that they are. All that is happening is that Ruby on Rails hype is being widely discussed.
Personally I cringe when I see class properties being auto-generated from database tables. I think that's the wrong way 'round.
+1
I firmly believe auto-generation in either direction is just plain wrong. Maybe some fancy middlegen tool can create both from a common definition, but I think that if you are going to create a db schema from java objects or create java objects from a db schema then you are just going to make a mess of one of them. Just phoning in the database schema design is a sure way to cripple a project.Taking the extra time to do both right will pay off dividens for YEARS to come for most projects. Sure, it doesn't mean anything for a throw away demo. But how many of those "throw-aways" suddenly become the initial production version.

Absolutely!! This is why I'm such a hardass about this. I've seen too many prototypes demo'ed to customers who said "If you had just this, it'll be perfect."

After all this, I refuse to hack out anything because I *know* what will happen. I've yet to see anyone go, I'm sorry you've done this application right.

  Message #188139 Post reply Post reply Post reply Go to top Go to top Go to top

Great Topic - DRY

Posted by: Jan Vissers on October 17, 2005 in response to Message #188136
Most of the J2EE frameworks have a strong "architectural" bias towards loosely coupled layering. The advantange of this approach is that you can that you can swap out the different pieces. For example you can swap JDO <-> Hibernate, and the Struts framework is not affected.The disadvantage of this approach, is that we have to write all the glue code to support this loose coupling. Hence the importance of frameworks like Spring which help us with this task.

I'm my opinion loosely coupled layering greatest advantage is that you can have seperate teams developing in parallel. For instance have your web designer team do the UI, and the database savey people work out details regarding ORM.

I can see RoR having an advantage for "Mickey Mouse systems" which are a single developer effort, but not so much for applications which require a larger number of developers.

  Message #188140 Post reply Post reply Post reply Go to top Go to top Go to top

Great Topic - DRY

Posted by: David McCoy on October 17, 2005 in response to Message #188136
This is a great topic.Most of the J2EE frameworks have a strong "architectural" bias towards loosely coupled layering. The advantange of this approach is that you can that you can swap out the different pieces. For example you can swap JDO <-> Hibernate, and the Struts framework is not affected.The disadvantage of this approach, is that we have to write all the glue code to support this loose coupling. Hence the importance of frameworks like Spring which help us with this task.To see the problem with the current J2EE approach think about form valiation. We have a database table column with a not null column that has a maximum length of 10 characters. This database column maps to some Java object attribute. In a traditional J2EE we app we have this validation metadata information in:* database schema* ORM mapping files* Business tier validation, e.g. Service layer, DAO etc.* Appliation tier validation, e.g. struts Form * JSP If we change this column width to 15 characters we have to go through the entire appliction stack and make sure we haven't missed something.This is daft, and is a case in point why J2EE web app development is so painful.The RoR design principle of Dont Repeat Yourself (DRY) is very important, and will lead to more robust code and higher productivity. In OO terms this is encapsulation.I believe emerging Java frameworks will take these important design principles on board and provide us with a high productivity development environment.Malcolm Edgarhttp://click.sourceforge.net

Having to change all layers because of a column length shift sounds like you ever architected your system. This is not a J2EE problem. This is a *your* team problem.

  Message #188142 Post reply Post reply Post reply Go to top Go to top Go to top

Great Topic - DRY

Posted by: Bruce Tate on October 17, 2005 in response to Message #188139
I can see RoR having an advantage for "Mickey Mouse systems" which are a single developer effort, but not so much for applications which require a larger number of developers.

I used to think the same thing, but Ruby on Rails can go far beyond Micky Mouse. For example, the most advanced publisher in the industry built their publishing system, their ordering, fulfillment, inventory, and catalogue system entirely on Ruby on Rails. It's not just for toys. But you won't have to kill yourself to make a toy, and this makes the technology approachable. I know I won't convince you, but I can let others know to try it themselves before coming to this incorrect conclusion. I hate quick and dirty, but ror is quick and clean.

  Message #188143 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Mike Perham on October 17, 2005 in response to Message #188131
Here is my J2EE database app. Under NetBeans 4.1 on my laptop I change a JSP. I redeploy ready for debugging in less than 20 seconds. What is this 2 minute deployment cycle?

Now change an EJB. Change a Struts Action class. Yeah, maybe two minutes is pushing it but my Websphere cycle requires me to run a 300MB IDE, 300MB server and redeploying the app with every change takes 30 seconds while the app starts. This is 30 seconds where you get unfocused, check your email, twiddle your thumbs and basically lose productivity. These little things matter and Ruby's 0 seconds prevents that context switch.

The same has been said over many, many years about PERL, TCL, Python and now Ruby. There is as yet no evidence after several years that any of these scripting languages are truly general purpose. Java has had major development teams working on the VM in order to give close to C/C++ performance.

They didn't have rails. Rails is the key because its productivity increase makes it a real contender for small-site development. And as it gets used more and more, corporate and enterprise usage and scaling up will follow. Remember this is not a system for building 10000 concurrent user site yet but those systems are not the common case; Ruby/Rails can fulfill the vast majority of web site performance requirements and it will only get better over time.

One simple question, Steve: have you actually tried Rails? I was a naysayer: I started my own part-time project in June on Rails and gave up in frustration. Switched to Java but gave up on that after two months - I was spending 75% of my time setting up Eclipse, WTP and other tools to minimize the dev cycle. I went back to Rails last week and within 2 days had the equivalent app written in Rails. Much of this success is due to the recent release of the first decent free IDE for Ruby, Radrails, written on the Eclipse platform, no less.

  Message #188145 Post reply Post reply Post reply Go to top Go to top Go to top

Overloaded

Posted by: peter lin on October 17, 2005 in response to Message #188135
Good grief, the FUD-o-meter is overloaded!Re: refactoring and dynamic languages:Please don't make comments like "refactoring can't be done in dynamic languages" or "nothing like IDEA" or some such nonsense unless you know what you are talking about, or you at least google a little :). Someone at least mentioned Will Opdykes' paper (which in turn, if you at least read it before you comment, was influenced by work done by Ralph Johnson at UIUC and Brian Foote in the mid 80s). Anyone at all who used Smalltalk on any significant project can tell you about the refactoring browser, and the capabilities of most all Smalltalk IDEs, starting with Objectworks/ST-80. So saying "dynamic" languages don't support refactoring is just plain ignorance.And as for ROR, use it. Read about it. Pick up the pickaxe book by Dave Thomas, and read about Ruby. Get the Agile book by Ruby's creator. Write some projects using Rails. Look at some applications created using Rails (try http://www.37signals.com for a few links). The creator of Rails, David Heinemeier Hansson, maintains a blog at http://www.loudthinking.com, where he discusses everything Rails related. In other words, for Pete's sake, educate yourself. If you don't believe that Ruby is more productive than Java, or Rails lets you build Web applications easier, or Ruby or Rails somehow isn't ready for the "Enterprise" (whatever that means), then don't listen to Dave Thomas, or Andy Hunt. Or Bruce Tate, or Bruce Eckel, or James Duncan Davidson, or...I didn't listen to them either. But then several months ago I tried Ruby, then Rails, and I saw for myself. Maybe you will too.I teach Java and J2EE to feed my kids. But when I want to write an application to solve a problem, its not what I turn to first, at least, not anymore. This community is starting to remind me a whole lot of the C/C++ community when I first learned Smalltalk so long ago, and the C/C++ community when I first learned Java so long ago.

As they say, those that forget history.....--Brian

history tends to move in cycles, so how is this any different than CICS vs RISC or any number of other battles. Everyone is different and not everyone cares about the cutting edge. I don't think anyone claimed refactoring is impossible, but clearly there are differences in terms of how refactoring would work.

From a compiler and lexer perspective, these aren't trivial issues. Correctly parsing a dynamic language to "intelligently refactor" code isn't as simple as just search replace. Rather than talk in abstract terms, say I create a service interface in Java.

public interface myservice {
  void doService() throws ServiceException, TransactionException;
  void doService(Document) throws ServiceException;
}

Say I have client code that implements the interface and I have 1000 unit tests that also use the interface. Some time later, I decide the first method needs to throw a ValidationException. Given the unit tests and client code will try/catch the exception differently, I have 2 options: #1 hope the refactoring is smart enough to do it, or manually change all 1000 unit tests. Since Ruby exceptions are different, an IDE would need to handle it differently. I don't know which one would be easier to be honest, but clearly Ruby's dynamic-ness requires different approaches to refactoring and IDE's.

even in eclipse, handling this type of case is pretty challenging. Unless I use a high level DSL to describe my unit tests and code generate the JUnit tests, there really isn't an easy way to refactor. Though some people might not consider this case refactoring, since it's changing the functionality of the interface.

peter lin

  Message #188146 Post reply Post reply Post reply Go to top Go to top Go to top

RE: Great Topic - DRY

Posted by: Phil Barnes on October 17, 2005 in response to Message #188140
... To see the problem with the current J2EE approach think about form valiation. We have a database table column with a not null column that has a maximum length of 10 characters. This database column maps to some Java object attribute. In a traditional J2EE we app we have this validation metadata information in:* database schema* ORM mapping files* Business tier validation, e.g. Service layer, DAO etc.* Appliation tier validation, e.g. struts Form * JSP If we change this column width to 15 characters we have to go through the entire appliction stack and make sure we haven't missed something. ...
Having to change all layers because of a column length shift sounds like you ever architected your system. This is not a J2EE problem. This is a *your* team problem.

Please be reasonable and don't look for something to be wrong in the details. What if the data type was an integer but was insufficient and needed a long? What if a boolean needed to be turned into a char? What if a date was stored as a string and then needed to be converted to a date and time?

  Message #188147 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: David McCoy on October 17, 2005 in response to Message #188143
Here is my J2EE database app. Under NetBeans 4.1 on my laptop I change a JSP. I redeploy ready for debugging in less than 20 seconds. What is this 2 minute deployment cycle?
Now change an EJB. Change a Struts Action class. Yeah, maybe two minutes is pushing it but my Websphere cycle requires me to run a 300MB IDE, 300MB server and redeploying the app with every change takes 30 seconds while the app starts. .

Even an EJB changes doesn't necessarily require 2 minutes, but what if you don't use EJBs? J2EE isn't EJBs. Actions can be done without a restart depending on the nature of the change with Java's admittedly poor hotswap. Regardless, the code reuse and maintainence is more than made up by the reuse and flexibility offered by Java.

Again, all we here is
1) faster restart
2) faster prototyping

Not thick enough.

One likes Ruby because his team is unable to design their app to withstand minor changes without a dozen updates.

You like Ruby because you had problems setting up eclipse(no offense). This tells me the other guy over-engineered is app and you have issues with Eclipse.

What if you don't have these problems? What if you can write your apps quickly, without 2 minute deployments, and no tool issues?

What if you want your application architecture and subsequent applications based on it to run run on anything from Tomcat to Websphere with declarative AOP, transaction support, messaging, etc and is backed by industry heavyweights?

What then?

  Message #188148 Post reply Post reply Post reply Go to top Go to top Go to top

RE: Great Topic - DRY

Posted by: David McCoy on October 17, 2005 in response to Message #188146
... To see the problem with the current J2EE approach think about form valiation. We have a database table column with a not null column that has a maximum length of 10 characters. This database column maps to some Java object attribute. In a traditional J2EE we app we have this validation metadata information in:* database schema* ORM mapping files* Business tier validation, e.g. Service layer, DAO etc.* Appliation tier validation, e.g. struts Form * JSP If we change this column width to 15 characters we have to go through the entire appliction stack and make sure we haven't missed something. ...
Having to change all layers because of a column length shift sounds like you ever architected your system. This is not a J2EE problem. This is a *your* team problem.
Please be reasonable and don't look for something to be wrong in the details. What if the data type was an integer but was insufficient and needed a long? What if a boolean needed to be turned into a char? What if a date was stored as a string and then needed to be converted to a date and time?


If moving an int to a long required the changes described, the architecture, not anything in java, is at fault.
I use Strings and dates and I've never had to do as much as you described. I use the same domain object in the front, middle, and data tier because of how Struts, Spring, and Hibernate work. But my domain objects are not, in any way tied to the DB.

Sorry, but I just cannot accept that argument.

  Message #188149 Post reply Post reply Post reply Go to top Go to top Go to top

RE: Great Topic - DRY

Posted by: Malcolm Edgar on October 17, 2005 in response to Message #188148
I think you are missing the point.

Because there is no integration in the traditional J2EE stack we need to duplicate this database's constraint information up through the stack. This is tedious and error prone work.

  Message #188150 Post reply Post reply Post reply Go to top Go to top Go to top

What about something like WebObjects DirectToWeb and ...

Posted by: Ashley Aitken on October 17, 2005 in response to Message #187896
I've only had a brief look at Ruby on Rails but from what I have seen it looks like a "toy" compared to something like Apple's WebObjects DirectToWeb and other technologies.

With DirectToWeb you can go from a relational database model to a functional and scalable three-tier Web application with CRUD functionality (including to-one and to-many relationships) and quite a reasonable Web interface without any coding. The CRUD interface and a lot of the control functionality is then fully customisable with a rule-based system (via an interactive Java applet or writing the rules directly). One than then go on to add custom Java logic to business classes, and custom interface pages. The Web interface is also fully customisable in terms of look and feel.

DirectToJavaClient is even more amazing. It does all of the above CRUD, but for a Java client application. Yes, it produce a full Java application, interface and all, (with no code generation) that is fully customisable using the same rule-based system (with a similar interactive Java applet or by writing the rules directly). The client-side Java application also supports (by default) client-side business objects,\ that save back to the application server and then to the relational database. The client-side Java application can also be extended with custom interfaces.

And, I could go on with DirectToWebServices.

WebObjects is primarily Mac only now, but that doesn't mean the tools and technologies are any less impressive.

Cheers,
Ashley.

  Message #188151 Post reply Post reply Post reply Go to top Go to top Go to top

RE: Java -> Ruby

Posted by: Phil Barnes on October 17, 2005 in response to Message #188147
Even an EJB changes doesn't necessarily require 2 minutes, but what if you don't use EJBs? J2EE isn't EJBs. Actions can be done without a restart depending on the nature of the change with Java's admittedly poor hotswap.

My (daily) experience, not using EJB's, using the 'SSH' stack, is that I'm constantly having to cycle my application. Currently that takes "only" 15-20 seconds, but it certainly is annoying.
Regardless, the code reuse and maintainence is more than made up by the reuse and flexibility offered by Java.

You're implying that Java is more flexible and creates more reusable code than Ruby on Rails -- that doesn't sound quite right.
Again, all we here is
1) faster restart
2) faster prototyping
Not thick enough.

How about little to no restart and faster development from start to finish? ;)
One likes Ruby because his team is unable to design their app to withstand minor changes without a dozen updates.You like Ruby because you had problems setting up eclipse(no offense). This tells me the other guy over-engineered is app and you have issues with Eclipse.

It appears you have oversimplified both cases to suit your arguments. I'm not sure who your first "one" is, but early stages of development are very, very often riddled with minor changes that can easily ripple throughout all layers of a code base. If you have had the fortune of being able to code your app perfect from scratch the first time, with 100% of your requirements defined before you touch a line of code, your experience differs greatly from mine (even though I wish otherwise ;). And setting up Eclipse for J2EE development is not a trivial task, especially for new developers.
What if you don't have these problems? What if you can write your apps quickly, without 2 minute deployments, and no tool issues?

Sounds utopian. :)
What if you want your application architecture and subsequent applications based on it to run run on anything from Tomcat to Websphere with declarative AOP, transaction support, messaging, etc and is backed by industry heavyweights?What then?

I don't think anyone here has proposed using Ruby or RoR for such requirements. I could propose an opposite scenario: What if you are developing a web-based, database driven intranet application for a client and you control the schema?

  Message #188152 Post reply Post reply Post reply Go to top Go to top Go to top

Not paying enough attention.

Posted by: Bruce Tate on October 17, 2005 in response to Message #188147
Again, all we here is
1) faster restart
2) faster prototyping

It's clear you've never tried this stuff, or didn't get it if you did. Rails is different, and it has many credible advantages. They may not be priorities of yours. But for starters, try these benefits in Rails:

- Rapid feedback cycle. Huge benefit.
- Less code, and much less configuration.
- Meaningful defaults.
- Less repetition.
- Better metaprogramming.
- Better AJAX support.
- Better productivity. (not just prototyping.)
- Tighter mapping for the intended case (you control your schema).
- Console for working directly with database-backed persistent objects.
- Generation of test code by default.
- Baked in testing, fixtures, unit and functional tests.
- Common project structure, created with one command
- One-command installation for Rails plus dependencies
- Much quicker ramp up

And in the language:

- Closures
- Continuations
- Parallel assignments
- Open classes
- Modules (mix ins)
- Better data expression (less XML)
- Better string processing (ranges, first-class regex, etc)

In short, it's a higher-level *language*. Call it a toy scripting language if you want to, but that ignores the power of the language, and it's not an educated opinion.

If you want some valid complaints, try these:

- No hard core ORM (but that's changing.)
- No distributed two phased commit.
- Poor internationalization, but that's changing.
- Less community
- No credible JVM implementation (but that's changing rapidly).
- Fewer IDE with less refactoring support.
- Fewer open source projects
- Not as much commercial backing
- Not as many jobs
- Tougher sell politically

and many others. But being a non-performant, quick and dirty framework is not a valid criticism. Nor is it an educated one. I still recommend Java for over half of the projects I face. But when Rails is right, it's incredible.

  Message #188153 Post reply Post reply Post reply Go to top Go to top Go to top

crazy idea

Posted by: peter lin on October 17, 2005 in response to Message #187896
Here is crazy idea for the community to ponder. What if Sun or IBM were to fund JRuby and ROR development for a year to make sure ROR can run on the JVM?

wouldn't that be a win/win proposition for Java and the java community?

peter

  Message #188154 Post reply Post reply Post reply Go to top Go to top Go to top

crazy idea

Posted by: Bruce Tate on October 17, 2005 in response to Message #188153
Someone certainly will. IBM embraced PHP, so it won't be them. Who then?

  Message #188156 Post reply Post reply Post reply Go to top Go to top Go to top

Not paying enough attention.

Posted by: Steve Zara on October 17, 2005 in response to Message #188152
But for starters, try these benefits in Rails:- Rapid feedback cycle....

Here is the problem from my point of view. Virtually nothing you are describing (apart from one or two things such as AJAX) has not been seen or done before by previous languages (yet again I mention Smalltalk) many years ago ago. I have seen and used all these benefits. I have seen them promoted as vigorously and with as much enthusiasm. But sooner or later these languages have to face the stark reality of being general purpose and high performance, no matter what the benefits. Ruby was not designed with these criteria in mind. If languages can't meet these criteria they will fail and fade, hopefully leaving behind some influence on mainstream development.

  Message #188157 Post reply Post reply Post reply Go to top Go to top Go to top

Not even the next thing

Posted by: Hacking Bear on October 17, 2005 in response to Message #187968
What I do see is that RoR tries persistively and desperately pretend it _is_ a next big thing. Well, it is next, but not that big. I admit there might be some reasonably good ideas in RoR, but to overthrow Java it would need to become much more than it is now.

Agree, but RoR is not even the next thing. This is nothing new but the old MDA approach. We have this domain model-driven CRUD framework implemented in Java for over a few years. All I could say is that RoR, at its current form, is still like a toy needing a lot more fine-tuning. And CRUD operations are just a small part of a real-world app. In fact, it is becoming less significant part in our whole system.

However, the Ruby and RoR people seem to have succeed at driving away the .Net advocates from this forum.

  Message #188158 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Steve Zara on October 17, 2005 in response to Message #188143
The same has been said over many, many years about PERL, TCL, Python and now Ruby. There is as yet no evidence after several years that any of these scripting languages are truly general purpose. Java has had major development teams working on the VM in order to give close to C/C++ performance.
They didn't have rails. Rails is the key because its productivity increase makes it a real contender for small-site development.

So Rails gives Ruby C/C++ performance? Neat! How?
Ruby/Rails can fulfill the vast majority of web site performance requirements and it will only get better over time.

Let me know when there is a Ruby VM that matches Java performance.
One simple question, Steve: have you actually tried Rails?

Yes. I gave up when I saw that there was no portable query language (I routinely switch my development between PostgreSQL, MySQL and Oracle and I want to use the full features of each, not some minor SQL subset), and when I found out that there was no internationalisation support (I will be working on multi-lingual websites).

  Message #188159 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Brian Neal on October 17, 2005 in response to Message #188147
Even an EJB changes doesn't necessarily require 2 minutes, but what if you don't use EJBs? J2EE isn't EJBs.
Sure they do, if you update an interface and not a bean implementation class, which in WebLogic at least requires a restart. And J2EE isn't EJBs? What spec are they a part of, then? :)
Again, all we here is
1) faster restart
2) faster prototyping
Not thick enough.
You're just not getting it. If that's all you think Rails (let alone Ruby) offer, you're not making an educated opinion. Seriously, you need to try it. The Rails video is the beginning, not the end.
What if you don't have these problems? What if you can write your apps quickly, without 2 minute deployments, and no tool issues?
Do you honestly work in this kind of environment?

  Message #188160 Post reply Post reply Post reply Go to top Go to top Go to top

c /c++/Java/, and c /Ruby/Java/

Posted by: Bruce Tate on October 17, 2005 in response to Message #188156
Where have I heard that before?

  Message #188161 Post reply Post reply Post reply Go to top Go to top Go to top

Behind Java

Posted by: Hacking Bear on October 17, 2005 in response to Message #188004
Indeed, RoR does not even do a good and usable CRUD simple app, unless you start writing real non-modeling codes again.

I'm amazed on development conference can even be organized for such a framework.

  Message #188162 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Brian Neal on October 18, 2005 in response to Message #188158
So Rails gives Ruby C/C++ performance? Neat! How?
Let me know when there is a Ruby VM that matches Java performance.

Smalltalk had "close to C/C++" performance (your words). Hell, when I was at OTI our Smalltalk VMs used to routinely beat C/C++ apps running the same functional code. Didn't save it.

Are people still really calling Perl and Python scripting languages, or is that just sarcasm I hear?
Yes. I gave up when I saw that there was no portable query language (I routinely switch my development between PostgreSQL, MySQL and Oracle and I want to use the full features of each, not some minor SQL subset)
Honestly, enlighten me. What portable features is ActiveRecord missing that you need?

  Message #188163 Post reply Post reply Post reply Go to top Go to top Go to top

c /c++/Java/, and c /Ruby/Java/

Posted by: Steve Zara on October 18, 2005 in response to Message #188160
Where have I heard that before?

I have no idea. My point is that I have heard it all before. I remember nearly 20 years ago when Smalltalk and Prolog were the revolutionary new languages that had all the big ideas that were going to change software development. I even used them and believed the hype at the time.

Most software development has barely caught up with ideas from that long ago, so forgive me if I seem cynical about anything that is labelled as the next big thing....

  Message #188164 Post reply Post reply Post reply Go to top Go to top Go to top

JRuby

Posted by: Lyndon Samson on October 18, 2005 in response to Message #188154
JRuby kicks ass, and it runs under DotNet via IKVM as well!

  Message #188165 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Steve Zara on October 18, 2005 in response to Message #188162
Smalltalk had "close to C/C++" performance (your words).

No, not my words (or if they were, I mistyped). I had 4 criteria for language use. The one that Smalltalk most commonly failed on was speed. I could get very high-performance Smalltalk implementations, but they were not cross-platform.
Hell, when I was at OTI our Smalltalk VMs used to routinely beat C/C++ apps running the same functional code.

Yes, but not for general purpose use.
Are people still really calling Perl and Python scripting languages, or is that just sarcasm I hear?

No sarcasm, just common usage. I mean nothing bad by it.
Yes. I gave up when I saw that there was no portable query language (I routinely switch my development between PostgreSQL, MySQL and Oracle and I want to use the full features of each, not some minor SQL subset)
Honestly, enlighten me. What portable features is ActiveRecord missing that you need?

A rich portable query language that is expressive and be automatically translated into high-performance SQL for the dialect of the database I am using.

Oh, and I would like to be able to use that query language on non-relational stores... XML files, LDAP etc.

  Message #188166 Post reply Post reply Post reply Go to top Go to top Go to top

Yes it is what me too sensing

Posted by: sezhian gk on October 18, 2005 in response to Message #187986
Yes by 2008 there wont be a enterprise developer only assemblers with development knowledge.
So guys focus on evergreen gaming and Robotics market.

  Message #188168 Post reply Post reply Post reply Go to top Go to top Go to top

Don't abandon Java just yet

Posted by: Geert Bevin on October 18, 2005 in response to Message #188130
I firmly believe auto-generation in either direction is just plain wrong. Maybe some fancy middlegen tool can create both from a common definition, but I think that if you are going to create a db schema from java objects or create java objects from a db schema then you are just going to make a mess of one of them. Just phoning in the database schema design is a sure way to cripple a project.Taking the extra time to do both right will pay off dividens for YEARS to come for most projects. Sure, it doesn't mean anything for a throw away demo. But how many of those "throw-aways" suddenly become the initial production version.

I agree with that, it's handy though for very trivial applications. Anything a bit more complex should of course be properly designed.

  Message #188169 Post reply Post reply Post reply Go to top Go to top Go to top

Overloaded

Posted by: Brian Neal on October 18, 2005 in response to Message #188145
I don't think anyone claimed refactoring is impossible, but clearly there are differences in terms of how refactoring would work.

Sure they did.

Cedric:
It's easier because it's much more limited :-)

Your examples only touch the very easy (and somewhat rare) cases of refactorings. They also only show dynamic refactorings as opposed to simple static (at the text editor level, not design).

With dynamic languages, something as simple as renaming a method in a class can pretty much only be done by text replacing, which is of course unacceptable.

People who say that Smalltalk showed that it was possible have obviously never used Smalltalk IDE's, which only did the simplest refactorings (such as extracting methods).

Modern Java IDE's have raised the bar very high in terms of refactorings, and as far as I can tell, it's just plain impossible to reach that bar with dynamic languages.

Cedric, redux:
As I said above, Smalltalk refactorings don't even come close to what we do today with Eclipse and IntelliJ. They were also working on projects that were much simpler than today's.

And it's not a coincidence: in my opinion, some of these refactorings are just plain impossible to achieve with dynamic languages (more details here).

This shouldn't come as a surprise: you gain some readability by omitting types here and there, but there is loss of information. Humans might be more comfortable with less typing information in the code they read, but IDE's surely aren't, and if you don't give them these types, they won't give you refactoring.

These statements are simply not true. There is no question that refactoring has evolved, and there are differences between language implementations in refactoring (as you yourself rightly pointed out), but to say that they are impossible is just false. This is not any kind of knock on Cedric, he's obviously a very bright guy, but he's just misinformed on this issue.

As for your exception example, you're right, its probably not the best example because we could argue that changing the functionality of the interface is not a refactoring (would be a good discussion, but for the sake of brevity...), or we could argue that its just Change Method Signature, or we could argue that its not a refactoring at all because from the Java side of things, simply adding an exception to your first doService() method in the interface doesn't require classes implementing that interface to even be recompiled, much less refactored, or from the Ruby side of things I could put that exception signature in a mixin and add it, at runtime even, or a module, or half a dozen other things.

Also, there is a clear separation between tool issues and language issues. If, as you mention, you use a DSL to describe your unit tests (something a little like fixtures and the Mock support in Rails), and you use a tool to generate all your unit tests, then we aren't at a language issue anymore, are we? If the language supports the concepts behind a refactoring, and I haven't seen anything in Eclipse or IDEA yet that, assuming its even applicable, couldn't be done in Ruby, then its just a tool issue.

A tool issue that doesn't bother me in the slightest. Saying that a programming language requires an IDE to be successful (or worse, refactoring support in an IDE) just doesn't cut it for me, and never has. A good tool will only make Ruby and Rails more accessible, but they are by no means a necessity for either one to be successful.

I can tell you this, after almost a year of Ruby development, I hardly use any refactorings anymore. I find that Ruby lets me express things in a way that Java just can't, so I write clearer and cleaner code the first time. But I bet the RubyEclipse folks have them on the map somewhere. The Test::Unit runner is such a joy to use, I can't wait to see what they come up with.

So, from my standpoint, the presence of functionality I don't use is no barrier to adoption for me.

So I am not sure what point you are trying to make. :) My point was that saying refactoring is impossible in "dynamic" languages is naive at best.

My other point was that the majority of people in this thread exhibit the same tendency to pooh-pooh or dismiss out of hand what Rails and Ruby have to offer, and to me, they sound a lot like the same people who said the same things about Java when it first started.

--Brian

  Message #188170 Post reply Post reply Post reply Go to top Go to top Go to top

Not paying enough attention.

Posted by: Jan Vissers on October 18, 2005 in response to Message #188152
Tighter mapping for the intended case (you control your schema).

Are you referring to a database schema? If so, you're ignoring the fact that for most larger scale applications the database schema is already there. It is highly unlikely that new applications that need to use an existing database schema are allowed to "control" that schema and rightly so. I've seen a RoR demo where changing the column sequence in a table has direct effect on the UI, if you think this cool by all means use it - I think it is horrible.

The most other benefits you mention for Rails are equally well accomplished by good use of existing frameworks, IDEs and build systems.

  Message #188171 Post reply Post reply Post reply Go to top Go to top Go to top

Ruby Performance was +1

Posted by: Kirk Pepperdine on October 18, 2005 in response to Message #188070
I'am getting really tired about comments saying that fast development doesn't mean anything. It does mean a lot. Why should we wait and wait and wait forever, i'v waited enough, more than enough. Make that hotswap accept API changes, for goodness sake PLEASE!
The real question we should be asking is this: Why isn't the JVM the best platform for Ruby to be running on, and how do we "fix" it so it is?Peace,Cameron PurdyTangosol Coherence: The Java Data Grid
I'm very interested in JRuby. I'm about ready to start promoting unit tests for Java in the Ruby language. JRuby is not there yet, but it's getting very close. I think it's passing more than 90% of the existing Ruby test cases now.

I've no personal experience with this but the buzz on the street this that Ruby performance sets you back to the JDK 1.0. Certianly users are not going to be satisfied with taking that size of a performance hit without some grumbling no matter how must faster you get the application into their hands.

  Message #188172 Post reply Post reply Post reply Go to top Go to top Go to top

Reduced configuration...

Posted by: Timur Evdokimov on October 18, 2005 in response to Message #187990
Most of us take a big fat relational database and front it with a web UI.

"Big fat relational database?" If it's really that big and fat relational legacy database with cryptic field names and hundreds of fields I encounter sometimes, that's just exactly the case against CRUD-based techniques. If you need to put a web frontend onto such an ugly thing, you'd rather make a layer of DAOs above it, isolating the rest of your application from that ugliness.

  Message #188173 Post reply Post reply Post reply Go to top Go to top Go to top

Some more thoughtful posts please?

Posted by: Kirk Pepperdine on October 18, 2005 in response to Message #188079
A lot of the posters here seem a tad, um - defensive. Many of the responses run the line of: 4 nights != development, blah blah.It sure is easier to crank out a knee-jerk reaction to the serverside poster's one-paragraph summary than to take the time to read and possibly think about Bruce's article.

Editorial note, it's not my role to inline the article in this forum which is why the link is provided.

  Message #188174 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Kirk Pepperdine on October 18, 2005 in response to Message #188165
Hell, when I was at OTI our Smalltalk VMs used to routinely beat C/C++ apps running the same functional code.

I've used several versions of Smalltalk over the years and I would have to say that this is not my experience. In just about every case, C applications ran faster then their Smalltalk counterparts. There are conditions where Smalltalk will run as fast as C application but in those cases I would bet that the application was bound on an external resource and hardly touching the CPU.

  Message #188175 Post reply Post reply Post reply Go to top Go to top Go to top

Java -> Ruby

Posted by: Brian Neal on October 18, 2005 in response to Message #188165
No, not my words (or if they were, I mistyped).

I picked them up from your post, I think:
The same has been said over many, many years about PERL, TCL, Python and now Ruby. There is as yet no evidence after several years that any of these scripting languages are truly general purpose. Java has had major development teams working on the VM in order to give close to C/C++ performance.
Emphasis mine.
I had 4 criteria for language use. The one that Smalltalk most commonly failed on was speed. I could get very high-performance Smalltalk implementations, but they were not cross-platform
So, which was it? Speed, or cross-platform? :) I would say the only criteria I saw in your list that Smalltalk failed was free. There were some platform specific Smalltalk implementations (Digitalk, but it was a big hit in banking, for example, and later Dolphin come to mind), but I never used Smalltalk on a project where its lack of platform support was much of an issue. Back when Parc added VisualWorks to ST-80, it was one of the higher visibility cross platform UI approaches around at the time.

As for not general purpose, well, it didn't stop TI's Works project, or CBOE, or any other project I worked on.

<Shrug>, I miss Smalltalk just like you, TPTB failed it in my opinion, nothing to do with the language or the environments, but we agree at least that nothing new has come along. But, I know this. When I code in Ruby and/or Rails, it feels the same way coding in Smalltalk used to, and I bet it would for you too. It would be a shame for such an obviously bright and experienced guy like you to dismiss it.

Oh, and have another look at ActiveRecord. I use it every day to write queries against MySQL, Postgres, and even a little Oracle when I have to :), and I don't have to translate anything :) What you're aiming at sounds like HQL to me, but while ActiveRecord and Hibernate have different goals (see Fowler's article on Application Databases vs. Integration Databases), whether I own the schema or I inherit it, or it changes, I don't see a lot that you need to do that AR doesn't help out with. Fringe cases, maybe? Taking the perspective of the average application developer, put it this way--If Rails hits 80% of the cases for me with AR, and I don't have to learn something like HQL and the XML configuration, then what?

--Brian

  Message #188176 Post reply Post reply Post reply Go to top Go to top Go to top

Ruby Performance was +1

Posted by: Brian Neal on October 18, 2005