Fishing for ideas: Ruby-talk for Java coders

Hi all,

sorry to reiterate an old topic:

Stefan and I have the lucky chance to give a talk about Ruby to the IT-
development stuff of a company of Java-only coders.

In the past this company had some smalltalk-based solution, but then
jumped on the Java bandwagon. There will at most be 1 smalltalk coder (he
has seen the light) there.

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

I guess we /must/ mention interoperability with Java.

Thanks for your help,
-A.

···

Armin Roehrl, http://www.approximity.com
We manage risk

  • The ways in which Ruby beats Java in OO design

    • Subclassing of built-in types
    • Everything (numbers and characters included) supports .kind_of? and stuff
      (Because Java coders like to think their language is the ultimate in OO
      design)
  • The way in which Ruby beats Java when it comes to super simple programs
    (Because in Java the simplest program still requires a class, main function,
    etc)

  • Mention that Ruby is open-sourced unlike Java

  • Show off the Ruby interpreter (something Java lacks)

  • Introduce things like blocks, bindings, continuations, etc.

···

On Mon July 28 2003 1:06 pm, Armin Roehrl wrote:

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

I guess we /must/ mention interoperability with Java.

This is stuff I really like about Ruby coming from Java. In general I
found Ruby’s terse syntax the most appealing, sick of typing “static
public final int XXX”, etc. ‘@’ and friends work just as well.

  • Easy file IO

IO.foreach(“myfile”) do |line|
#do something
end

Compare this to creating at least 2-3 objects for doing IO in java
(reader, buffer, file)

  • Class def shortcuts like attr_accessor, @, @@.

  • Module concept, for both namespaces and including code into other
    classes.

  • (what I think is) really good integration with win32 thanks to
    win32ole module. I can script Crystal Reports, MS Sql Server, Word, etc.

  • Create executables with exerb.

I am only fishing for ideas. What would you focus on? We have 60
minutes of talking time.

I would suggest the use of Ruby as a tool to assist in Java development
- command line utilities
- simple file handling
- prototyping ideas/algorithms

I guess we /must/ mention interoperability with Java.

I do not see why. Ruby is unlikely to replace Java, so position it as a
complimentary tool that does other useful stuff.

Pete

···

On Monday, July 28, 2003, at 11:06 am, Armin Roehrl wrote:

Pete McBreen, McBreen.Consulting , Cochrane, AB

Author, “Software Craftsmanship The New Imperative”
Winner of 2002 SD Productivity Award

Author: “Questioning Extreme Programming”
Addison-Wesley (c) 2003

Hi all,

sorry to reiterate an old topic:

Stefan and I have the lucky chance to give a talk about Ruby to the IT-
development stuff of a company of Java-only coders.

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

For me it’s:

  1. Iterators - Java forces you to write scaffodling, Ruby just does it.
  2. mod_ruby/eRuby laughs at JSP speedwise.
  3. ‘everything is an object’ - no, really :slight_smile:
···


When I was a boy I was told that anybody could become President. Now
I’m beginning to believe it.
– Clarence Darrow
Rasputin :: Jack of All Trades - Master of Nuns

I am only fishing for ideas. What would you focus on? We have 60 minutes
of talking time.

In my opinion, you should try to focus on language features (blocks,
iterators, dynamicity etc.), because Java will definitely loose this
part of the battle against Ruby. Show how easy using Arrays and Hashes
is compared to Java’s Collection mess.

But beware: This focus will lead to Java’s greatest strength very fast,
i.e. “Java the platform” and not “Java the language”. Every clever Java
coder will talk like this: “So, I see that it is very easy to implement
feature XYZ in Ruby, because it is a very nice language. But: Why should
I implement it anyway? I can find this in java.x.y.z, if I need it. And
if not, I can it in org.apache.xyz.”.

We have to admit, that this is right in some cases, but you should
emphasize, that even Java does not provide everything a programmer needs
and that Java is currently growing too fast and too big. I am sure that
the average Java coder today will implement feature XYZ in Java despite
the fact that it’s already there and - even worse - he is going to do it
using “Java the language”. Very painful! And we should not forget, that
many APIs provided by Java - even core APIs like Collections etc. - are
just a pile of #$%& that nobody really wants to work with.

I guess we /must/ mention interoperability with Java.
Hmm … the [pj]ython guys are lucky. Ruby still lacks a clean bridge
to the Java world. We need interoperability with Java, .NET and
especially (hello, matz ;-)) with parrot as soon as possible IMHO.
This way we are able to convince people of Ruby’s strengths by simply
providing compiled code, that we developed several times faster than
they were ever able to using their favourite programming language. But
that’s another thread …

Cheers,

As some others already said.

  • Ruby is a good “tool”.
  • Don’t try to blame Java.
    (But be prepared for questions which focus on comparing Ruby to Java.)

Mention that some things cry for dynamically typed languages and
suggest to use Ruby instead of Perl, PHP, VB, etc…

I like this one:
http://www.testing.com/writings/bypassing-the-gui.pdf
The author (Brian Marick) uses Ruby instead of VB to (regression-) test
COM-objects.

Cheers
Sascha

···

Armin Roehrl armin@xss.de wrote:

Stefan and I have the lucky chance to give a talk about Ruby to the IT-
development stuff of a company of Java-only coders.

JRuby… I never tried it?

Which kind of task do they do in that company ?

  • xml stuff … rexml.
  • database … perhaps talk about DBI, plruby.
  • web solutions … mod_ruby.
  • software for handhelds … ?

Can you reveal more of what the company is doing ?

···

On Tue, 29 Jul 2003 03:06:48 +0900, Armin Roehrl wrote:

I guess we /must/ mention interoperability with Java.


Simon Strandgaard

I’d probably show similarities between Ruby and Java (to make them feel at
home), like
package ↔ module
import ↔ require
class ↔ class
toString() ↔ to_s

And then add those things where Ruby shines:
blocks
closures
iterations
irb
multiple inheritance shown with Enumerable

robert

“Armin Roehrl” armin@xss.de schrieb im Newsbeitrag
news:oprs05s802p9wr6c@mail.xss.de

Hi all,

sorry to reiterate an old topic:

Stefan and I have the lucky chance to give a talk about Ruby to the IT-
development stuff of a company of Java-only coders.

In the past this company had some smalltalk-based solution, but then
jumped on the Java bandwagon. There will at most be 1 smalltalk coder
(he
has seen the light) there.

I am only fishing for ideas. What would you focus on? We have 60 minutes
of

···

talking time.

I guess we /must/ mention interoperability with Java.

Thanks for your help,
-A.


Armin Roehrl, http://www.approximity.com
We manage risk

my 2c:
they won’t let java.
Not soon at least.

So you should’nt try to show them how you can replace java, but how
ruby can help java development.
BTW, with time, they’ll notice that ruby is the best thing since
sliced bread and move theyr focus on it.

So, what to show?

  • ruby as a tool generator
    ( automating builds, automating tests, or better automating test
    generation…)

  • ruby as a code generator
    ( sql/javacode/xml_deployment_files and so on from stubs…
    hey did I see a book related to this here? :wink:

  • ruby as an embeddable domain language
    ( show DataVision , using JRuby scripts
    to keep details out of the main abstraction.
    PragProg’s stuff for more on this point )

  • ruby as a prototype language
    ( DAO strategies via open classes, iterators and so on goes here)

  • ruby for one-time operations
    ( such as adding that old COBOL record file to your new ORDBMS…
    regexp and File,IO goes here)

  • maybe, ruby for mock components, via JRuby or in the case of
    client/server stuff for one of the two

···

il Tue, 29 Jul 2003 02:06:48 +0900, Armin Roehrl armin@xss.de ha scritto::

Ben Giddings wrote:

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

I guess we /must/ mention interoperability with Java.

  • The ways in which Ruby beats Java in OO design
    • Subclassing of built-in types
    • Everything (numbers and characters included) supports .kind_of? and stuff
      (Because Java coders like to think their language is the ultimate in OO
      design)

Well, I don’t think going into a Java only house and saying Ruby beats
Java in so and so many places is going to help them change their minds.
There’s noone more stubborn than a coder defending his language -
believe me, I know. Let them realise it by themselves
The key is to show the language as it is, without comparisons:
nifty things like mixins, runtime changing of code, overwriting/changing
of core classes, the ease of creating iterators, blocks and closures
(now THAT will turn heads).
And then talk about interoperability: interoperability between
languages, extensions, the ability to talk to Windows AND *nix, show
some easy code to detect platforms (Hal’s book has 6 lines for that).
The last part (after showing that the languages can live together :wink: )
is showing how easy a transition from Java to Ruby can be. I believe
that little CrossCase utility can be shown off as a good example of a
transition in “coding mentality”. Show them they don’t have to change
the way they like to code, they only have to make their lives easier.
V.-

···

On Mon July 28 2003 1:06 pm, Armin Roehrl wrote:


http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.

As a full-time Just-A-Programmer using Java (at work), and a part-time
Just-A-Programmer using Ruby (at home) the things that I like about
Ruby that Java lacks:
+ Reflection in Ruby blows away reflection in Java.
+ Blocks
+ Interoperability via JRuby if you need it
+ Multiple return values
+ No compile step
+ Shorter, prettier code
+ Runtime inheritance, singletons, etc
+ First-class

Things I really miss from Java:
+ No IntelliJ IDEA (or Eclipse, which would be enough, but really, in
the end, no IDEA)
+ Ruby standard library documentation navigation isn’t as good as
Java’s
+ No general purpose O-R tool (Vapor (written by a Java guy I bet) for
Postgres, but I don’t always use Postgres)

-Brian

···

On Monday, July 28, 2003, at 01:55 PM, Ben Giddings wrote:

On Mon July 28 2003 1:06 pm, Armin Roehrl wrote:

I am only fishing for ideas. What would you focus on? We have 60
minutes of
talking time.

I guess we /must/ mention interoperability with Java.

  • The ways in which Ruby beats Java in OO design

    • Subclassing of built-in types
    • Everything (numbers and characters included) supports .kind_of?
      and stuff
      (Because Java coders like to think their language is the ultimate in OO
      design)
  • The way in which Ruby beats Java when it comes to super simple
    programs
    (Because in Java the simplest program still requires a class, main
    function,
    etc)

  • Mention that Ruby is open-sourced unlike Java

  • Show off the Ruby interpreter (something Java lacks)

  • Introduce things like blocks, bindings, continuations, etc.

Ben Giddings wrote:

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

I guess we /must/ mention interoperability with Java.

  • The ways in which Ruby beats Java in OO design
    • Subclassing of built-in types
    • Everything (numbers and characters included) supports .kind_of? and stuff
      (Because Java coders like to think their language is the ultimate in OO
      design)

In addition to the things other folks have mentioned:

  • mixins (vs interfaces)
  • simpler attribute accessor system (no setVar()/getVar() everywhere).
  • better startup time
  • Java programs are slow (note that I didn’t say that Java was slow)
  • considerably less cpu/ram usage

If you’re talking to PHB’s at all, I would emphasize the final point
most of all because things like Java + Weblogic can suck up insane
amounts of RAM and CPU cycles. This means that, from a hardware
perspective, Java will literally cost you more in terms of hardware
requirements. It can be the difference between needing a $5,000 server
vs a $50,000 server.

I should know. I monitor processes on a 4-cpu E450 with 4gb of RAM, and
about 90% of it is being used by Java+Weblogic. While I may be picking
a bad example with Weblogic, the point is that if you use Java, you’re
probably going to start using 3rd party Java apps, and those are
probably going to be much more piggish.

Just my .02

Regards,

Dan

···

On Mon July 28 2003 1:06 pm, Armin Roehrl wrote:

Ruby certainly is handy to compliment some of the more unwieldy Java
tools - like Ant. I’m using Ruby to drive Ant to run hourly builds:

https://ultraforge.ultralog.net/

and it works spiffy.

Yours,

Tom

···

On Mon, 2003-07-28 at 15:23, Pete McBreen wrote:

I do not see why. Ruby is unlikely to replace Java, so position it as a
complimentary tool that does other useful stuff.

Hi all,

sorry to reiterate an old topic:

Stefan and I have the lucky chance to give a talk about Ruby to the IT-
development stuff of a company of Java-only coders.

I am only fishing for ideas. What would you focus on? We have 60 minutes of
talking time.

For me it’s:

Ooh! Almost forgot - portabililty.
I’d wear asbestos underpants for that, though…

···


Mother is the invention of necessity.
Rasputin :: Jack of All Trades - Master of Nuns

How can you have interoperability wth vapourware??

···

On Wed, Jul 30, 2003 at 11:23:40AM +0900, Maik Schmidt wrote:

I guess we /must/ mention interoperability with Java.
Hmm … the [pj]ython guys are lucky. Ruby still lacks a clean bridge
to the Java world. We need interoperability with Java, .NET and
especially (hello, matz ;-)) with parrot as soon as possible IMHO.

A big thx for all the ideas we got so far from the group.
I will translate my German slides into English, once
done to give sth. back to the group.

Can you reveal more of what the company is doing ?
It’s a big German car company where the IT-department
has to worry about all kind of things, but the team we have contact
with are into logistics.

Thanks,
-A
btw: video-uploading for euruko03 is still running.
about 3.2GB done … one more GB to go – on a slow
16kb/s upstream connection.

Hmm, while I haven’t tried it… are you telling me that Ruby can do
everything that an EJB Container can do in less memory, with fewer cpu
cycles? I have a really hard time believing that. Less code, less
time to implement, less cost to maintain (maybe) I have no trouble
believing, but faster and lower footprint I won’t believe until I see
it.

While I think EJB’s are bloated monstrosities, they do provide a lot of
services easily for the developer. Be careful of comparing types of
applications typically done in a language (and those applications’
system requirements) when you want to compare the system requirements
of the languages themselves.

-Brian

···

On Monday, July 28, 2003, at 02:44 PM, Daniel Berger wrote:

I should know. I monitor processes on a 4-cpu E450 with 4gb of RAM,
and
about 90% of it is being used by Java+Weblogic. While I may be picking
a bad example with Weblogic, the point is that if you use Java, you’re
probably going to start using 3rd party Java apps, and those are
probably going to be much more piggish.

As a full-time Just-A-Programmer using Java (at work), and a part-time
Just-A-Programmer using Ruby (at home) the things that I like about
Ruby that Java lacks:
+ Reflection in Ruby blows away reflection in Java.
+ Blocks
+ Interoperability via JRuby if you need it
+ Multiple return values
+ No compile step
+ Shorter, prettier code
+ Runtime inheritance, singletons, etc
+ First-class
+ Anonymous arrays
+ Open classes

Things I really miss from Java:
+ No IntelliJ IDEA (or Eclipse, which would be enough, but really, in
the end, no IDEA)
+ Ruby standard library documentation navigation isn’t as good as
Java’s
+ No general purpose O-R tool (Vapor (written by a Java guy I bet) for
Postgres, but I don’t always use Postgres)
+ The Stream library

martin

···

Brian McCallister mccallister@forthillcompany.com wrote: