DEV Community

Cover image for What are the building blocks of the software?
stereobooster
stereobooster

Posted on

What are the building blocks of the software?

In geometry they have axioms. You take those axioms and you can build all theorems based on it. See Euclid's Elements.

In chemistry they have atoms. All materials consist of atoms. So you need to study atoms and how atoms interact and you can understand chemistry (I'm no a chemistry major, but I guess this is a big part of chemistry). See the Periodic table of elements.

In architecture, they have units from which they construct buildings, like windows, walls, stairs, etc. See Pattern Language by Christopher Alexander et al.

My question is: What are the building blocks of software development?

Is it algorithms and data structures? I don't think so, because we don't have an exhaustive list of them, those are more like premade receipts. More like theorems in geometry, not axioms.

Is it design patterns? Is it objects? I don't think so, because those are paradigm specific.

Is it monads? Maybe. I'm not sure about that. Can we describe assembly with it (my guess we can, because it is a very abstract field, but the question will it be comfortable to use for that case)? Is it paradigm specific or more universal?

Is it even possible to have one set of building blocks? Or we need different sets for low-level code (assembly) and high-level code (for example, functional languages). Maybe we can define different levels of abstractions and find building blocks for each level?

Maybe what think of as different abstractions are the same thing?

Source of the image: reddit.

What every programmer should know to understand the programming independently of language and paradigm? What are the most basic building blocks in software development?

Photo by Rick Mason on Unsplash

Top comments (5)

Collapse
 
jasman7799 profile image
Jarod Smith

I would say that the fundamental units for all software are the lambda calculus and turing machine. Effectively the abstract idea that something changes the state of another thing. This idea is represented differently in both the turing machine and lambda calculus, but are essentially the same thing, and both can be used to express the other which I think is telling.

Collapse
 
stereobooster profile image
stereobooster

You mean Turing machine itself is fundamental unit, like all programs are built from small Turing machines? Or minimal set of parts from which you can construct Turing machine?

something changes the state of another thing

Sounds like a concept of state machine

both the turing machine and lambda calculus

Well yes, but lambda calculus is pure so you can't have any side effects, like getting date or generate random number or read user input. To do IO with lambda calculus you need to use monads ¯\_(ツ)_/¯

Collapse
 
jasman7799 profile image
Jarod Smith

Yea, the turing machine is essentially the fundamental unit of programming. As that is where the term turing complete comes from I believe which implies that any general logic can be expressed with something turing complete.

Collapse
 
stereobooster profile image
stereobooster

roots in boolean algebra

So you saying logic gates are atoms? (And we know that we can construct all of them from NAND)

are simple ideas.

Right, but is there a finite set of simplest ideas from which we can construct everything? Like axioms or periodic table of ideas?

Collapse
 
akosyakov profile image
Anton Kosyakov • Edited

Is it algorithms and data structures? I don't think so, because we don't have an exhaustive list of them, those are more like premade receipts. More like theorems in geometry, not axioms.

They are not, but aren't they constructed from basic building blocks, like sequence, selection and repetition? There was a theorem somewhere that any other program can be derived from them.

What every programmer should know to understand the programming independently of language and paradigm? What are the most basic building blocks in software development?

From time to time I think that i need only 2 kind of abstractions: functions and state machines.

For example I can map a state machine to a class or module, i.e. internal properties or variables are the state and methods/functions are transitions. State machine does not change, my choice of language constructions will depend on qualities whether i for example want to allow overriding classes and customizing them, support DI, or opposite avoid exposing some internal functions via function scoping in JS.

And when i don't have a state it boils down to functional design. I don't mean here functional or imperative programming style. But a mapping of getting an output from inputs applying basic building blocks mentioned above. I can implement it then in imperative or functional style depending on quality reasons, like runtime performance of the underlying platform.

P.S.
There was a great book long time ago from Harlan Mills: amazon.com/s?k=9780205079964&i=str... It was teaching a student principles of programming via designing a programming language (pascal, in later editions ada) to solve practical issues. But the point was that a student was not given with an idea that here is a language and learn to think into it. But that we as programmers should learn to design and construct well-structured abstractions, i.e state machines, languages, algorithms, data structure and so on. Maybe someone has to redo it for popular languages :) Cannot believe that it is not possible to buy this book anymore and used cost over 2000 USD!