Computer Science

What Is Abstraction in Computer Science? [And Why Does it Matter?]

What Is Abstraction in Computer Science? [And Why Does it Matter?]
The levels of abstraction are useful because they allow people to work on systems without needing a granular understanding of those systems. Image from Pexels
Christa Terry profile
Christa Terry January 30, 2021

Abstraction is a challenging comp sci concept that leaves many people scratching their heads. We dug into exactly what it is and why it's so hard to understand.

Computer Science Programs You Should Consider

Advertisement
Article continues here

The question What is computer science?” can lead you down a rabbit hole of further queries. Comp sci is a complex discipline because it is made up of fields and subfields that can be broken down into elemental concepts expressed using mathematics. Consequently, mastering computer science takes years, and even experts disagree on how to define fundamental concepts.

Take abstraction in computer science. It’s often described as the creation of well-defined interfaces to hide the inner workings of computer programs from users. According to the BBC, however, it’s the process of identifying the general characteristics needed to solve a problem while filtering out unnecessary information. The Valuable Dev writes that abstractions “simplify a process or artifact, by providing what you really need, and hiding the useless details you don’t care about.”

Confused? You’re not alone. Abstraction in computer science is such a baffling concept in part because there are multiple accepted definitions. It’s a catch-all term that can be applied in different ways in multiple contexts, making the concept of abstraction itself an abstraction. That means the best way to understand abstraction—a concept you’ll encounter if you decide to study computer science—is to look at the different ways it’s used.

In this article, we dig into the question ‘What is abstraction in computer science?‘ by covering:

  • What is computer science?
  • What is abstraction?
  • What are levels (or layers) of abstraction?
  • What is data abstraction?
  • What is control flow abstraction?
  • Examples of abstraction in computer science
  • Computer science degrees
  • How hard is computer science?
  • Why computer science is important
  • Top master’s in computer science programs
  • Top online master’s in computer science programs

What is computer science?

This is a surprisingly tough question to answer. Computer science is an interdisciplinary field in constant flux because our understanding of technology and its applications is evolving. Everything from hardware engineering and network architecture to cyber security and algorithm design is part of computer science, as are artificial intelligence, computational biology, and quantum computing.

Some assert computer science is an academic discipline that blends scientific inquiry, engineering, mathematics, and technology. Others say that it’s largely practical, important mainly for its potential to change the world. Both opinions are valid. Distinguishing between computer scientists and people who work in computer science is easy. Drawing a hard line between what is and isn’t computer science is more difficult because the definition of computer science changes depending on whom you ask. However, it’s always broad.

Computer science definition

Purists define applied computer science as the study of computational processes and machines, and theoretical computer science as the study of computational thinking itself. The problem with the purist’s definition is computer science is also a practical discipline. Some computer science professionals are researchers, but most aren’t. In common usage, computer science is an umbrella term encompassing not only the study of computers and computing but also their practical applications.

Advertisement

“I’M READY FOR A DEGREE!”

University and Program Name Learn More

What is abstraction?

Abstraction is everywhere you look in computer science, but it means different things in different contexts.

One way to think of abstraction is as synonymous with generalization. You take something and separate the idea from its implementation. If, for instance, you wanted to create a program to multiply five times six, you wouldn’t build an application to only multiply those two numbers. Instead, you’d create a program capable of multiplying any two numbers. To put it another way, abstraction is a way of thinking about a function’s specific use as separate from its more generalized purpose. Thinking this way lets you create flexible, scalable, and adaptable functions and programs.

Another way to think of abstraction is in terms of what you (or users) need to know or see. In “Introduction to Computation and Programming Using Python,” John Guttag writes that the “essence of abstraction is preserving information that is relevant in a given context, and forgetting information that is irrelevant in that context.” Software developers use subroutines or monads—both of which are functional abstractions. Database users routinely encounter view-level abstractions that simplify their interactions with the database. An operating system is an abstraction of the code underneath.

Abstraction is also used to create functions to camouflage most of the mechanisms driving the function. That doesn’t mean the process of abstraction is the same as encapsulation or information hiding (i.e., simply putting the implementation details of a function behind an interface). What makes abstraction useful in this context is that it allows developers to create functions that can be updated or improved without disrupting the application and be used in other places. In object-oriented programming, abstraction helps reduce risk in software development.

What are levels (or layers) of abstraction?

Levels of abstraction are common in computer science, with each layer representing a different model of the same processes. The lecture notes of the University of California – Berkeley’s CS 61A course (circa 2010) lays out the hierarchy of abstraction in computer science like so:

  • Application Programs: These are software programs that perform specific tasks for users. They operate at the highest level of abstraction, where users interact with computers. Examples include word processors, web browsers, and games. Application programs are written using high-level programming languages and rely on the underlying system and software libraries to function.
  • High-level Language: These are programming languages like Python, Java, or C++ that provide strong abstraction from the complexity of the computer’s hardware. They allow programmers to write code using human-readable syntax and structures. High-level languages are more about problem-solving and less about managing the machine’s specific hardware.
  • Low-level Language: Low-level languages, such as assembly language, are closer to the hardware and provide less abstraction. They are more complex and difficult for humans to read, but they offer greater control over the hardware and are more efficient in terms of execution time and memory usage.
  • Machine Language: This is the lowest level of language that is directly understood by the computer’s central processing unit (CPU). Machine language is a set of binary codes (1s and 0s) that instruct the CPU to perform specific operations.
  • Architecture: In the context of computer science, architecture refers to the conceptual design and fundamental operational structure of a computer system. It’s a blueprint for the design and operation of a computer’s components, including the CPU, memory, and input/output mechanisms.
  • Circuit Elements: These are the basic components of electronic circuits, such as resistors, capacitors, and inductors. They are used to construct more complex parts of a computer, like logic gates and memory cells.
  • Transistors: Transistors are semiconductor devices used to amplify or switch electronic signals and electrical power. They are the fundamental building block in microprocessors and memory devices, acting as fast switches to control the flow of electrical signals.
  • Solid-state Physics: This branch of physics studies how solids behave, particularly focusing on electron behavior in semiconductors. Solid-state physics is crucial for understanding and developing transistors and integrated circuits used in computers.
  • Quantum Mechanics: Quantum mechanics is the branch of physics that deals with the smallest scales of energy levels of atoms and subatomic particles. It provides the theoretical foundation for solid-state physics, and advancements in quantum mechanics have led to the development of quantum computing, which represents a significant leap in computation power and methodology.

One way to think about each level of abstraction is that higher levels (where you’ll find applications and user interfaces) are designed with people and their thought processes in mind, while lower levels represent the way computers work. Each level in this hierarchy abstracts away the complexity of the lower levels, allowing for more sophisticated and user-friendly interactions with computers and their applications. There are no transistors without solid-state physics, but programming languages exist whether or not you use them to build software systems.

The levels of abstraction are useful because they allow people to work on systems without needing a granular understanding of those systems. You can, for example, create perfectly functional software without knowing the first thing about how logic gates work.

What is data abstraction?

In programming, it’s a good idea to not only separate data from functionality, but also reduce the complexity of data. Data abstraction is the process of creating simple abstract data types, or classes, to hide unnecessary details. Simplification makes different-but-related data types with multiple attributes easier to access and manage, and gives different systems a common language for talking about an object even if they act on that object in very different ways.

What is control flow abstraction?

Control flow is a way of describing the order in which function calls are executed. Code runs in the order it’s written unless a programmer introduces control structures like conditionals or loops to change the order of execution. Control flow abstraction involves applying the principles of abstraction to a set of operations. The program fragment is designed around a function rather than its implementation in a particular application, so it’s available for reuse. Subroutines are a good example of control flow abstraction in action.

Examples of abstraction in computer science

First, let’s look at an example of abstraction that’s not part of computer science. Numbers are abstractions most of us are entirely comfortable with. Even young children understand how numbers can succinctly represent elements of everyday experiences. If you ask a friend, “How many pizza slices are left?” and they answer “Four,” they’ve conveyed the relevant information without involving any background detail. But ‘four’ can also refer to the time of day or the number of apples on the table or the atomic number of beryllium. That’s abstraction in real life.

In computer science, you might have a sort algorithm that works on linear data structures (e.g., lists). You can sort array-backed lists, linked lists, or other lists. Your list might be made up of five items or five hundred. The code isn’t tied to specific use cases, but to the idea of ‘sorting’. Put simply, you don’t have to code one sort algorithm for five-item lists and another for five hundred-item lists because you’ve tied functionality to an abstraction.

APIs are a type of abstraction you might be familiar with. An API is an intermediary that allows applications to communicate but abstracts the details of what is being communicated and how—simplifying the process of application-to-application communication and providing a level of security.

Still following? Then you probably have the kind of aptitude for computational thinking associated with success in computer science degree programs and comp sci careers.

Computer science degrees

Professionals in computer science typically have one of three degrees: a Bachelor of Science in Computer Science (BSCS), a Master of Science in Computer Science (MSCS), or a PhD in Computer Science.

Full-time and part-time comp sci programs at the bachelor’s level prepare students for all kinds of tech-focused roles. Core coursework usually touches on topics like:

  • Algorithms: This course focuses on the study and design of algorithms — step-by-step procedures or formulas for solving problems. Key topics include algorithm efficiency, sorting and searching algorithms, and algorithmic strategies like recursion and dynamic programming.
  • Calculus: A fundamental mathematics course covering concepts such as limits, derivatives, integrals, and infinite series. Calculus is essential for understanding the mathematical underpinnings of many computer science theories, especially in fields like machine learning and graphics.
  • Computer Architecture: This course covers the design and organization of computer systems. Topics include CPU design, memory management, input/output processes, and basic concepts of parallelism.
  • Computer Engineering: This course bridges the gap between electrical engineering and computer science. It covers hardware design, microprocessors, embedded systems, and how software interacts with hardware.
  • Data Structures: Students learn about various ways of organizing data in a computer. Topics include arrays, stacks, queues, linked lists, trees, graphs, and hash tables, along with their algorithms and applications.
  • Linear Algebra: This math course focuses on vector spaces, linear mappings between these spaces, and matrix theory. It’s crucial for fields within computer science such as computer graphics, machine learning, and scientific computing.
  • Logic: This course covers formal logic, a key component in computer science. Topics include boolean algebra, predicate logic, and sometimes elements of proof theory and model theory, which are foundational for understanding computation and programming languages.
  • Programming: A fundamental course in computer science, this teaches students how to write code. It typically covers one or more programming languages (like Python, Java, or C++) and includes topics such as syntax, control structures, data types, and basic data structures.
  • Software Development: This course covers the principles and practices of software engineering. Topics include software design, development methodologies, testing, maintenance, and project management.
  • Statistics and Probability: This course provides students with a grounding in statistical methods and the theory of probability, which are essential for data analysis, machine learning, and algorithm development.

There are two types of computer science master’s degree programs. The first is the MSCS for non-CS majors. On-campus and online computer science programs for non-CS majors cover the same ground as bachelor’s programs (e.g., programming, database administration, and software engineering fundamentals). The second is for students with an academic or professional background in comp sci. These programs skip over basic concepts in favor of advanced material and are more likely to have specialization tracks that take a deep dive into one area of applied or theoretical computer science.

Computer science doctorate programs are typically project- or research-focused and built around independent study guided by each student’s area of interest. The education PhD candidates receive is designed to teach them how to apply the fundamentals of scientific inquiry to computing, not new coding skills or computational theories. Do you need a doctorate? It depends. Earning a doctoral-level computer science degree is only really necessary if your goal is to go into research or academia. On the other hand, some pretty high-profile tech companies (e.g., Google) are known for hiring PhDs.

How hard is computer science?

Top computer science degree programs have classes designed to weed out all but the most dedicated students, but aptitude may be just as important as intelligence and dedication. Many people enroll in comp sci programs because they like programming or building computers only to discover computer science is essentially a branch of mathematics at many schools.

“CS isn’t about being good with computers; it’s basically solving math-like problems from scratch,” writes one commenter in a Reddit thread about whether comp sci is hard.

Another added that “to be successful at it, you need to be able to think in a very logical way, and also be able to break complex problems down into smaller parts. There are some people that just aren’t naturally good at that.”

If you don’t have an aptitude for logic and mathematics, pursuing a degree in comp sci (versus software engineering or computer engineering) will test the limits of your intellect and patience.

Unless you plan to pursue a career in theoretical computer science, however, your experience in the real world will be very different. Computer science jobs can be more fun and less stressful than the average comp sci degree program.

Why computer science is important

Comp sci is more than just the study of computers and computation. That definition is a useful abstraction—see what we did there?—but it doesn’t begin to describe the scope of the impact this discipline has on our lives. We buy everything from theater tickets to thumbtacks online. Our television viewing habits are influenced by algorithms. We let computers control our homes, and we drive cars built by robots. Business is conducted over vast global networks. The financial sector operates using 1s and 0s instead of dollars and cents.

Applied and theoretical computer science is a major driver of innovation in myriad industries, and technology is increasingly a part of everyday life. This has led to a huge uptick in demand for computer scientists and other people with tech skills, and the need for developers, analysts, administrators, and architects is only going to grow.

Top master’s in computer science programs

U.S. News and World Report maintains a list of the best colleges and universities for computer science at the graduate level. The following schools are home to some of the top MSCS programs in the United States:

  • California Institute of Technology
  • Carnegie Mellon University
  • Cornell University
  • Georgia Institute of Technology (Main Campus)
  • Massachusetts Institute of Technology
  • Princeton University
  • Stanford University
  • University of California – Berkeley
  • University of Illinois at Urbana – Champaign
  • The University of Texas at Austin
  • University of Washington – Seattle Campus

Top online master’s in computer science programs

The best online master’s in computer science programs do a lot to replicate the on-campus experience. The coursework is the same, and the same professors teach classes. The computer science department and alumni groups host virtual events so students can connect with industry leaders and one another. And distance learners receive the same level of career support as students who took classes on campus.

These schools are home to some of the top online and hybrid computer science master’s programs:

  • Boston University
  • Columbia University
  • Drexel University
  • Georgia Institute of Technology
  • Johns Hopkins University
  • Stanford University
  • Stevens Institute of Technology
  • Tufts University
  • University of Illinois—Urbana-Champaign
  • University of Southern California
  • Virginia Polytechnic Institute and State University
  • Worcester Polytechnic Institute

Hopefully, you’re feeling a little more confident after reading up on computer science in general, abstraction in particular, and what earning a degree in comp sci entails. You still have some research to do if you’re thinking about enrolling in a BSCS or MSCS program, however. The good news is once you choose a specialty area and a school, chances are good you’ll have a long and lucrative career ahead of you. Computer science professionals are in demand, and there are thousands of well-paying computer science jobs waiting to be filled by people who are comfortable with concepts like abstraction.

(Updated on January 9, 2024)

How useful is this page?

Click on a star to rate it!

Since you found this page useful...mind sharing it?

We are sorry this page was not useful for you!

Please help us improve it

How can this content be more valuable?

Questions or feedback? Email editor@noodle.com

About the Editor

Tom Meltzer spent over 20 years writing and teaching for The Princeton Review, where he was lead author of the company's popular guide to colleges, before joining Noodle.

To learn more about our editorial standards, you can click here.


Share

Computer Science Programs You Should Consider

Advertisement

You May Also Like To Read


Categorized as: Computer ScienceInformation Technology & Engineering