Live data from Hacker News

One of the Best Bits of Programming Advice I ever Got

objology.blogspot.com

1–10 of 94 posts

Re: One of the Best Bits of Programming Advice I ever Got

#2
I was lucky enough to get an equivalent piece of advice from "Object Oriented Programming" by Peter Coad & Jill Nicola ( http://amzn.com/013032616X ) which was the main textbook for an OO course during my CS studies. There are good examples there that illustrate this and many other useful rules (of thumb) of OO modeling.

Re: One of the Best Bits of Programming Advice I ever Got

#3
Google has posted warning signs to look out for in code (1). One of them is very similar:

  Suspicious names: context, environment, principal, container, or manager
(all of the things google mentions, are things I've seen much, much more in Java codebase than anywhere else)

(1) http://googletesting.blogspot.com/2008/11/guide-to-writing-t...

Re: One of the Best Bits of Programming Advice I ever Got

#7
post #3

Google has posted warning signs to look out for in code (1). One of them is very similar: Suspicious names: context, environment, principal, container, or manager (all of the things google mentions, are things I've seen much, much more in Java codebase than anywhere else) (1) http://googletesting.blogspot.com/2008/11/guide-to-writing-t...

http://misko.hevery.com/code-reviewers-guide/flaw-digging-in...

This is the full article mentioned above.

Re: One of the Best Bits of Programming Advice I ever Got

#8
post #5

Even better: don't use objects at all. Use a functional programming language.

Object oriented programming is the sweet spot solution to many problems. For example, if you have a UI with several text fields, it's natural to think of them as objects that have methods like setText(), setEnabled() and such. These methods often have side effects and that's their whole point.

Of course functional programming also has use cases for which it is the sweet spot solution, e.g. writing compilers.

Post reply on HN