Are there principles, such that, if they were foll...
# thinking-together
j
Are there principles, such that, if they were followed, they would yield software that is guaranteed to be easy to understand and maintain, at least to some minimal degree or level? What if each module was limited to a small number of inter-related conceptual elements, and written in care carefully English (or whatever human language it uses) in such a way that someone could get to understand and grasp it within a few minutes?
m
The one I can think of is the "growing a language" tradition of lisp and forth, were you start with a small foundation and build layers of the domain, each layer can only use language in its level or the one inmediately below
🌱 1
obligatory references:

https://www.youtube.com/watch?v=_ahvzDzKdB0â–ľ

👍 2
each level is kind of a DSL at that level, and can be used to create higher level DSLs
imagine growing an SVG DSL from a geometry DSL from a canvas DSL
j
Thanks for the video & book references.
It seems like this could kind of work, until you start to need to represent multiple hierarchies. E.g. trying to combine geometry and animation together.
It seems like “mix-ins” or various kinds of functional composition are the current way of trying to solve this.
m
by dsl I don't mean actual languages, just sets of types and operations
p
lppp m
j
the y combinator is not very easy to understand, even though it is very short, has no dependencies or fancy features, and is not written in an intentionally obfuscated manner
that is, its implementation in lambda calculus,
lambda f. (lambda x. f (x x)) (lambda x. f (x x))
e
modularity, small pieces with few dependencies does guarantee better results than the tangled mess that is OOP. Compare two large programs, one written in Modula-2 versus Java, and you will see a huge difference. Clarity as to where a computation is being performed, nicely controlled visibility, tons of compile-time and run-time checks that catch stupid errors quickly also add to its advantages. No operator overloading or ambiguity created by too-clever programmers helps. But it is also true that as a system grows its overall complexity to a maintainer also grows.
j
I really need to understand the y-combinator!
m
this is a good explanation:

https://www.youtube.com/watch?v=FITJMJjASUsâ–ľ

there's also a good explanation in the book "the little schemer"
d
I think the dependency tree is super important, since my last job involved a mesh of several large classes where everything depended on everything else, and it was awful. If A depends on B and B depends on C and C depends on A, the three together can be thought of as a single unit.