Five Key Programming Concepts
Now think about writing a language that a computer can understand - aka programming. There are over 500 languages that you could learn to program a computer which essentially gives it a set of tasks to perform. The most common today being: Java, Python, JavaScript, etc ... No matter which language you choose, each have a similar set of the following programming concepts that once you learn to master, you will be able to learn each language much faster.
Variables
Just like in math, variables store information. Think of a variable like a purse. You can put something in it to carry & hold. The variable is something that you reference to later with a name that you specify. You can even change the contents of the variable while still being able to refer to it.For example:
var x = 100;
900 + x = b
What is variable 'b'? 1000
Data Types
Data types can specify what type of value a variable can be. In the above example that I wrote, you'll notice that the variable was a number. Variables can also be words, true/false, characters, decimals, etc ... In computer programming, you'll notice that words are considered "Strings".Conditional Statements
Conditional statements are like rules to be followed if certain conditions are met. For example, let's imagine there are a group of people that you want to entertain with TV. The type of channel you turn to would be determined by the type of people in the room.If group is mostly men, turn to ESPN.
If group is mostly women, turn to LIFETIME.
Loops
Loops are exactly what they sound like, Loops! They are a set of instructions until a specific condition is met - either true or false. Imagine your hair has grown down to your ankles. It is very long! So long that it's time for a hair cut. At the salon:If length of hair is LONGER than shoulder length, then cut hair.
If the computer was a hair stylist, the computer would read that if statement, and continue cutting your hair until it became shoulder length. As long as the 'longer' condition is true, the computer will keep cutting. There is more to it with things such as 'else' & the different types of loops, but this is just a general idea of what a loop is.
Functions/Methods
As you learn most modern programming languages, you may hear of a certain fundamental such as object-oriented programming. In a nutshell, an object is like an adult version of a variable. Similar, but VERY different. If you're using JavaScript, a function is a set of coded statements that perform a specific task. The function itself is an object. If you're using Java, you can house a set of code within a Method that together perform a specific task and an object could be among them which you could pass to different methods to use the same data.
Conclusion
Relatively, it is all fairly easy. The difficulty is when trying to communicate to a computer that doesn't necessarily understand what you are trying to accomplish. Within each programming language there are guidelines, semantic elements, etc ... just like the English language, but we don't all talk & write proper English now do we?
Thanks For Reading,
Shanell A. Spann
Connect with me on:
My Site – https://htmlbyshanell.com/
GitHub – https://github.com/HTMLbyShanell
YouTube - https://www.youtube.com/channel/UC3EaLC-43IlJYMcykUBnkog
LinkedIn – https://www.linkedin.com/in/shanellspann/
Comments
Post a Comment