X



Home>Tutorial>

A Beginner Guide to Programming: The First Programming Language You Have to Learn

Isaiah Ozadhe Friday, July 31, 2020 Article


None of these languages
Table of Contents
Introduction What Exactly is "Generic Programming"? Variables and Constants Operators Conditional Statements Iterations ( Loop ) Functions What Next? Hey guys, today I want to talk about information technology, programming to be precise. Ever so often when a person first thinks about going into the world of coding, the very first question is always about what language to learn first. The answers you get to that question are is always dependent on who you ask, their favorite language and their mood on that particular day. I'm not trying to be sarcastic here my friend - it is the truth. But today I am going to answer that question from an angle that you have probably not thought of it from before Now. It was this truth I was told by my mentor that has made it possible for me to start working with any programming language almost by just looking at the documentation for a few days ( I'm not bluffing, it is what it is ). So what language should you learn first as a beginner? PYTHON? , VB.net, C?, JavaScript? Or another one of the popular languages? My simple answer is NONE of the above. In fact in the first stages of programming if you want to be versatile and quick to use even new Languages, you will not be writing any single line of code. Long story cut short, In my opinion, the very first programming language you should learn is what I call GENERIC PROGRAMMING!!!!. Yah it was not an illusion, you saw what you saw but don't worry if it doesn't make sense, it will when am done.
What Exactly is "Generic Programming"?
Simply put - it is the template of every programming language. In very ordinary terms, programming means passing a set of instruction to the computer in expectation of some sort of output. But one thing you should understand is that whether those instructions are passed in PYTHON, C#, VB, JAVASCRIPT, C, C++ or any other programming language, the computer will still understand them and produce the desired results. Take a look at this illustration. I am multilingual - I can speak and understand the Ukwani language, Isoko language, English language and then Pidgin English. So when you are talking to me whichever one of the above four languages you use, I will understand you without any iota of misunderstanding. Now look at this again, if you speak Hausa to me - a language which i do not understand - and there is someone there who understands Hausa language and any one of the four languages I speak and that person translates for me, I can communicate with you too. In comparison the computer is also multilingual, it can understand PYHON, C++, C# and whatever other language you have for it as far as there is a middleman who translates ( a story for another day ). So in generic programming, your aim is to understand the template of programming if you do, it is about translating your knowledge to any language you want to learn at all. Let me take you through some things you have to know if you want to be flexible in your programming career - they are constant in any language you chose at all.
Variables and Constants
. According to Wikipedia, a variable in computer programming is a symbolic name associated with a value and whose associated value may be changed. Let me explain in simple terms. During your communication with the computer, there are times when you are going to have to give it data for some sort of operation or get information from it after an operation. Now how do you uniquely identity this information or data?. The answer is simple - Variable. The variable is that container that will hold that value you want to give the computer or that value you want to get. Example if I say in mathematical terms: Name = Isaiah Ozadhe This simply means that you have a container labeled 'Name' and it holds a person's name - in this case Isaiah Ozadhe - but it is dynamic. That means it can hold anybody's name as per the instruction given by you. A constant on the other hand is just a Variable whose value cannot be changed by you, the computer or anyone else. You have instructed the computer that "look, this value am giving to you can never ever change so even if I try to change it, don't let me". Remember once you can understand this concept, it will never change. It doesn't matter what language you are coding on. In VB I will say:
Dim MyName As String = "Tekkieware"

In PYTHON:

Name = "Tekkieware"

In C:

str Name = "Tekkieware";

In JavaScript:

var Name = "Tekkieware";

The concept is very much the same you'll agree. Variable is still a CONTAINER whether it is C#, C++, C or PYTHON. So if you understand perfectly the concept of variable ( data type, scope etc ) you do not need to be a rocket scientist to translate that knowledge to any programming language.
Operators
In very very simple terms, an operator in programming is a symbol that tells the compiler or interpreter to perform certain operation and produce final result. Simple the operator takes values you give, performs an operation on them as per your instruction and return the final result. And again the whole concept of operator is language independent.
If I have two Variables:
Year_of_birth = 1993 and Current_year = 2020 In VB I might say:

Dim Age As Integer = Current_year - Year_of_birth

In Python:

Age = Current_year - Year_of_birth

In JavaScript:

var Age = Current_year - Year_of_birth;

In C:

Int Age = Current_year - Year_of_birth;

Again you see the pattern is very much consistent. Whether it VB oooo, JavaScript oooooo, PYTHON ooooo or any other programming language, Operator is operator. All the above will simply subtract the year you were born from the current year and assign the final result to the variable Age. So if you understand the concept, you can easily translate that knowledge to any language.
Conditional statements.
In a conditional statement, you give the computer an operation to perform. Then you can take control of what you want to do depending on the final result of the operation. Let me illustrate this in very simple terms. You woke up on a Sunday morning and you plan to go to church and then you tell yourself 'If the weather is bad I'll take my umbrella along but if not, I'll leave it behind'. Take a moment's brake, try to understand want you just read and put it into perspective. You have not made a decision on whether or not you'll take an umbrella to church, it will depend entirely on the whether ( a condition ). It is very much the same with conditional statement in programming. You let the computer make a decision based on the conditions you have given. Using the result of our previous example under Operators we make use of the Variable Age which is the final result, In VB I might say:

Dim Comment As String

If Age => 18 then

    Comment = "You are an adult" 

else

    Comments = "You an a child"

End If

In PYTHON:

If Age ==> 18:

    Comment = "You are an adult"

else:

    Comment = "You are a child" 

In JavaScript:

var Comment;

If Age ==> 18{

    Comment = "You are an adult";

}else{

    Comment = "You are a child";

}

In C:

str Comment;

If Age ==> 18{

    Comment = "You are an adult" ;

}else{

    Comment = "You are a child" ;

}

You see again the concept of conditional statement is language independent. Base on the calculated variable Age you are making a decision here, whether the person is an adult or a child. Even if it is C#, C, C++ Rubby on Rails or any other programming language, conditional statement will always remain what it is. So if you understand the concept, you can translate that knowledge to any language with relative ease.
Iterations ( Loop )
An iteration or loop, is simply a way you to tell the computer to 'keep repeating certain code until a certain condition is satisfied'. For example I can tell the computer to keep increasing a certain number until it gets to 5. Again this is very much language independent. Loop is always loop. There are many variations of it but they all function the same way. For example: In VB, I might say:

Dim Numb As integer  = 0

While Num < 5

    Num++

End while

In PYTHON:

 Number = 0

While Num <5:

    Number++

In JavaScript:

var Num = 0;

While ( Num < 5 ) {
  
    Num++;

}

In C:

int Num = 0;

While ( Num < 5 ) {
  
    Num++;

}

Did you notice the consistency?. The ++ sign is an operator used to increase a number by 1. So in all of the above statements, we are doing the same thing increasing the Variable Number - Whose value is 0 - by 1 until it becomes 5. The concept is same, a loop will always be a loop ( repetition of code until a certain condition is satisfied ) whatever programming language there is. So if you understand the concept, you can translate the knowledge to any language.
Function.
A function is a block of organized, reusable code that is used to perform a single, related action. We will not go very deep into this one now. A function is just a block of code that after execution, returns a value. In all programming languages, the concept of function will always be the same. As an illustration, you send a child "Go into my bed room, turn of the music, lower the curtains and then bring me my phone but don't forget to shut the door on your way out" You see, there are four instructions you expect the child to carry out in that room: i. Going into the room. ii. Turning off the music. iii. Lowering the curtains iv. Shutting the door. v. Picking up the phone But when he comes out of the room, he should return with your phone. It is the same with functions in programming whether it is in Dart, Rubby on Rails, C, or C++ programming language. You just package many instructions together as a single block of code, send them to the computer and ask for something in return. If you understand the practical concepts of functions then you can translate it to any programming language. All right guys thats it. Those five things we have seen are the core concepts on which any programming logic is tied in spite of the programming language it is written on.
So what Next:
At the end of this article if you are really interested in going into the programming world, re - read it again and again until you understand everything perfectly, find more information about Variables and constants, Operators, Conditional statements, Loops ( Iteration ) and Functions. Subsequent Tutorials on Emmason247 will discuss them in detail. Remember, the course is generic programming so don't base your research on any programming language. I repeat do not base your research on any programming language. After you have done all of this carefully, Pick any language of you choice, delve into it an feel the magic of Writing programming Coding. My name is Isaiah Ozadhe and Every week, I will be dropping practically easy to follow tutorials and articles here on Emmason247. If you like this one, come back same time Next week. Do have a wonderful day!!!!!!!!.

| | Views(1229)

See Demo | Download File


Add your comment. Indicate code using code tag


Words: 0 | Chars: 0 | Reading Duration: 0



Images Attachment




Emmason Integratded Services(2017-2024)
All Rights Reserved
Designed and Maintained By Emmason Integrated Services