A no-code version , from a Tesla fan, to address the dilemma of abstraction vs. encapsulation in an object oriented software design.

Why is object-oriented programming so preferred? Besides being widely accepted and highly demanded for decades, its preferred because it just makes sense to a human brain! It makes sense because it is closer to real life.

Abstraction and Encapsulation are the main tools at the disposal of anyone using OOP to their advantage. Being very similar, both of them are so close in concept yet so apart in intent that confusion is prevalent. The problem only arises when…

Building on the previous post about abstraction and encapsulation, this time I am going to write about Iterators & Generators which is where we see abstraction & encapsulation in action, within the Python realms itself.

To start talking about Iterators, we need to know what an Iterable is because that is what an iterator works upon.

What is an Iterable?

Literally, iter-able means anything you can iterate or loop over. Anything that you can use taking out one item at a time. In Python, an iterable is a collection of values that are capable of returning one element at a time. All the sequential…

This is part II of three parts post about some basic questions that I learnt about by failing the interviews.

In case you find this interesting, please have a look at the first part here.

Decorator — Wrapper over an existing Function

What are Decorators?

For a relief, I believe if someone gets this question, that means you are already at level 2.
Decorator, as the name gives it away, is ‘something’ that wraps over the original ‘something’ to make it even better. But of course, this leads you to another question. How do we do it and Why do we need it?

How do we do it?

The explanation of this requires a ground…

Five basic things I learned about Python by failing three interviews!

Photo by Chris Ried on Unsplash

They say ‘God is in the details’. I clearly was missing this point while preparing for my initial tech interviews. While I spent most of the time in perfecting my data structures and algorithms knowledge, I relied on my practice-on-job to take care of the language related questions in the interviews. Result; I did terrible on three interviews because of a few basic concepts. Retrospection made me realize that I have been doing it all along without knowing the tiniest details of it and hence failed to answer them correctly when asked.

This post is the first part of a…

Ramsha Bukhari

A coder-cum-teacher! — The coder takes care of the ‘How’ while the teacher looks after the ‘Why’ —

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store