38 ms·
OO Design Principles Compilation
- gooberdlx 16y agoThere's only one rule to OOP: All instance variables should be private.
- hello_moto 16y agoThis list is very useful. It's 2011 now and you have no idea how many people don't know more than half of the list.
- Nate75Sanders 16y agoand also how many programmers are extremely effective and know perhaps none of the list.
- hello_moto 16y agoThe number of programmers who practiced Object Oriented mainstream languages and don't know at least a single item in list and are extremely effective is probably close to the number of unicorns that exist in this world :). People don't just suddenly know how to write good programs. They read materials, they write code and continue to learn from other people. Sorry, I don't buy the myth and folklore. I used to about 3-4 years ago before I realized that many stories were hyped up.
- extension 16y agoI think the best programmers know all this stuff instinctively.
- vintharas 16y agofollowing the same topic... http://www.barbarianmeetscoding.com/blog/2011/2/23/best-practices-principles-of-object-oriented-design-classes http://www.barbarianmeetscoding.com/blog/2011/2/23/best-prac...
- quannum 16y agoLooks like the server has been hacker news'd.
- Silhouette 16y agoI prefer to think of these as rules of thumb rather than principles. I agree with the spirit of pretty much all of them, but to me, "principle" sounds like one of those rules you're never supposed to break. There are often trade-offs to following these sorts of rules, and sometimes the cost is too high or the process too idealised for real world projects.
- techiferous 16y agoNotice the number of shoulds. A list of what you should do is like training wheels: useful for beginners but not as much for the advanced. Instead of thinking in shoulds I like to think in terms of causes and effects. If you don't follow the law of demeter then these will be the effects. Then the programmer realizes they have a choice: even though the law of demeter usually brings about desirable consequences, maybe in a particular situation the effects of not following the law of demeter bring about the better set of consequences. Thinking in terms of causes and effects also loosens potential dogma.
- extension 16y agoSomeone please add this to the top of the list. There is little value in following programming rules that you don't understand.
- fleitz 16y agoAgreed. Most of software 'methodology' is really software ideology. It's just cargo cult programming. For me the key consideration in building software is whether it produces more money than it consumes.