Bons Mots

Something, something, dependency injection…

After wasting a significant amount of time hunting around on my laptop to find a way to save a .txt file, a fellow boot comes along and informs me that Sublime can do that…

image

TIL:

1. See above

2. Things to do when coding:

Separate the concerns: separate the input from the primary concern of the method when using the ARGV

Loosely coupled objects: decouple objects and methods so they aren’t tied into a particular data structure

Single responsibility principle: don’t do megamoth, or have the God object—something that is everywhere in your code and holds many responsibilities. This is a bad thing, because it affects everything in your code, making your code hard to change.

Minimize context

Follow the Law of Demeter

3. We should consider compiling a “toolbox,” or list of helpful Ruby methods that may help us in the future.

4. Errors are cool, and helpful… to Jesse.

Jesse, when he gets an error message:

image

Me, when I get an error message:

image

5. It’s helpful to always define a clear entry point for your code (typically your driver code)

  1. devbootcamp reblogged this from bonsmots
  2. bonsmots posted this