Fishing for ideas: Ruby-talk for Java coders

A

Armin Roehrl

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.
 
B

Ben Giddings

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.
 
S

Simon Strandgaard

I guess we /must/ mention interoperability with Java.

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 ?
 
J

Jon Newton

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.
 
D

Daniel Berger

Ben said:
* 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
 
M

Maik Schmidt

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,

<maik/>
 
R

Rasputin

* Armin Roehrl said:
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 :)
 
G

gabriele renzi

il Tue, 29 Jul 2003 02:06:48 +0900, Armin Roehrl <[email protected]> ha
scritto::


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? ;)

- 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
 
R

Robert Klemme

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
 
S

Sascha Dördelmann

Armin Roehrl said:
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.

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
 
B

Brian Candler

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.

How can you have interoperability wth vapourware??
 
A

Armin Roehrl

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top