- Get link
- X
- Other Apps
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.
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!
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.
Thus, you can conclude that you do not require a special kind of software or application to write source code.
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!
ReplyDeleteThis is excellent information for me. I hope you will share some more information about basics of programming. Please keep sharing!
Web Application Development
Hope, you liked it! Thanks
DeleteThis post is really great and pretty well maintained, thanks for it and keep updating.
ReplyDeletewhite label website builder
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