Pluralsight - Clean Code: Writing Code for Humans course notes part 1  


Code Complete 2
Clean Code
The Pragmatic Programmer


  1. Comparisons vs Snippets
  2. Verbalize Code. Literal reading code

Three Principles for Clean Code

1) Right tool for the job: Less logic code required

Learn multiple paradigms for each unique problem.
Don’t be proud of hackery.
Understand the boundaries for the purpose of each language and framework.

Difference between styling, semantic markup ,logic and data storage.
By staying native, code becomes cached and loaded once.
The syntax colour highlighting within an IDE.
Project structure modularisation with files making code reusable as in a framework.
Build tools return no compilation, minifaction and catification errors.

2) High signal to noise ratio : Understanding the intent straight away.

TED Rule.
Terse - Non-wordy
Expressive - Intent
Do one thing
Don’t repeat yourself.

Many of the same principles as Relational DB Normalization.
Copying and pasting code gives a shape pattern within the code, this creates maintenance problems and can easily be refactored to reduce the amount of lines required implementing the logic.

3) Self-documenting: No in-line comments

Clear and expressive that it’s so obvious.
Navigating the intent of the programmer
Layers of abstraction: The solution can be modified and made better from a numerous number of points within the code
The reading experience is formatted to be easy on the brain
The code notation is literal for reading
We are writers


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 →