Showing posts with label comment ruby. Show all posts
Showing posts with label comment ruby. Show all posts

Saturday, 5 January 2008

Ruby Has No "for" Loop - Woo Hoo!

I held onto my hat when I heard this one. I use the 'for' loop in Java a lot. Probably more than I ought. 'How will this work' I thought? No 'for' loop? Nonsense ...


When I saw it I liked it. Its often said (by me too earlier) that one of the reasons Ruby is so great is that it reads. Well, here's another example of just that. I like.

Sunday, 29 April 2007

Ruby Convention - Return Value Comments on Statements

It is a Ruby convention to provide comments on the return value of a statement. E.g.:

With code colouring this is quite clear but can otherwise be confusing to a learner already confused with the unfamiliar syntax (like me)