UP | HOME

Changeability

Changeability

Source code is (and should be) one of the most malleable medium of expression (it is a structured text, and it has much more structure than a novel or a poem).

Unlike a paining, which is difficult or even impossible to change after a certain point (it will be easier and reasonable to start from scratch), changing a structured text in a file is a much easier operation, especially when each function or an expression is loosely coupled or even completely orthogonal to most of others (except in the call-graph, of course).

With this property of our medium of expression, changes must be easy and cheap (we must invest a lot of effort and optimize heavily for changeability) given that, unlike an article, a novel, a poem or a painting, a program is never finished, never completed.

A program has to continuously co-evolve along with our knowledge and understanding of the problem domain, which is also never completed. The journey never ends, as they said.

So, all the best available methodologies, techniques and tools, which facilitate changes and made them easy and painless, must be used.

The mantra is Pure-functional. Well-typed. Immutable and Persistent.

  • embracing changes means embracing data immutability.
  • use small, pure functions (the procedure abstraction)
  • abstract out repeated code into small functions (no duplication)
  • an advanced static type system (much easier refactoring, less errors)
  • use small modules for every ADT (the data abstraction principle)
  • formally specify every single function and interface (write specs)
  • rely heavily on executable specification and testing tools
  • use persistent data structure

Yes, changing means adding new pieces to what already is there. Persistent data is the key to manage changes (and related complexity).

These notions are universal (being rediscovered again and again). Very different, even completely independent groups of researchers have arrived at the same set of fundamental principles (largely due to underlying mathematics and understanding of how the mind works).

Mathematics, however, does not exist in a vacuum of the sterile universe of pure abstract ideas, and is a product of the mind of “external observers”.

The core of mathematics is grounded in “What Is”, and consists of generalized and abstracted out notions, derived from observations of recurrent processes of the Universe and of emerging from apparent “chaos” relations, patterns, symmetries.

The best programmers, by the way, are not pure mathematicians (they mess everything op with incorporating too much of abstract nonsense), but molecular biologists, who have at least some ideas of how Life Itself works and why.

Definitely the best system designers have at least some background in biology.

Author: <schiptsov@gmail.com>

Email: lngnmn2@yahoo.com

Created: 2023-08-08 Tue 18:38

Emacs 29.1.50 (Org mode 9.7-pre)