flâneur — a map of the web's best reading

What is good code? (part 2)

loup-vaillant.fr · 4,165 words · saved by 1 readers

In part 1, I defined good code in the obvious way: first, it has to meet our needs (that is, satisfy the requirements, be they explicit or unspoken, domain-specific or computer-specific); and it must be cheap. Cheap to write in the first place, cheap to maintain… Simply put, good code is cheap code. After a little bit of thinking I concluded that the only way to make cheap code is to keep it short, modular, and not too dependent on huge dependencies or fancy concepts. This part will focus on how language mechanisms relate to good code. Basically, how they help us write shorter, more modular code. I will mostly cover the mainstream ones, and omit those I don’t know well enough —someone else will have to discuss them. Also called subroutines, procedures, methods… Functions are the abstraction mechanism for applicative languages (that is, almost all languages in existence). At its core, a function is a reusable, parametrised piece of code. Obviously, it helps you write much less code. It

July 2015 What is good code? (part 2) In part 1 , I defined good code in the obvious way: first, it has to meet our needs (that is, satisfy the requirements, be they explicit or unspoken, domain-specific or computer-specific); and it must be cheap. Cheap to write in the first place, cheap to maintain… Simply put, good code is cheap code. After a little bit of thinking I concluded that the only way to make cheap code is to keep it short, modular, and not too dependent on huge dependencies or fancy concepts. This part will focus on how language mechanisms relate to good code. Basically, how they

Explore this link on the map →

related reading