Introduction
What language should I learn first when starting to code is certainly one of the questions you ask yourself.
One of the most exciting and sometimes overwhelming things about learning to code is that there is so much to learn.
However, it’s also helpful to learn the basics (the building blocks) rather than just focusing on learning a particular technology. Break down the layers of abstraction to learn the basic principles common to all technologies.
Understanding what coding is at a basic level will make problem-solving easier and give you a better understanding of how different technologies work under the hood.
In this article, we’ll cover the basics of computer coding, explain what a program consists of, and offer some suggestions on how to take your first steps in learning to code.
What is coding? A definition of a new starter
Computer coding, also known as computer programming, is a way of telling a computer what to do.
Coding is a way of telling how a computer should behave overall: the exact actions it should perform and how to perform them in an effective and efficient manner.
Specifically, coding is the process of creating and giving a computer a series of detailed instructions that are carefully sequenced.
A set of instructions is called a program or code.
Computers are incredibly smart machines, but they rely on humans to get things done. Simply put, coding is the art of how humans communicate with computers. It helps solve problems and build new tools that serve the community, such as apps and websites, and can analyze and process large datasets.
An overview of the coding
Coding is about solving problems.
When you write code, you take a problem, break it down into smaller action steps, and use logical thinking to finally arrive at a conclusion and solution.
Computers take everything literally and pay close attention to detail.
If you make a small mistake in your code – like for example a typo in a word, a missing semicolon, you are telling the computer to repeat an action but how and when to stop repeating it If not, he will display all error messages.
These errors are called errors in code. The process of identifying possible errors, finding the cause of the problem, and fixing the errors so that the code works as intended is called debugging.
This is an important part of writing code and learning programming in general.
Why algorithms are important in coding
Understanding the exact instructions a computer needs to perform a particular task is the hardest part of coding and problem-solving.
Computers make no assumptions and do exactly what they are told. This means that there should be no ambiguity in the instructions they receive.
The instructions should be clearly defined, in the correct number and order, to have the computer perform them to solve the problem.
A series of step-by-step ordered instructions that a computer uses to solve a problem and perform each task is called an algorithm. Algorithms are sequences of actions that must be correct, efficient, accurate, and to the point, without room for misunderstanding.
Algorithms aren’t just for computers. People also use algorithms every day.
An example of the type of algorithm we often use is following a cooking recipe.
A recipe is an algorithm. The recipe steps must be followed in the correct order to achieve the desired end result.
How to write pseudocode to plan out algorithms
To organize, plan ahead, and write down the steps and algorithms you need to follow, you first need to write some pseudocode.
An informal way to represent an algorithm is with pseudocode.
Pseudocode has no specific syntax. It is written in plain, easy-to-read English (or other natural human languages) with some jargon.
The purpose of writing is only for programmers to understand the reasoning and logic behind the code/steps they need to write to solve a problem in simple sentences. Programmers then write the code that the computer actually runs.
Pseudocode is a simple version of computer code, the first step before writing computer code.
I want to write a program that prompts the user for a password and checks if it is equal to “1234”.
If the password is equal to “1234”, it can be entered into the system. Otherwise, they will be rejected.
A simple version of this, written in pseudocode, looks like this:
user_password = input: "Please enter your password to sign-in: "
if user_password is equal to '1234'
let them into the system
else
tell them they entered the wrong password
Then you can build later based on this code.
For example, if you entered the wrong password, you can ask again.
If you enter it incorrectly more than three times, it will be rejected by the system.
correct_password = 1234
attempts = 0
while conditions are true
user_password = input: "Please enter your password to sign-in: "
attempts = attempts + 1
if user_password is equal to correct_password
let user in the system and stop the program
if user_password is NOT equal to correct_password AND attempts is greater than 3
don't let user in and stop the program
How programming languages help people and machines communicate with each other
The language used by computers
Basically, a computer can only speak one language (binary code or machine code).
This is a binary number consisting of only two digits, 0 and 1.
This fits well with the fact that computers run on electricity. Electricity has only two states: off and on.
Inside a computer, there are millions of tiny switches or transistors that control the flow of electricity up and down.
So basically computers can only understand no and yes. Values are represented by transistors that are off (or 0 or no) or on (or 1 or yes).
Everything under the hood is visible in this state.
Binary or machine language is the lowest level of language because it is closest to the machine.
Instructions are represented solely by digits, sequences of 0s and 1s (also called binary digits) that directly control the computer’s CPU (Central Processing Unit). There is a specific machine language for each machine architecture.. The language is very fast because it doesn’t require any conversions, but it’s not easy for humans to use.
Error-prone and time-consuming.
Binaries were used in the early days of computers, but these programs written in binary were difficult to understand and read.
We needed a language that both humans and computers could easily understand and interpret.
Programming languages have evolved over the years. Levels or generations are the names for these evolutions.
Binary is the first generation (or 1GL) of programming languages.
As programming languages evolved throughout history and new languages were developed, they became more and more like the languages people use.
Assembly language introduction
The second generation programming language was assembly language (2GL). This provided a huge leap and improvement in programming compared to using machine language.
Although it was still a very low-level language, Assembly introduced alphabetic characters (also known as mnemonic codes) into programs, making them easier to understand and use.
The language instructions used in assembly and the underlying computer architecture have a close relationship.
So there is a correlation between the language mnemonic and the machine’s native binary instructions.
Assembler introduces a translator called assembler to convert programs written in assembler into machine language (because it is the only language that can run computer programs). Assembly was easier to read, easier to use, and easier to debug, but it was still very buggy and tedious to program.
The introduction of higher-level programming languages
After assembly language comes to the third generation programming language (3GL).
They paved the way for a new style of programming, more accessible to humans and further removed from the native language of machines.
These languages have been called high-level languages. They are easy to read, write, and understand because they resemble the spelling of English.
They are machine independent and provide a higher level of abstraction away from the machine.
Translators, called compilers, were introduced to convert code written by a programmer in such languages (also called source code) into machine-executable binary his code. These languages included BASIC, FORTRAN, COBOL, PASCAL, and others that are still popular and commonly used today, such as C, C++, Java, and JavaScript.
Fourth Generation Languages (4GLs) followed. It was faster and easier to use, with a higher level of abstraction from the computer. And they began to look more and more like human languages.
Productivity has improved because programmers no longer have to spend time telling computers how to solve problems.
Instead, they focused on telling the computer what to do and didn’t need the extra steps of how to do it. Fourth-generation languages include not only scripting languages such as Python and Ruby, but also query languages for retrieving data from databases such as SQL (Structured Query Language).
Finally, fifth-generation programming languages (5GLs) are based on artificial intelligence.
Computers are trained to learn how to solve problems without programmers writing algorithms.
Languages used include Prolog and Mercury.
Why should you learn to code?
Coding is a powerful tool.
It gives us the opportunity to solve problems and bring ideas to life in unique and creative ways.
Learning to code could make one of your dreams come true and bring your vision to life.
Coding also helps us make sense of the ever-changing digital world.
Almost everything we use every day, from finding directions to a particular destination, to ordering products online, to apps that track our steps for the day, is done in code. Coding is used in every industry. So knowing at least the basics of coding will give you a competitive edge when looking for a new role or promotion.
Also, there is currently no shortage of IT and programming jobs. On the contrary, they are growing, and that growth doesn’t appear to slow down anytime soon (despite the theory that artificial intelligence will eventually replace programmers).
Apart from these reasons for learning to code, coding is a fun new hobby and a productive pastime.
Programming is for everyone, regardless of age, background, or where you are in life. You don’t need a four-year college degree to get started. Start learning for free from the comfort of your own home.
Anyone can learn to program if they want to.
How to start coding
There are so many programming languages out there that beginners can be overwhelmed choosing which language to learn first.
First, think about the problem you want to solve, then explore which technologies can help you reach that goal.
For example, if I wanted to create a personal girlfriend website, I wouldn’t start by learning Java or C++.
A good starting point for beginners is:
HTML (Hyper Text Markup Language) is the skeleton of all her web pages. It shows all types of content displayed on a website, from text to links to images and videos. CSS (Cascading Style Sheets) to make your HTML look nice. It is used to change the website’s fonts and colors and is also used to make the website more responsive and usable on any device.
JavaScript that adds functionality and interactivity to static web pages.
Very good write-up. I certainly appreciate this website. Keep writing!