Hidden Wonders

Programming·Society·Technology

The Importance of Perspective


Published:

Lastmod:

Table of Contents

Introduction[#]


The world functions a lot better when there’s diversity of thought. It is difference in perspective that allows diversity of thought to exist. These various perspective are what make life interesting, and there are endless perspectives because everyone has different lives, lives full of different experiences that make individuals view the world in unique ways.

Constantly, however, there is a force pushing against individuality, for humans have the potential to be ugly, oversocialized creatures who will push and shove to be accepted by the wider group. Psychologists (and regular people) refer to this phenomenon as groupthink, spelt weirdly as one word due to its derivation from George Orwell’s idea of wrongthink from the book Nineteen Eighty-Four (you should read it if you haven’t already). Also, that Wikipedia article seems a tad biased, so take everything past the first two paragraphs of it with a grain of salt. This older version seems a bit less opinionated.

Anyway, I believe groupthink to be one of the greatest tragedies of humanity. It’s through the free flow of ideas and the freedom to discuss even the most bizarre, stupid, and revolting of opinions that has and will continue to allow the human race to move forward. This is true of any field, whether it be politics, philosophy, history, or——as I will discuss quite a bit——computer science. There is more knowledge to be gained from the crazy old man shouting on the street corner than the polite, mask-wearing, non-controversial woman subtly putting in the effort to ignore the lunatic.

I’m hoping that, through this article, I can make people aware of how valuable differing perspectives are in our lives and to our societies as well as how important it is to understand the perspectives of others.

A Programming Professor’s Strange Opinion[#]


From a friend, I heard about an especially strange programming professor. There were a lot of weird things about him, but one of the strangest things were his opinions on how to write code. First, he was convinced that the only two languages anyone should be writing are Fortran or C. A strange requirement, but some teachers require code be written in certain languages, so whatever.

His strangest opinion was the idea that a programmer should strive to use as few features of a language as possible. His reasoning was that if you use fewer features, you’ll be less likely to run into compiler bugs. As someone whose only ever used computers in the 21st century, it’s fascinating for me to wonder what kind of software bugs this professor must have run across due to compiler problems in the last 50 years——or, maybe he was just paranoid.

In practice, this means students had to choose between writing using switch statements or if statements. They also had to choose between while loops and for loops, which likely led to students writing funny code like:

int x = 0;
//loop until x is true
for(; !x;) {
	...
}

It’s sounds like a crazy idea, and my friend and I laughed about it probably too much, but is there some merit to the idea of minimizing the usage of language features? Take the following code example:

#include <stdio.h>
int main(void) {
	static int x, y, z;
	if(!x)
		printf("Static variables are 0 by default!\n");
	if(y == 0)
		printf("Static variables are 0 by default!\n");
	if(0 == z)
		printf("Static variables are 0 by default!\n");
	return 0;
}

The fact that this program is pointless put aside, we wrote the same check for if a variable is equal to zero in three different ways! Programmers will not agree on which way of writing the if condition is correct, but good programmers will agree that regardless of what syntax we choose, it should be consistent throughout the program.

Similarly, there are two common ways of making loops that run forever in C:

for(;;) {}
while(1) {} // while(true) with stdbool.h

Many prefer the while(true) method because it’s easier to see what’s happening, but others prefer the for(;;) method because it’s fewer characters (I like for(;;), and so do the suckless devs). The correct answer here is that consistency is key. You’re not minimizing the chance of compiler bugs here, but you are minimizing the amount of syntactic and semantic variation a programmer needs to be familiar with to understand how your code works. This should make debugging easier as well.

This may not have been what the programming professor’s point was in having his students write such strange code, but his perspective is an interesting one. It may not be the correct opinion, but treating his perspective seriously is insightful.

Terry A. Davis[#]


If you check my quotes page, you’ll find some quotes from Terry Davis. He was a very interesting man with some very interesting opinions. If you somehow don’t know him, Terry was the creator of TempleOS. He also wrote the Holy C programming language. He is dead now.

Memes and schizophrenia aside, here is one of the most informative and interesting videos of Terry’s. There are so many valuable points he brings up in this video and other videos, I’ll have to make sub-headings for each of them.

Terry is a guy with opinions not everyone will agree with, but we’d be fools to not to seriously entertain his technical ideas.

Process Scheduling[#]


It’s a common problem in computer science: let’s say we have 10 processes, but can only run 1 process at any given time. In this case, what is the best way of running the processes?

Without teaching a whole operating systems lesson on process scheduling, a commonly agreed upon way of doing process scheduling is to assign processes priority levels (often implemented with data structures like priority queues and/or circular queues), which prevent what is called process starvation——when a process is unable to run on the CPU at all because other processes are running in front of it. It works fairly well.

Terry rejects this method of process scheduling because he believes it’s too complex. In contrast, he uses a method called round robin, which gives all the processes an equal amount of time to run on the system in a loop, constantly switching between them. This is a lot simpler to implement, but runs into problems if there are numerous processes running on the system. Terry acknowledges that this is a problem, but he doesn’t see this as a problem that needs to be addressed. This sums it up pretty well:

Everybody who's a Linux person would move heaven and earth just so that you could play two video games at once. They're full of pride.

— Terry A. Davis

Terry’s OS doesn’t have many processes running at any given time. Terry says, why do you need to run so many processes at once on a consumer machine? Why should a single user user machine need to be able to run two games at once? Terry’s operating system has no virtual memory, which make context switches——cycling from one process running on the CPU to the next——very low resource, minimizing the negative aspects of round robin. It’s a fascinating approach to process scheduling, one that an operating systems professor would probably laugh at.

Consumer OS[#]


This is Terry’s most interesting point for me: in creating Temple OS, Terry wanted to create a Commodore 64, a “user developer” computer. A computer where the user is in control of an incredibly minimal system, one designed for truly personal computing, not for enterprises or servers.

As I mentioned earlier, Terry gets rid of virtual memory, saying “virtual memory? That doesn’t belong on a modern computer.” There are no permissions in Temple OS; this sounds like a security problem until you think a bit: why does a consumer OS——especially one with no Internet access——need the concept of user privileges? Permissions are most effective at minimizing the effects of malware and preventing the average computer user from deleting system32 because of a bad meme. On a “user developer computer,” as Terry puts it, the user is responsible for what happens to his system. Temple OS is “a motorcycle” as Terry puts it.

By getting rid of user privileges, Terry is massively reducing the complexity of the system: the system resources needed to perform a context switch, the time it takes to read, write, or update a file, and the overall complexity of his entire codebase are greatly reduced by abolishing user permissions.

I think Terry has a point here. Modern operating systems do a lot that most users are never going to use. This holds true for iOS, Android, Windows, MacOS, and even Linux. These systems are overly complex and excessively resource intensive for what operating systems once accomplished with a fraction of the resources. Temple OS tries to backtrack to a simpler way of doing things. Terry says (I paraphrase here): “when systems get bigger, they don’t get bad, they get worse.” We tolerate mediocrity in software because increasingly powerful hardware allows us to. Even if the systems get more convoluted in the process, it still remains sufficient to get the job done. Terry didn’t think that an operating system should be merely “sufficient”; I don’t either.

Terry’s ideas are far from perfect, and are in many ways nonsensical. However, I believe they’re worth thinking about, especially in this instance.

Compiler Optimizations[#]


Terry is against compiler optimizations. Around seventeen minutes here, he says: “we can make an optimization in case we have this particular retard in there.”

Terry is of the opinion that programmers should just know how to program. Often when writing bad code, programmers will think “eh, the compiler will just optimize that for me anyway.” Even if it works, this is lazy, and the optimizations would be unnecessary if we just wrote more performant code by default.

This is an interesting line of thinking that has support from less schizophrenic people as well. One set of people are in agreement with Terry in that people should just be better programmers and use performant languages like C (I lean a bit this way too, but don’t think C is perfect). This line of thinking is a bit on the decline as evidenced by the rise of self-professed “safe” languages like Go or Rust, but there are still many people who think languages like C and C++ are best, even if their opinion is increasingly a minority position. Terry is evidently not concerned with memory safety:

Just man up and learn what malloc and free are.

— Terry A. Davis

Another group of people will agree with Terry because they are against overly aggressive compiler optimizations. A few agree directly with Terry’s line of thinking in that overly aggressive compiler optimizations produce worse programmers, but most people that are against compiler optimizations cite that implicit changes made by the compiler can sometimes make errors more difficult to debug.

In C, there are instances where there is “undefined behavior,” which is when the C standard doesn’t specify exactly happens when a certain operation is performed. A good example of this would be the following:

#include <stdio.h>
int main(void) {
	int x[4] = {3, 2, 1, 0};
	int y = x[4];
	printf("y=%d\n", y);
}

The above code is undefined behavior in C since we’re accessing an array out of bounds. However, C will compile this code, and when run I get y=0. When trying the same code, but with the line int y = x[10];, I get a completely random number on each run. Now, each compiler will do something completely different here. Because it’s undefined behavior, a valid C compiler could just return a random number every time an out-of-bounds index is accessed. Some compilers would just return 0 because it would be faster. It could also just segfault, which the code does if you change the line to int y = x[10000];. While in this particular instance the compiler’s optimizations won’t screw you up too much, there are instances where they will.

In this Red Hat blog, GCC optimized out a check for NULL which, in this specific instance involving kernel-level programming, resulted in an error because of the compiler optimization. This is the kind of bug that is incredibly painful for a programmer to detect, so it’s for this reason people advocate against excessive compiler optimizations of this nature.

Again, this wasn’t precisely what Terry meant when he said he was against optimizations for that “particular retard,” but analyzing Terry’s argument was productive, considering his viewpoint was useful. I would argue that, for the intended reason or not, Terry is correct in this case.

Politics[#]


On a bit of a different note, there are a lot of people out there in the world of politics convinced that their viewpoint is objectively correct, and that those who hold alternative views from them are uncivilized, heartless, or inhuman. This is incorrect, as both sides of the political isle are filled with people who want the best for everyone. The reason their opinions on matters differ is not because one side of the argument lacks morality; rather, it is because of their unique life experiences, their perspectives.

Take the question of abortion. There’s a lot of subtlety in the position one can take regarding abortion (my opinion the matter is quite nuanced as well) but there are two primary arguments: people who think abortion is good and should be legal, and people who think abortion is bad and should be illegal.

The first camp asserts that abortion is a personal matter of the pregnant woman, and that the government regulating what a woman does with her body is outrageous.

The second camp asserts that abortion is a matter of life or death for a fetus, and that the government must regulate the matter because abortion is the equivalent of murder.

And so, the second camp is outraged at the first camp, not understanding how they are able to sanction murder. Meanwhile, the first camp——those favoring abortion’s legality——are disgusted at people who want to control what a woman does with her body.

And so, people continue to this day aggressively arguing their points while insulting the adherents of the other side of the argument——and yet, the opposing sides fail to understand their opponent’s perspectives. People who want abortion to be illegal don’t want to limit women’s rights, and people who want abortion to be legal don’t want to commit murder, it’s just that their perspectives on the issue are completely different.

Most people want the best for themselves, their families, and all people. These days, politics is just the endless, selfish screeching of politicians and advocates arguing for the policies they believe in while slandering the opposing side. Maybe if we considered opposing perspectives and understood that both sides of all arguments contain rational people with good intentions, real progress in society could be made.

Life[#]


It is vital to consider the events of our daily lives through different perspectives. David Foster Wallace gave a speech at a college graduation titled “This is Water”, where he shows how this is necessary in order to survive the monotony of daily life. I wanted to quote from it in this section, but then I’d want to find myself just copy+pasting the entire seven-page speech. I’m very tempted to, and looks like I ended up quoting it anyways despite planning not to.

The whole speech is incredible——go read it if you haven’t, it’s not too long——but parts of it are definitely outside the scope of this article, maybe to be addressed in a future article.

Anyways, regarding perspective, Wallace brings up several realistic situations we’ve all found ourselves in before: stuck in a traffic jam, idiots cutting us off while driving, and long grocery lines in crowded grocery stores. He has the following to say about it:

The point is that petty, frustrating crap like this is exactly where the work of choosing comes in. Because the traffic jams and crowded aisles and long checkout lines give me time to think, and if I don't make a conscious decision about how to think and what to pay attention to, I'm going to be pissed and miserable every time

— David Foster Wallace

We are trapped in the perspective of ourselves; our own, selfish perspectives where the world revolves around us. We think that that person is looking at us funny, that the people cutting us off in traffic are being dicks to us, but they probably aren’t even thinking of us. They’re caught in their own perspectives centering around themselves, but we don’t have to be that way. Maybe the guy cutting us off in traffic is driving to the hospital to hear the dying words of a sickly relative, maybe the cashier is going slowly because she’s being beat by her husband every night and hardly has any reason to go on; the point is, we cannot possibly know what’s going through the heads of all the people in life who inconvenience and aggravate us, and if we just sit there and let our emotions run wild, we’ll hate everything in the world and want to kill ourselves.

Wallace argues that this is our default state, and that we must actively strive to live beyond our own perspectives and see the world in a different light in order to survive. This article is likely part of what inspired me to create this website. We need to put in the effort to change our perspectives and view things in a positive, more interesting light, or else we and the world around us will remain a bleak, uninteresting place.

It is unimaginably hard to do this, to stay conscious and alive, day in and day out.

— David Foster Wallace

Value perspective going forward, and thank you for reading.


Home Top


Site Licensing Site last updated: 2024-06-08