re: Lay Out Your Code Like You'd Lay Out Your House VIEW POST

FULL DISCUSSION
 

Fantastic! However, this should be paired with a well-tempered inheritance structure, so you're not repeating yourself unnecessarily. You may have seventeen types of lamp in your house, but they all implement the same common wiring and structure.

There are also some things that should be shared among rooms, such as electricity, plumbing, and so forth. No point recreating the entire electrical system for each individual room...that would just make it hard to maintain the system! Implement the common system instead.

 

prefer composition over inheritance - extracting non-legit abstractions is coupling your modules without bringing much benefit.

code of conduct - report abuse