notes from weekend with Uncle Bob, day 2

from yesterday: a comment is a failure to express something in code

keeping comments formatted bright red:
if someone writes a comment, i want it to yell at me..
and if i wonder why it is yelling at me about that, i’m going to delete it.

law of trainwrecks (Demeter – principle of least knowledge)

writing software is hard. TDD is hard.
it’s not easy, but it’s worth it

the way you behave under pressure is your belief

Liskov, LSP – can you subsitute a subtype w/out program knowing/ detecting?
if you have to ask object about type, b/c what you want to do depends on type or subtype, LSP is broken

representations don’t necessarily have the relations of what they represent (rectangle, square ex.)

early smell of breaking LSP – inherit or implement with empty or exception only methods

do you need an ugly hack? (ref above) – put it in an adapter w/ deps only outward

oo protects us from new types, but exposes us to new methods
fp protects us from new methods, but exposes us to new types

dependency inversion, at key points/ where you want to uncouple:
“don’t ever call anything concrete by name” 
(use interfaces, abstracts, factories)  

direction of dependencies, ood, loosen coupling:
go in one direction, from concrete towards abstract

more inheritance makes the code more rigid

moore’s law is failing, multicore crisis
sw devs got a free lunch for 40 years, hw devs did all the work – no longer…

architecture of a thing should tell you what the thing does
use cases at the top level
frameworks are tools, infrastructure 

the only effective architect is an architect who codes

Leave a Reply

Your email address will not be published. Required fields are marked *

Connect with Facebook

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>