Skip to main content

Basics of Programming: Are all Programming Languages the same?

Introduction:

What do we mean by the term 'Programming'? Well, the top result by searching on Google gives us a definition by edX like this:
Computer programming is the process of writing instructions that get executed by computers.
Hope the above definition makes sense to you! If not, it will be more clear to you at the end of this post.


Programming in Visual Basic


What is a Hello World computer program?

If you tried to learn programming for the first time, the very first program you will create is a Hello World program.

A Hello World program is a just a single line of instruction that tells the computer to print or display some text on the screen. 

A Hello World program written in Java.

Now, you will think how can a single instruction can create a full-fledged computer program. Okay, let me tell you that to make a particular program there is a specific sequence which must be followed. This sequence is known as an algorithm

For example, to make coffee you have to follow the following sequence:
1. Pour milk in a container.
2. Put the container above the fire.
3. Wait, until it gets hot.
4. Pour the milk from the container to a cup.
5. Add Coffee and Sugar.
6. Mix it properly.

If any the steps above are interchanged, you will not the get the desired result. That's what is similar to programming. If you don't follow a specific sequence you will not get the desired result. So, if you want to make coffee, you have to expand the process into steps. Here, each step is a individual instruction. And after a bunch of such individual instructions, you get your work done. 

Thus, you can conclude that a number of such individual instructions can create a full-fledged computer program!

What is the code?

The instructions, that are written in a programming language which the computer can understand and use to perform a task or solve a problem is called code. There are many programming languages you can use such as C, C++, Objective-C, C#, Visual Basic, Python, Java, JavaScript, Swift, etc.

Source Code:

The instructions that you type to make a computer program is known as source code. A source code can be written in any simple text editor like Notepad in Windows, TextEdit in Mac, or Gedit in Linux. We actually do not need any formatting for our code such as Font, Font Size, Bold, Italic, Underline, etc. The programming language just ignores that. Just simple and plain text!

Source Code in Visual Basic

Well, I know, you will be wondering that why most of the programmers don't use such simple text editors. The reason is that most of the modern text editors such as Sublime Text, Atom, Visual Studio Code, Brackets, Vim, Notepad ++, etc., provides plenty of features that make the work of programmers simpler. Such features include text colouring, indexing, source control, extensions, an integrated terminal, project structure, and so on.


A Modern Text Editor


Thus, you can conclude that you do not require a special kind of software or application to write source code.

Why source code looks similar everywhere?

You just have known that programming language does not care about formatting. So, why source code is similar everywhere? The reason is that there is a convention that you should use Monospaced fonts (every character has the same width) while writing source code. This makes the source code look better and our code looks like code.


Monospaced VS Proportional Fonts

Machine Code:

Machine code is a computer program written in machine language instructions that can be executed directly by a computer's central processing unit. It can consist of either binary or hexadecimal instructions.

How our CPU understands programming language?

Programmers write the source code and the source code gets converted into machine code by specialised programs called compiler or interpreter. I shall not discuss here the difference between compilers and interpreters as this is a topic for another day.

Source code gets converted into machine code and then gets executed.

The Rules for programming languages:

Different programming languages have different syntax, but the basics of them are the same. You can begin your programming journey with any programming language. And after you switch to other programming languages, you will observe that most of the languages are similar to each other.

1. Whitespace:

The text other than the visible text is known a whitespace. You create a whitespace using 'Space Bar', 'Tab' and 'Enter' keys on your keyboard. Most of the programming languages, nowadays, ignores whitespace. Though programming languages do not care about whitespaces, we should make proper use of whitespace so that our code remains neat and can be easily understandable by ourselves. Examples: C, C++, Visual Basic, Java, JavaScript, Swift, etc.

But there is an exception, for example, in the programming language Python, indentation is syntactically significant.

2. Case Sensitivity:

Most of the modern programming languages are case sensitive. Case sensitive means that the language expects a particular word to be exactly the same. For example, in JavaScript, if you type 'True' instead of 'true', the interpreter will throw an error as it expects 'true' not 'True'. Examples: C, C++, Java, C#, Verilog, Ruby and XML.

But, some older programming languages are in-case sensitive. That means that 'True' or 'true' or 'TRUE' means the same for those languages. Examples of such languages are BASIC, Fortran, SQL, Pascal, Ada, etc.

3. Statement Syntax:

A complete line of instruction that can perform a complete function is called a statement. In most programming languages, statements should be on separate lines only, while other programming languages require statements to be on separate lines and should end with a symbol (most commonly the 'semi-colon'). So, it depends on the programming language how the statement should be in a source code. The best practice is to start a statement in a new line and make indentations to make the code more readable and understandable for you.

4. Keywords:

The words used in a source code that has a specific function already defined by the programming language itself are called keywords. They are the reserved words in a programming language. Every other programming language has different keywords for different operations. But, some of them are same across languages. The very good examples are the 'if' keyword and the 'class' keyword.

Now, its time for the big question. 

Are all Programming languages the same?

All Programming languages are basically the same. For creating variables, data types, operators, constants, conditionals and loops, most of the programming language follow the same path. If you have learnt one programming, then it's easy for you to adopt other programming languages much quicker than the first one. There is a Documentation for each programming language which can help you to understand the language more efficiently.

Conclusion:

1. A number of individual instructions can create a full-fledged computer program.
2. You do not require a special kind of software or application to write source code.
3. You do not have to write in Machine Code, for which programming languages are made.
4. All programming languages are basically the same!

Comments


  1. This is excellent information for me. I hope you will share some more information about basics of programming. Please keep sharing!

    Web Application Development

    ReplyDelete
  2. This post is really great and pretty well maintained, thanks for it and keep updating.

    white label website builder

    ReplyDelete
  3. This Elementor Pro Disc Jockey Website ( https://www.templatemonster.com/category/dj-templates/ ) is a great template site built with the Stylish, Lightning Fast, Easily Customizable, Pro Astra Theme. It is easily customizable for any individual entrepreneur’s website.

    ReplyDelete

Post a Comment

Popular posts from this blog

Creating a Web Browser With Integrated Chromium using C#

Final Output Introduction: In this post, we shall start a project to build a C# application integrated with Chromium in Visual Studio. I shall be using Visual Studio Express For Windows Desktop 2013. But the minimum requirements are mentioned below. We shall create a Windows Forms C# project from scratch and integrate Chromium Embedded Framework (CEF) in our application, basic navigation options and much more. Minimum Requirements and Prerequisites: Visual Studio 2012 or Higher that supports NuGet Package Manager. A decent internet connection. Basic Knowledge of C#. Knowlege in using Windows efficiently. Creating A Visual Studio Project: First, create a Visual Studio C# Project through File > New Project > Installed > Visual C# > Windows > Windows Forms . Name the file whatever you want, for example ' Web Browser '. New Project Customising the Form: Now customize the main form by changing its  Properties  like Text to 'Web...

How to start programming with JavaScript? Get Started with JavaScript!

Introduction: JavaScript is of-course a programming language. It can be called the 'programming language of the web' as it is one of the core three technologies for Web Development (other than HTML and CSS ). Before you start programming with JavaScript, you have to know what JavaScript is. See also: Basics of Programming Languages and Introduction to Front End Development . Requirements for this blog post: Minimum knowledge of programming terms: Intermediate . Minimum knowledge of JavaScript: None/Beginner . Some JavaScript Characteristics: JavaScript is a high-level , interpreted , dynamic and weakly-typed programming language. It is an object-oriented language like many high-level programming languages. It is a functional language , here function is considered to be an object. The term Vanilla JavaScipt is often used to refer JavaScript with any external frameworks or libraries. Best Free Resources to get started with JavaScript: After searchi...

Complete Guide to install Firebase CLI (Command Line Interface)

Source: firebase.google.com Introduction: Firebase is a mobile and web application development platform developed by Firebase, Inc. in 2011, then acquired by Google in 2014. It is one of the most popular platforms nowadays for developing Android applications. It is quite easy to, use with documentation for reference included on its website along with examples.  Firebase requires a browser to interact with. But, for advanced application development, it has a Command Line Interface (CLI) called Firebase CLI. It can be installed on your system, and then have to be used with your system's command line tool, such as Command Prompt in Windows, and Terminal in Linux and Mac. Installing in Windows: To install Firebase CLI, just follow the steps below: You must have installed Node.js and npm on your Windows system. To install refer the video below: Then type the following in your Command Prompt to install Firebase CLI: npm install -g firebase-tools That is it. You a...