Writing Code for Humans course notes part 2 - Naming

 Naming matters


“Is the class doing too much?

  1. It should be a noun
  2. It should be specific
  3. It should have a single responsibility
  4. Does having an instance of that class name make sense?


"What does this logic attempt to accomplish?”

Just have them own a self explanatory description

 Rubber Ducking

That eureka moment by talking to yourself.

Rhetorical questions out loud provoke the subconscious.


Now read this

Test Driven Development in Ruby tuts+ course - Stubs and Mocks notes

Stubbing - A technique used in TDD/BDD allowing you to simulate using third party dependencies for your own code. Example, retrieving data from a database, you pass a “splat” = dummy data to a stub. We have no control over what our data... Continue →