Eli Schutze
@elibelly
Human
Computer
-Tim Ottinger , Clean Code
Make names descriptive and meaningful in a concise way
// number of puppies per YouTube video
let p;
let numberOfBabyDogsSeenOnYouTubeVideo;
let puppiesPerVideo;
let puppiesPerVid;
let avgPuppiesPerVideo;
"The length of a name should correspond to the size of its scope"
for (let i = 0; i < puppies.length; i++) {
console.log(i)
}
On that note: Avoid lowercase 'L' and uppercase 'o' to avoid confusion with 1's and 0's
int a = l;
if ( O == l )
a = O1;
else
l = 01;
Pro-Tip: Avoid Naming Disinformation!
Avoid having similarly named classes out of laziness.
Puppies, PuppiesInfo, ThePuppies or color/colour
-Tim Ottinger , Clean Code
//CSS selectors
.nav { }
.modal { }
// Function design patterns
puppyFactory() {}
getCapitalAssets() vs showMeTheMoney()
getPuppyVideos()
let puppy = { color: brown, name: Avocado }
const isHouseTrained = true
append() vs add() vs insert()
// For "Puppy Video App"
let PVAPuppyList, PVAVideoURL
Don't be afraid to rename things!
Code functionality changes, so should names
(sometimes associated with The Boy Scout Rule)
Boy Scout Rule: "Always leave the campground cleaner than you found it."
If you want to learn more read
"Clean Code" by Robert C Martin and friends)
http://ricardogeek.com/docs/clean_code.pdf