What is good code?
Well, assuming code is just a means to an end. Sometimes we want to enjoy the code for itself. Most of the time however, the overriding concern is the bottom line. I could almost stop right there, but I feel like I should elaborate. There is the code, and there is the program. Code is read by a human. Programs are interpreted by computers (or virtual machines). Programs have many requirements, most of which are domain specific. Some requirements however are universal: Correctness. The program must not have too many bugs. It would make it worse than useless. Performance. The program must not be too slow. It would waste the users’ time, make them angry, or even behave incorrectly (in the case of real time software). Frugality. The program must not use too much resources. We have plenty of CPU memory… but they still have limits. Use too much resources and your program will drain the battery of your phone, waste your bandwidth, or plain stop working. We don’t always think of these requirem
June 2015 What is good code? Good code is cheap code that meets our needs. The cheaper the better. Well, assuming code is just a means to an end. Sometimes we want to enjoy the code for itself. Most of the time however, the overriding concern is the bottom line . I could almost stop right there, but I feel like I should elaborate. Good (enough) programs There is the code, and there is the program. Code is read by a human. Programs are interpreted by computers (or virtual machines). Programs have many requirements, most of which are domain specific. Some requirements however are universal: Corr
related reading
- Cognitive load is what mattersminds.md
- Reflections on 10,000 Hours of Programming | Matt Rickardmatt-rickard.com
- Essays on programming I think about a lot | benkuhn.netbenkuhn.net
- Code is cheap. Show me the talk. - nadh.innadh.in
- Write code that is easy to delete, not easy to... — programming is terribleprogrammingisterrible.com
- What is good code? (part 2)loup-vaillant.fr
- In defense of blub studies | benkuhn.netbenkuhn.net
- The Joel Test: 12 Steps to Better Code – Joel on Softwarejoelonsoftware.com
- Code was our medium for thoughtwattenberger.com
- how I think when I think about programming - alice mazalicemaz.com
- The Most Efficient Way to Read Code Written by Someone Else | Towards Data Sciencetowardsdatascience.com
- How to become a dramatically better programmernews.ycombinator.com