Before that, the review spent years answering questions on the Perl Beginner's mailing list, as long as we're keeping track.
Re:Should be titled "Holub on Java Patterns"
on
Holub on Patterns
·
· Score: 1
Are you aware of the "singleton", "observer" and "delegate" libraries in Ruby's Standard Library (included with the language install)? Ruby is a dynamic language.
Re:The examples sound great, but...
on
Holub on Patterns
·
· Score: 1
Sure, "inheritance is dangerous" as anyone who has ever written an object-oriented program from scratch and had to modify it can tell you. Inheritance is also the key to code reuse, and can be very powerful when done correctly- do you really want to re-write a section of logic that's shared by 5 other objects ?
You misread the review. It doesn't say inheritance is dangerous. It says subclassing is dangerous. Subclassing is one form of inheritance, but not the only or even the most useful form.
I think you need to read Holub's book.;)
Ruby Needs Data Encapsulation Too
on
Holub on Patterns
·
· Score: 2, Interesting
Poor guy is stuck in a statically typed Java hell, with distinctions between primitive types and objects, of course he's gonna think getters/setters are evil and he's gonna become obsessed with keeping his data hidden in a box or behind opaque methods! I can just imagine his code filled with thousands of builder objects with 2-3 levels of abstraction.. and it will just be a grotesque simulation of a true dynamic language in the end, with everything completely decoupled.
This is totally off base. You're missing the point. This isn't about typing, it's about Data Encapsulation.
Pop quiz, in Ruby no less. You have a class:
class BankAccount attr_reader:balance def transfer_to(other_account) ... end end
When your balance is off at the end of the day, you know where to look for errors. One of your methods, probably transfer_to(), is causing the problem. Change attr_reader to attr_accessor though, and then where do you check? Answer: The Whole Wide World! Good luck finding it, you'll need it.
Before that, the review spent years answering questions on the Perl Beginner's mailing list, as long as we're keeping track.
Are you aware of the "singleton", "observer" and "delegate" libraries in Ruby's Standard Library (included with the language install)? Ruby is a dynamic language.
Sure, "inheritance is dangerous" as anyone who has ever written an object-oriented program from scratch and had to modify it can tell you. Inheritance is also the key to code reuse, and can be very powerful when done correctly- do you really want to re-write a section of logic that's shared by 5 other objects ?
You misread the review. It doesn't say inheritance is dangerous. It says subclassing is dangerous. Subclassing is one form of inheritance, but not the only or even the most useful form.
I think you need to read Holub's book. ;)
Poor guy is stuck in a statically typed Java hell, with distinctions between primitive types and objects, of course he's gonna think getters/setters are evil and he's gonna become obsessed with keeping his data hidden in a box or behind opaque methods! I can just imagine his code filled with thousands of builder objects with 2-3 levels of abstraction .. and it will just be a grotesque simulation of a true dynamic language in the end, with everything completely decoupled.
This is totally off base. You're missing the point. This isn't about typing, it's about Data Encapsulation.
Pop quiz, in Ruby no less. You have a class:
When your balance is off at the end of the day, you know where to look for errors. One of your methods, probably transfer_to(), is causing the problem. Change attr_reader to attr_accessor though, and then where do you check? Answer: The Whole Wide World! Good luck finding it, you'll need it.
I also suggest Seven Lessons from the ICFP Programming Contest.
The page has been updated.