From: David Masover Date: 2008-06-15T03:56:05+09:00 Subject: Re: A crosspost from the Perl Community On Friday 13 June 2008 06:16:00 Jenda Krynicky wrote: > I want to know what is a > variable and what is not and be able to tell the difference at the very > first glance. Difference of philosophy -- with the simple setters and getters, the idea is to start using it as a variable, but it might not always be. > And not have to think about what methods, functions, > classes, ... exist or might exist in the future when naming my > variables. So you still have to think about what methods (or functions) exist when naming your methods (or functions). No one's stopping you from naming variables like var_foo -- or using mostly instance variables, like @foo (which does have a sigil). > And for the semicolons making every line look ugly ... every sentence in > english ends with a dot, except for those that end with a question or > exclamation mark. Does that make the sentences ugly? I don't think so, but I do think it would make syntax ugly, if syntax were written the way prose were: while line = gets; fields = line.split("\t"); puts fields[3]; end As someone else pointed out, in mediums where sentences aren't always written as part of paragraphs, the period is often dropped -- poetry, for example, or instant messaging. > OOP is not a holly grail, Strawman -- I didn't say that. > the fact that something is made into a class > with getters and setters doesn't make it any better in itself. A class > that only has the default getters and setters is a pointless class. No > matter how easy was it to create it. Actually, there is a point -- such a class is abstract. Contrived example: class Person attr_accessor :name, :income, :disposition end class Employee < Person def income if disposition == :rebellious 0 else @income end end end Simple translation: A class can have its attributes overridden -- or you can outright pass in an object that isn't even inherited, but provides the needed methods. A hash, say, makes this much clumsier, though it can still be done. > I don't think people get drawn to Ruby because of pretty syntax. I think > it's all marketing. Ruby on Rails is (or is it still?) hip. The new cool > kid on the block. You know, I saw an interview question to DHH, asking him why he chose Ruby. It was all about which language would allow him to write "the most beautiful code." Or, in other words, it was all about pretty syntax.