Programming Approach & Philosophical Thoughts — What Pythagoras, Ibn Sina and other greats of Philosophy could have thought about today’s programming standards.

Syed Murtaza
4 min readSep 7, 2022

--

Programming languages have evolved brilliantly over the years and computer scientists and architects made considerable progress towards betterment of the rudiment structure of these languages. The standards that modern OO languages follow are certainly very much closed to the nature, which is one of the major reasons behind their wide adoption across the globe, but these standards can be improved and made better, pragmatic, and more closed to the nature using Philosophical approach.

Philosophy, being the natural approach of finding solutions to the age-old questions such as existence, cause and effect, relativity and absolutism, life and death, individuality and identity, rationality and irrationality and many others, is favourable to other disciplines in general and helps them achieve their desired goals and Programming, being the algorithmic approach to perform the required tasks, has very much to borrow from Philosophy. But one basic question still wavers here; Programming and Philosophy are two different disciplines. So, how can the former help the prior?

Obviously both disciplines are distinct in their concerns and end-results, but they have many things in common too:

Both have similar goals

Philosophy is the study of general and fundamental questions, such as those about reason, existence, knowledge, values, mind, and language. Such questions are often posed as problems to be studied or resolved. (Wikipedia) and Programming, as we all know, is to produce a set of instructions that accomplishes a specific task or solves a specific problem. Therefore, both solve problems but in different mediums. So, one would correct if says,

if Philosophy is the philosophy of real world, then Programming may be the philosophy of computational world.

Both use the same approaches to achieve their goals

Deductive reasoning is a fine philosophical approach that is based on generalized assumptions to make some specific conclusion, for example, assuming ‘red meat has iron in it.’ leads to the conclusion that ‘beef has iron in it.’ In an equivalent way, a programmer also assumes several things to make some concrete conclusion, for example assuming ‘a person name length cannot exceed 30 digits’ leads to the conclusion that ‘Hubert Blaine Wolfeschlegelsteinhausenbergerdorff Sr.’ is invalid name. (Although, it is real name of a German typographer.)

Such similarities allow the Programming standards getting analyzed with reference to the Philosophical thoughts, which can potentially ensue in more closed-to-nature designed programs.

Nullability should be mandatory

Everything that exists is contingent upon inexistence. Otherwise, referring to it as ‘existing’ is meaningless. For example, when one says, ‘Ali is in the room.’ Then the chance of Ali’s absence from the room is always there and the proponent neglects that chance by stating otherwise.

In reference to programming, when a programmer declares a variable, for example

int x = 2,

the statement itself indicates its nullability (or nonexistence). So, bounding nullability with a sign, for example

int? x = 2

is not a very realistic approach.

Nothing exists unless it needs to exist

Everything that exists, had the ability to exist before its actual existence and would have ability to exist after its nonexistence, otherwise it would lead to the ‘behaviour of a being beyond its ability’, which is not possible. For example, if a person claims that ‘Ahmed saw me yesterday.’ and Ahmed is born blind, then his statement is obviously false as it claims Ahmed behaving beyond his ability. So, if a thing exists then its existence itself is proof of its capability of its existence. This natural behaviour of existence negates the default behaviour of an existing thing.

Exclusively to Programming, a good programming practice would be to declare a variable without any default value of it. For example,

int s;

Deny everything unless proven

Philosophy considers every statement false unless it is supported by some convincing argument and addresses all its rebuttals. Therefore, a good programming practice would be that all Boolean variables are considered false unless it is forcefully assigned with true. For example,

bool isValid;

Console.WriteLine(isValid) //It should print false (as it does in many languages)

There should be a type ‘Essence’ like ‘Object’

Philosophers consider the two questions independent of each other: If a thing exists? And What a thing is? The essence is what we say addressing the second question. Essence formally is the foundation that constitutes the body or matters what it really is, and thus possesses an imperative necessity, other than symptoms, or properties that occur to the body or substance. For example, responding with ‘rational animal,’ if one asks, ‘What a human is?’ points to rationality and animality, the two essences of humanity.

Currently, every OO language inherits an existing (non-null) variable by some class, for example Object or Any but do not inherit non-existing (null) variable by any class. Obviously, null variables cannot be inherited by Object, or Any classes as they possess behaviors of existing objects, thus there should be some class that inherits null variables and defines the behaviour of being capable of existence.

Conclusion

As the title of this article reflects, the main idea behind writing this excerpt is to briefly examine the widely adopted programming standards (mainly OO) in a metaphysical and philosophical way and ideate how this approach can help achieving better standards. I do understand and recognize the fact that these standards have evolved over a period of time, considering the real problems that the programmers had to face a couple of decades ago but, surely, they still have a scope of improvements and taking philosophical approach we may have enormous success as this approach is a direct attempt to crack universal system and there is no complex system in this universe than the universe itself.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Syed Murtaza
Syed Murtaza

Written by Syed Murtaza

Flutter Lover❣️ and part time writer✒️

No responses yet

Write a response