We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
···
--
-- Jim Weirich jim@weirichhouse.orghttp://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
1- Ruby does not have type casting.
2- Try to not think about interfaces, but enjoy fully the dynamic typing.
3- No overload of methods.
4- Enjoy closures/blocks.
5- Don't worry about performance until the program/library has been made.
6- Web-development is possible with other languages besides Java.
Enjoy FastCGI and mod_ruby. Give Rails a shot.
7- Ruby has O/R mappers, so find your Ruby "hibernate", but drop any
preconceptions.
8- Ruby has MVC and OO programming and libraries, but drop any preconceptions.
9- Ruby is a language to be used everywhere. You use it even in
templates. No need for "Velocity/JSP."
10- Ruby is not a Silver Bullet, unlike Java, right?
Cheers,
Joao
···
On Fri, 28 Jan 2005 02:55:46 +0900, Jim Weirich <jim@weirichhouse.org> wrote:
Seriously though... It's been a while since I've done any Java coding,
but, the first points that came to my mind are:
-In Ruby data is strongly typed, but variables are *not* (no messy
typecasting, yay!)
-No method overloading (probably as a result of the above, but that is
just speculation)
-*BUT* you can have variable number of parameters, and multiple return values
of course, the list of differences goes on and on, but those were the
first 3 that came to my mind.
···
On Fri, 28 Jan 2005 02:55:46 +0900, Jim Weirich <jim@weirichhouse.org> wrote:
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
1. Once you start coding Ruby, going back to Java is painful.
Mike
···
On Jan 27, 2005, at 10:55 AM, Jim Weirich wrote:
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
I would suggest that once you come up with the top ten list, it would
be really nice if you did post it to the mailing list. I'd like to
forward it to some friends.
Kind Regards,
Ed
···
On Fri, 28 Jan 2005 02:55:46 +0900, Jim Weirich <jim@weirichhouse.org> wrote:
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
--
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
One of my favorite features in Ruby is the fact that the object definition never closes. You can always add new methods, change methods and delete existing methods on an object at runtime even if that object is implement in C or is one of the core objects of the system.
The Ruby Facets library (http://calibre.rubyforge.org/facets/doc/index.html\) is a great example of doing this and anybody that has done even a minor project usually has augmented one of the core objects a little to make it fit in their application domain better. And since you are simply modifying a existing class and not creating a new (or subclassing a existing class) all your literals work still. So when you do:
(1) No explicit types. Probably the most disconcerting thing for a Javahead.
(2) Because of (1), you cannot rely on the compiler to catch trivial mistakes.
(3) Think in terms of methods (behaviors) instead of classes.
(4) KISS.
(5) Discipline. Because of its inherent flexibility, Ruby require more self-discipline.
Cheers
···
On Jan 27, 2005, at 18:55, Jim Weirich wrote:
What things should a Java programmer be aware of when starting out in Ruby?
These are the concepts that got me interested, by leveraging my
Java/C++ heritage, my mild Perl experience, my Python experiment, and
the Smalltalk mystique that drifts back and forth across the computing
landscape...
1. you can fit in your mind and write code without looking at the docs
every six minutes.
2. less syntax and less typing
3. Fixed what's wrong with Perl
4. Fixes what's wrong with Python
5. It's super productive (like Perl, Python and Smalltalk)- maybe 5-10x Java.
This excited me, because I always wanted to learn Smalltalk...
= 6. Is a lot like Smalltalk, but doesn't look as funny
JavaScript gets some unfair knocks, so maybe best avoided...
+ 7. Is a lot like JavaScript, but more OO and more for ful app development
The following are cool when you know them, and in many ways the heart
of Ruby, but were meaningless to me until I banged my head against
them for a while. I think a lot of what is exciting about Ruby is
better learned then taught, much like Zen meditation. Just think what
marketing these concepts did for Smalltalk and Lisp- Java and C#.
* 8. Blocks and Closures
* 9. Open Classes
* 10. Duck Typing
Regards,
Nick
···
On Fri, 28 Jan 2005 02:55:46 +0900, Jim Weirich <jim@weirichhouse.org> wrote:
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
"Jim Weirich" <jim@weirichhouse.org> schrieb im Newsbeitrag
news:9813.192.223.163.6.1106848530.squirrel@weirichhouse.org...
We will be introducing Ruby to our XP Users group in Cincinnati next
week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the
mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
There are no interfaces - and you don't need them.
There are anonymous functions, called "blocks" or "lambdas". Learn to use
them.
Use IRB.
"finally" is called "ensure". Use blocks for transactional behavior like
File.open() does.
We will be introducing Ruby to our XP Users group in Cincinnati next week.
I thought it would be fun to create a list of "Ten Things Every Java
Programmer Should Know About Ruby" to help the transition. I've got a
number of things in my head, but would love to hear ideas from the mailing
list.
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
You will end up writing less code and it will do more.
Since all access to the inside of an instance is through methods, you can change your mind about whether .foo is a simple property or a complex method call, without affecting the interface to your class. Syntax sugar makes getter/setter methods indistinguishable from direct property access.
···
On Jan 27, 2005, at 10:55 AM, Jim Weirich wrote:
So go ahead and submit your ideas. What things should a Java programmer
be aware of when starting out in Ruby?
I would suggest that once you come up with the top ten list, it would
be really nice if you did post it to the mailing list. I'd like to
forward it to some friends.
I'm going to collect responses in a public Ta-Da list at Feedback on "Ten Things a Java Programmer Should Know About Ruby" (which is already way
over 10 items!). Later (possibly this weekend) I'll sort through the
collected suggestions, edit them down to my top ten and publish the
result.
···
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)