Archive for September 27th, 2019

Naming Things

One of the famously ‘hard things’ in programming is naming things – I’ve found following a few conventions in naming help you reason about a program. For example, variables should be named to describe what they are and functions for what they return.

Take this function:

function convertName(name) { const firstInitial = name.slice(0, 1); const otherInitials = name.slice(1).toLowerCase(); return firstInitial.toUpperCase() + otherInitials; }

This function is named for how it being used. What it [...]

Read The Rest Of This Post