Hacker News new | past | comments | ask | show | jobs | submit login

Perhaps that counts as an argument against accessor methods?



It's an argument against using accessors for the sake of using accessors.

It's important when learning any technique (and this goes not just for programming) to understand why that technique makes sense in this situation, which means that you can evaluate later situations on a case-by-case basis and decide whether or not that technique fits.

Too often people believe that a technique is good (Inheritance is good!) without fully appreciating why (Polymorphism). This means they start using it for other situations (code reuse) when it might make sense to do it another way (composition).


Thanks for interpreting my comment as more thoughtful than the blunt stab at OOP I wrote.


Yes! You can never have too many arguments against accessor methods...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: