DEV Community

Cover image for Simulating OOP in Bash

Simulating OOP in Bash

Leandro Proença on August 06, 2022

Everyone knows that OOP stands for "Object-oriented programming". But what is in fact OOP? Is it a Class? Is it inheritance and polymorphism like w...
Collapse
 
cicirello profile image
Vincent A. Cicirello

I don't think you are just simulating OOP here. Very nice demonstration that OOP doesn't necessarily require a language that was designed for OOP (although it helps).

Collapse
 
leandronsp profile image
Leandro Proença

Indeed, after all it's all about abstractions. We developers only see abstractions.

At some point, even in a language designed to support OOP, under the hood the implementation is somehow similar to what I demonstrated here.

Collapse
 
cicirello profile image
Vincent A. Cicirello

Exactly.

Collapse
 
leandronsp profile image
Leandro Proença

very interesting, thanks for sharing!

Collapse
 
chrisgreening profile image
Chris Greening

Hey fantastic work! Lots of interesting info here aside from just implementing OOP in bash, love reading posts like this :~) thank you!

Collapse
 
polterguy profile image
Thomas Hansen

Funny 😂

Collapse
 
leandrosilva profile image
Leandro Silva

You're doing some really cool stuff. These "going to the underlying basis" or "thinking from the first principles" kind of thing, whatever you wanna call it, it absolutely genius.

Keep going!

Collapse
 
leandronsp profile image
Leandro Proença

your words mean a lot, thanks!