The Primary Issue: What is a Computer Used For?

There is one issue in software that all other issues follow from:


What is a computer used for?

 

Computing

Calculation

A computer can be used to calculate mathematical results.

In this perspective, a piece of software is a function with one input and one output.

Error conditions are glued onto this perspective as an after-thought.

This was the primary purpose behind the invention of computers.  

Computers were invented to calculate ballistic trajectories of projectiles.

This perspective is inherently synchronous.

I posit that computing, and software development, has outgrown this perspective.

Machine Control

Another perspective for using a computer is to control machinery, such as DAWs (Digital Audio Workstations), injection molding machines, printing machines, etc.

In this perspective, each function can have more than one outcome.

In this perspective, the computer receives inputs from outside sensors and produces control outputs to the outside world.

Input from sensors can come "at any time".

This perspective is inherently asynchronous.

Distributed Computing

Distributed computers come in two flavors

Some computers perform both of the above roles.

Distributed computers receive asynchronous inputs from

Synchronous vs. Asynchronous

Several issues are important when discussing synchronicity:

Synchronous Behaviour

Data Devliery

Code Invocation

Ordering

Asynchronous Behaviour

Data Devliery

Code Invocation

Ordering

Simplicity

Simplicity is the lack of nuance.

Simplicity results when an appropriate programming paradigm is used.


How To Pick A Paradigm?

How does one decide which paradigm to use?

Firstly, one must ask the right questions, then apply the principles of Divide & Conquer.


Example: Synchronous Paradigm

We have seen this paradigm - the synchronous paradigm - evolve into what we call Functional Programming.


Example: Aynshcronous Paradigm

Accidental Complexity

Examples of Synchronous and Asynchronous Paradigms

I discuss concrete examples below.


Example: Cryptography

Cryptography is a mathematical function of one input which produces one output.

Cryptography is a calculator.

The synchronous paradigm is appropriate for cryptography.

Example: DAW

A DAW - digital audio workstation - is a controller.  It takes inputs from the user and from a clock and produces outputs, e.g. MIDI, that control various devices (sound generators, envelope generators, etc.)

The asynchronous paradigm is most suited to programming a DAW.

GUI

P2P - Peer To Peer

Blockchain

Browsers, HTML, Internet

Text Editing & Layout



[1] Multitasking is hard only if one attempts to solve the multitasking problem using the synchronous paradigm.