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 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
related reading
- What is good code?loup-vaillant.fr
- Everything I know about good system designseangoedecke.com
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- How to write the perfect functionyoutube.com
- how I think when I think about programming - alice mazalicemaz.com
- An introduction to functional programmingcodewords.recurse.com
- How to write complex softwaregrantslatton.com
- Good code is like a love letter to the next developer who will maintain it.addyo.substack.com
- Repeat yourself, do more than one thing, and... — programming is terribleprogrammingisterrible.com
- Function Lengthmartinfowler.com
- A practical introduction to functional programmingmaryrosecook.com
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com