Everything is a Fractal


In my mind, every problem can be subdivided.  


I call such problems fractals.


Every sub-division of a problem can be further sub-divided.  

Composite and Leaf Nodes


I see a solution-to-a-problem as a tree, branching downards.


A composite is a fractal.


A composite represents something that is sub-divided.


A leaf represents something that doesn't need to be sub-divided further.


Most current PLs[1] do not encourage fractal-thinking.  There is a problem and a lump of code.   There is no tree of sub-divisions.


It is possible to write code in just about any PL by sub-dividing it, but, most PLs do not encourage this style. 


Likewise, note that it is possible to write FP[2] code in assembler, but assembler does not encourage the FP style.


Most PLs attempt to achieve fractal-thinking by using libraries of code, but this hasn't worked out so well.  Libraries are rife with dependencies (see below).

Layers are Fractal Thinking


Fractal thinking leads to layered design.

Programming Code Should Be a Fractal

Compilers know how to inline function calls.


Nothing more than function calls and collections are needed at any composite level.


Low-level operations, like, "+", "cons", arrays, etc., are only needed at the leaf level.

Documentation Should Be a Fractal

Documentation should be arranged in a layered — need to know[3] — manner.


Today, we have UNIX man pages + source code, or, 200-page documents like the gnu-make manual.  These provide the top layers and bottom layers of documentation, but, nothing in between.

YAGNI Means Fractal


YAGNI means "you aren't going to need it".


YAGNI implies deferring work (operations).


YAGNI all the way down.


YAGNI at every layer.


Humans are bad at YAGNI layering.  They need languages / notations that encourage layering.


Dependencies are Anti-Fractal


Layers that depend on one-another are invisibly "at the same level".  


They are not layers.


Fractal-thinking requires lack of dependencies, isolation and superposition.

https://guitarvydas.github.io/2021/01/24/superposition-2.html

https://guitarvydas.github.io/2021/01/22/superposition.html

https://guitarvydas.github.io/2021/01/16/Superposition.html

https://guitarvydas.github.io/2020/12/09/Isolation.html


Scalability


Scalability can be achieved only through the lack of dependencies.



Examples


Bottom Level


If your code uses "+", "cons", arrays, etc., it is at the bottom level (a leaf node).  It is flat and non-structured.


See also

need to know (n2k)  https://guitarvydas.github.io/2021/03/16/Need-To-Know.html


superposition

https://guitarvydas.github.io/2021/01/24/superposition-2.html

https://guitarvydas.github.io/2021/01/22/superposition.html

https://guitarvydas.github.io/2021/01/16/Superposition.html


isolation

https://guitarvydas.github.io/2020/12/09/Isolation.html


S/SL

https://archive.org/details/technicalreportc118univ

https://research.cs.queensu.ca/home/cordy/pub/downloads/ssl


Peter Lee

https://www.amazon.ca/Realistic-Compiler-Generation-Peter-Lee/dp/0262121417


see also

https://guitarvydas.github.io/2021/01/14/References.html



[1] E.g. Python, JavaScript, C, etc.

[2] Feel free to substitute your favourite paradigm here, instead of FP.  OO, Structured Programming, etc.

[3] https://guitarvydas.github.io/2021/03/16/Need-To-Know.html

[4] Data structures should be built only at runtime.  Computing power is "cheap".

[5] Data structures should only appear at the leaf level, everything else should only refer to data.

[6] DI means Design Intent