Java Keywords => Ruby Keywords

Submitted by wllm on June 14, 2007 - 7:42pm.

Nowadays I'm programming almost exclusively in Ruby. It's generally been a spectacular improvement over Java server-side coding, but sometimes I find myself unable too remember keyword names in Ruby. So I put this small list together for my own reference.

continue => next
throw => raise
catch => rescue
this => self
switch => case
case => when
default => else

Keep in mind, this is extremely handwavy. Some of these keywords aren't keywords (in that they aren't reserved words in the language) at all in Ruby, such as "raise". Other Ruby facilities, such as the switch analog, are more powerful that what is offered in Java. This is simply a list to track down a forgotten Ruby expression if you happen to know Java well. Please let me know if you have any additions.

Technorati Tags: