Why do we feel so uncomfortable with the idea of small functions that have names? What is it about that that frightens us? I'll tell you what it is. It's the fact that long functions are familiar to us in a very deep way. Take a long function and turn it on its side, and … Continue reading Landscapes of code
Names are everywhere in software (variables, functions, arguments, classes, source files etc...). Because we name so much, we’d better name well. So choose your names thoughtfully 😉 Here come rules for creating good names (introduced by @UncleBobMartin). Communicate your intent The name of a variable, function, class or any other piece of code, should answer … Continue reading We name so much, we’d better name well
There are only two hard problems in Computer Science: cache invalidation and naming things. - Phil Karlton We name and name and name. We name variables, functions, arguments, classes, source files, and the directories. Proper naming makes the code easier to read. Intention-revealing names The right name tells you why the variable, function or class … Continue reading What is the purpose of this code?
You can probably come up with a bunch of answers: the computer, the client, the cloud, the company... But first and foremost you write code for other developers. And for your future self. I mean, the computer will understand anything you write (as long as it compiles). And it'll behave in the exact way you … Continue reading Who do you write the code for?
Imagine yourself sitting in front of a compiler, tasked with fixing a small bug. But you know that as soon as you say "I'm finished," another developer - or worse, your boss - will be examining your work. How do you feel? Anxious or encouraged? As software engineers, we take pride in our work (as well … Continue reading What should you know about a human side of code review?
We, software engineers, tend to be protective of our work. We get anxious about showing our code. Unfortunately, the wall we build around "our" code is a perfect formula for a disaster. Luckily, doing the things that scare us more often makes them less scary.