Software Engineering Tips

General rules

Codebase

One of my most productive days was throwing away 1,000 lines of code.
–Ken Thompson (apparently)

Comments

Testing

Setup / hardware

Strive for loosely coupled architecture

How to know if our architecture is loosely coupled. One of the simplest ways is ensuring that it’s easy to replace or delete parts of your application. If it’s hard to remove parts of your application, your application is tightly coupled. Source

Benchmarking

Profilers

Plaintext / markdown

UX, web

Performance

Accessibility

Security

Linux

Scripting, Bash, shell

Text processing

Programming languages

Python

Text editors, IDEs

Vim

Keyboard

NLP

Hacks

System Design, DevOps

Various and general

Pary’s notes on the art of programming

Pavel Rychlý is a former colleague (and kinda boss) of mine. I liked his approach to programming which he was teaching to us. Here I enclose some of his wisdom (taken from his slides with permission).

What is a good program/system

Features of a good program

Features of a good program how it is taught at Computer Science schools (but we have different priorities)

MIT approach (The Right Thing, !! we do NOT want this !!)

Correctness the design must be correct in all observable aspects. Incorrectness is simply not allowed. Consistency the design must be consistent. A design is allowed to be slightly less simple and less complete to avoid inconsistency. Consistency is as important as correctness. Completeness the design must cover as many important situations as is practical. All reasonably expected cases must be covered. Simplicity is not allowed to overly reduce completeness. Simplicity the design must be simple, both in implementation and interface. It is more important for the interface to be simple than the implementation.

“The Right Thing” programmers write bad programs

emphasis on correctness and completeness complicates everything programs are complicated and full of errors complicated means hard to maintain don’t follow that way

New Jersey approach (Unix) (this is our way)

Simplicity the design must be simple, both in implementation and interface. It is more important for the implementation to be simple than the interface. Simplicity is the most important consideration in a design. Correctness the design must be correct in all observable aspects. It is slightly better to be simple than correct. Consistency the design must not be overly inconsistent. Consistency can be sacrificed for simplicity in some cases, but it is better to drop those parts of the design that deal with less common circumstances than to introduce either implementational complexity or inconsistency. Completeness the design must cover as many important situations as is practical. All reasonably expected cases should be covered. Completeness can be sacrificed in favor of any other quality. In fact, completeness must be sacrificed whenever implementation simplicity is jeopardized. Consistency can be sacrificed to achieve completeness if simplicity is retained; especially worthless is consistency of interface.

KISS

Simplicity should be a key goal in design and unnecessary complexity should be avoided

YAGNI

You aren’t gonna need it

Always implement things when you actually need them, never when you just foresee that you need them.

How to achieve Simplicity

Simplicity

Simplicity means

Simplicity is not easy

E = mc² is easy to understand but it was hard to discover.

no fast hacks

sometimes you have to try several ways to find the simple one

Other resources

published: 2021-03-08
modified: 2023-09-06