Abstractions

Rajat Joshi
2 min readMay 5, 2023

--

Abstraction in software engineering is the process of simplifying complex systems or problems by focusing only on the essential details needed to accomplish a specific goal, while ignoring irrelevant or unnecessary details.

But abstraction is much more than a software engineering concept. It is a fundamental idea that stays unstated but grossly pokes out if violated. Abstraction is hiding the details of a process which could be confusing to your audience. It has many levels to it and can mean different things to different people.

For example, in programming a function is an abstraction over a sequence of instructions. Below is a function that gives the steps to become an expert on large language models

def LLM_expertise(person):
person.tries_chat_gpt()
person.post_lists_of_ll_models()
tech_influencer = person.teach_prompt_engineering()
return tech_influencer

Here the abstraction is that you can pass a person through the LLM_expertise function and get a tech_influencer in return. Everyone calling the function doesn’t need to know how its working.

A function abstracts a set of instructions. Similarly a class could abstracts a set of functions to be used in other classes. In the physical world a power point presentation is an abstraction over all the research and development you have put into a project. A BI dashboard is an abstraction over all the SQL queries you wrote. Giving concise updates in meetings without explaining your whole project is an abstraction over your knowledge.

In a nutshell, abstraction is not about doing less, it is more about showing an effortless and uncomplicated front.

Outro…

Also, watch below how I tried Chat-GPT to write an example of class abstraction with Python. Like this post if you want a comprehensive list of large language models or learn prompt engineering.

class Animal:
def __init__(self, name):
self.name = name

def speak(self):
pass

class Dog(Animal):
def speak(self):
return "Woof!"

class Cat(Animal):
def speak(self):
return "Meow!"

dog = Dog("Rufus")
print(dog.speak()) # Output: "Woof!"

cat = Cat("Fluffy")
print(cat.speak()) # Output: "Meow!"

In this example, we define an abstract Animal class with an abstract speak method, which is implemented by the Dog and Cat subclasses.

Fin.

--

--