×
The Ruby and Rails community linklog
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!
Comments
The correct link is http://olympiad.posterous.com/ruby-idioms-part-1-0
Good article, but it’s a Ruby idiom to write constants in UPPERCASE.
@Anonymous Coward No, the ruby idiom is to write constants in CamelCase. Or do you write ARRAY, HASH, OBJECT etc.? (or do you think those three weren’t constants?)
I would say it is idiomatic to write (constants representing) classes and modules in CamelCase and constant values in UPPERCASE (e.g. PI).
Here’s a favorite of mine:
a = “hello” [*a].each {|w| puts w }
a = [“hello”, “, world”] [*a].each {|w| puts w }
hey, the link’s down…pls
Post a comment