Learning programming is like learning a completely different language. It gets even worse for a person coming into the field to be bombarded by long tutorials littered with words that make no sense.
All the words below have more than a million words written about them. But we don’t have the brain capacity or time to process such a massive amount of information. Today, I’ve tasked myself with explaining each concept as simply as possible.
So here’s a quick and concise decryption of commonly used words in programming.
Immutable is another word for unchangable. If a state is said to be immutable, it means that it’s not supposed to change. Whatever value you’ve set is not going written over or has the potential of changing.
A class is a structured set of code written in a certain way to specify a set or category of things. It is a blueprint for an instance of that particular thing.
People use classes to create more of the thing. They create new classes, assign values to it and use the methods (aka written functionality) to do things with the instance of the class.
It looks like a class. It smells like a class. People often mistake it as a class. But it’s not a class.
A prototype is the instance itself but replicated. While a class is the plan for the thing, a prototype is the thing with the ability to be extended with features.
The easy way to get your head around it is that an object gets used to create and a prototype is used to create.
4. First Class Function
A function that’s treated like a variable.
This means you can have a function inside a function and set it up like a variable.
A function, procedure or algorithm that calls itself.
For example, a for loop is a recursion. Main component of a recursion is the thing that kick starts it off and a condition that ends it — or else it will just keep calling itself until the program crashes.
The thing that ring fences off a group of methods or data from outside access.
Encapsulation keeps things local and private inside a conceptual box.
The ability for that same thing to be lots of other things.
For example, an object is polymorphic because it is a blueprint where unique variables can be set for multiple instances of it.
Cats are polymorphic. They’re all still cats but with different appearances and personalities. A stormtrooper’s armor, however, is not polymorphic because they’re all the same.
The same concept as inheritance with money.
The child inherits whatever the parent has/is. Inheritance is the act of the child taking on the values and properties of the parent.
In most languages, inheritance flows inwards — meaning that the flow of inheritance goes parent to child and not the other way around.
9. Data Type
Naming what kind of data it is you’re setting.
Java is a strongly typed language because you have to tell it exactly what the thing you’re setting is — that is — boolean, char, short, int, long, float or double etc.
It sticks around. If you go back to it, the thing is still there.
For example, a declared variable and an instance of an object has persistence because it’s still there if you call it again.
If you can’t explain it simply, you don’t understand it well enough – Albert Einstein
All the concepts above started off as one liners from their creators. But over time, more words have been added to them to test, extend and expand on the idea. There’s nothing wrong with that either — but that can be overwhelming and intimidating for new developers. I was there myself half a decade ago and I know the feeling.
I hope that in condensing it back down, it’s made life a little bit easier for you.