Onion Information
How Much Abstraction Is Too Much?
Hidden Wonders - How Much Abstraction Is Too Much? Published: 2022-08-11 - Lastmod: 2024-02-24 - Introduction [#] - An idea is called abstract if the idea is theoretical or far-removed from the physical world. As a result, abstract ideas al...
Onion Details
Page Clicks: 0
First Seen: 03/11/2024
Last Indexed: 10/22/2024
WARNING
This Domain Has Been Reported 1 Time!
Human Trafficking: 1
Onion Content
Hidden Wonders Programming · Society · Technology How Much Abstraction Is Too Much? Published: 2022-08-11 Lastmod: 2024-02-24 Table of Contents Introduction [#] An idea is called abstract if the idea is theoretical or far-removed from the physical world. As a result, abstract ideas also tend to be very difficult to understand and explain. Computers and modern technology especially involves many complex, abstract ideas; as a result, a core technique used in the development of these increasingly advanced technologies is called abstraction--simply stated, it is the concept of removing or details. Abstraction is also common in mathematics, as this simple example illustrates: 5×10 = 50 ` 5+5+5+5+5+5+5+5+5+5 = 50 When a student first learns to multiply in elementary school, they learn that these two expressions are equal, which is a more simplified version of this fact: a×n = a₁ + a₂ + ... + aₙ This is an example of abstraction: rather than write out a bunch of plus signs, mathematicians invented multiplication. All of the extra details (those plus signs) are abstracted into a far shorter term (the multiplication sign and a number denoting how many plus signs there are). Math does this a lot, with slightly more advanced examples being summations and products . Abstraction is so useful in technical fields--particularly in computer science--that the following quote was coined: All problems in computer science can be solved by another level of indirection. This adage is true, but could infinite levels of indirection eventually lead to new, more serious problems than the ones we were trying to solve in the first place? This article seeks to tackle the concept of abstraction in the field of computer science and technology as a whole. Is there such a thing as too much abstraction? What are the problems solved with and issues caused by abstraction? All of these questions and more I seek address and discuss in this article. Abstraction in Consumer Computing [#] When computers were first invented, users would insert punched cards into the computer to run programs . A hundred years after this early model of the computer, programs were run by typing on a command prompt--a well known example is MS-DOS , the predecessor to Windows. Then came GUIs , which allow computer users to accomplish their tasks without ever seeing a command prompt. This made computers easier to use and more accessible, but it came at the steep price of computer users knowing less about how their devices actually worked. Most computer users who grew up in this era still know a lot about computers and are good troubleshooters. I’d consider the tail end of this era to have been Windows Vista times, when computers were still the primary computing device for end users before being overtaken by smartphones. Following GUIs came our current stage of computing, which I’ll refer to as the Web 2.0 era. This era still involved a GUI, of course, but now the programs people interacted with were no longer located on their own computers. The result of this? Unbelievably high internet adoption rates and the average computer user not even knowing how file systems work . The computing device of the 21 st century is the smartphone, a device which gives the user limited control of their device. A file manager did not exist in iOS until a few years ago, and it’s current implementation is limited. While more complex control is allowed on Android devices, Google seems devoted to limiting user control over time. Besides, the percentage of Android users with the knowledge to flash custom ROMs or even download an APK off the Internet is microscopic in size compared to the average Google Play store using Android user. Think about common internet slang: stuff like /s to indicate sarcasm (which I think is pretty stupid to use but it’s a good example) derives from HTML tags, where to close a tag like you’d use . Hopefully, readers of this article know this already (if not, try pressing F12). This demonstrates a point: Internet users used to know about HTML and how it worked enough that we could make jokes about it. Nowadays, I try to explain basic HTML to my friend and she gets a headache. Now, imagine your average, phone-using Internet user, trying to understand HTML, and how their phone works. They would have not the slightest idea. The reason why is because of this rampant abstraction, which not only removes users from using their devices in a manner consummate with how they actually function, but also makes it more difficult to understand how the device works regardless due to all the levels of abstraction that are occurring under the hood. Most average phone users don’t even seem to know how to work tabs in their web browsers. Update (Jan 29, 2023): Hate to link to Reddit , but the comments in this post describe part of the problem I’m trying to touch upon in this article. Take a look yourself, but here’s my favorite quote from the comments, which perfectly describes the problem: Reality is hidden behind a glossy metaphor and nobody tries to look behind the curtain. And They Don’t “Need” To Know [#] Why did old computer users learn more about how computer worked than users nowadays? It’s because of the increase in accessibility of computing technology. The smartphone and it’s “Apps” are infinitely easier to use than a desktop PC and it’s “programs.” They’re easier to install, easier to use, and more convenient for the everyday person to use in life. When everything just works, people use their technology without worrying about how it works--it’s only when something goes wrong when a more technically savvy user will learn enough about technology to resolve their issue. Is this really a bad thing? No, I’d say it’s a good thing that technology has, at least in this sense, gotten better. I like it when my software works the first time around, and most people tend to agree. However, it’s also important to understand what this ease in usability has taken away from people. The percentage of people who understand the foundations that our world is built upon is going to decrease as more and more children are born into a smartphone-first world. There will remain experts in the field, but the average guy down the block who knows how to troubleshoot problems with technology will disappear. Abstractions in Programming [#] The ways in which we build programs are designed with abstraction in mind. Take, for example, this simple C program: #include int main ( int argc, char *argv[]) { /* check args */ if (argc > 1 ) { fprintf (stderr, "Too many arguments. \n " ); return 1 ; } /* print text */ printf ( "Now we'll print" ); printf ( " Lots of text" ); printf ( " \n\n\n " ); /* math stuff */ int x = 0 ; printf ( "x=%d \n " , x); x += 5 ; printf ( "Now we do math, and x=%d! \n " , x); return 0 ; } Very stupid program, but what if we now wanted to (for some reason) check the argument number multiple times, or do that math to x multiple times? As the quote says, we can use some indirection to solve the issue by making some functions: #include #include void check_args ( int argc) { if (argc > 1 ) { fprintf (stderr, "Too many arguments. \n " ); exit ( 1 ); } void print_text ( void ) { printf ( "Now we'll print" ); printf ( " Lots of text" ); printf ( " \n\n\n " ); } void do_math ( void ) { int x = 0 ; printf ( "x=%d \n " , x); x += 5 ; printf ( "Now we do math, and x=%d! \n " , x); } int main ( int argc, char *argv[]) { check_args (argc); print_text (); do_math (); return 0 ; } Now, we can reuse our code whenever we want with functions. This is one of the simplest examples of abstraction there is when it comes to programming. Some random person can come along and look at the main function I’ve written and have a rough idea what the program is doing without needing to know the minor implementation details. This would allow us to create collections of functions for other people to use; this is called a library, and the interface through which you (the programmer) interacts with that library is called an API. This lets us easily reuse the work of others to complete our own projects quicker, “standing on the shoulders of giants,” as they say. Indeed, abstraction is baked into all programming languages whether we like it or not in the form of standard library functions. When we call printf , no one is really thinking about how printf is often implemented in C as a wrapper function around vfprintf , and that vfprintf then uses putchar to print the characters to the screen. It’s a whole other can of worms and, if we had to worry about that every time we had to do something as basic as print to the screen, it would be difficult to impossible to write more advanced code--at the least, it’d be a lot more time consuming. Programming Language Tower [#] Following this logic, people have been trying to make code easier to write with newer programming languages. A notable example is Python, which is (typically) interpreted to C code. Obviously, this leads to performance hits. Proponents of these newest languages say they reduce errors--and they certainly do--but we lose something valuable. Picture a programming language tower. At the bottom is binary (or just some electrons and logic gates if you went low enough I guess), and at the top is some crazy magically language that is built on top of a hundred other languages, that let’s you call a single magical function that will solve all of your problems. I believe that in the coming centuries of computing, this tower will continue to grow taller. Imagine now, how hard it will ever be for a single individual to understand everything going on in that programming tower. It’s a security problem, a usability problem, and, especially, it’s a maintainability problem. In a hundred years from now, will C programmers be as rare and valued as COBOL or FORTRAN programmers are now? We need some abstraction in programming, but if we ever find ourselves too high up in the tower, there’s no way we could ever climb back down again. It becomes harder and harder to understand until there is no person capable of understanding it all, and the mess of technology becomes unsustainable. ...today’s software has become far too complex for one person or a few to understand. Because it’s libraries built on top of other libraries, etc. By the time you get to know all of it you’d probably be dead from old age. OOP: A Real World Example [#] There’s a problem at the company I work at. All the people there are old Windows programmers, who’ve been programming since before I was born. However, we’re now working on software for a POSIX-compliant operating system. So, they refer to everything in imprecise terms that aren’t really accurate, and take that inaccuracy to the names of their classes. Here’s a rough example of the kind of class you might find in our code: class Semiphor...