From: Minkoo Seo Date: 2006-05-02T00:48:53+09:00 Subject: Re: More explicit Ruby code Brad wrote: > To me, the first version is easier to read as I know where puts is > coming from (Kernel) and what it is encapsulating. I just wonder what > more experienced Ruby coders think of this? What would they think if > they saw several hundred lines of code written this way? Do most find > this type of explicitness unnecessary? I'm not that experienced Ruby programmer (I've just checked LoC of my programs (research purpose apps) and it turned out to be 5,000), but I think the above explicitness is unnecessary. Why should I have to know that 'puts' is coming from Kernel via Objects every time I write puts? You can just think of puts as keywords or commands. It is an abstraction, isn't it? > I can see how the second version is easier for people new to > programming, but it seems to me once they gain a bit of experience that > they may want to know more about the magic behind it all. So, a more > explicit code style may help them to see exactly how things get done in > Ruby. Studying under the hood is good for becoming seasoned programmer, but anyone can learn from books or articles on the web as long as one tries to learn. Moreover, it is not always needed to learn details to be a good programmer. As an example, do you think every J2EE programmers understand object hierarchies involved in transactions/object pooling? The answer is obviously "No". Nevertheless, people are quite good at writing J2EE apps. The same goes with Ruby. Please keep in mind that what we are trying to solve is not what Ruby is, but domain problems at our hands. That's the reason why 'puts' is better. Sincerely, Minkoo Seo -- Posted via http://www.ruby-forum.com/.