Lets Create a Programming Environment
Table of Contents
In this article, we will talk about topics below.
Source:dribbble by Syed Zaquan
What is programming environment
Actually computer can only understand low-level instructions consisting of zeros and ones. It is impossible for humans to always remember every low-level instruction to instruct computer to do something. To design some computer programs which will instruct computer to complete some tasks humans ultimately have to utilize their familiar languages or convenient tools. These familiar languages are today’s advanced programming languages like Python
, Java
, etc. These convenient tools include IDE(Intergrated Development Environment) software.
What you need to build a programming environment
To build a programming environment, we have to prepare things below.
- A computer with network
- Decide which language to use
- Decide which IDE to use
A computer with an Internet connection is necessary.
All programming languages ultimately have to be executed on the computer, actually computing by CPU (The brain of computer) aided by memory and hard disk, etc. Internet connection will also be nesessary because we have to get some resources like programming language runtime and0 IDE software.
We will write Python code
Python is an advanced programming language. It is developed by Guido van Rossum (1956-) in the late 1980s.
Python’s design philosophy emphasizes code readability and clean syntax, it uses indentation to divide blocks of code so the code can be more readable. Comparing with C language or Java, Python allows developers to express ideas in less code.
Python is very popular nowadays, as it is used in all kinds of high technology fields such as AI(Artificial intelligence), big data and data analytics. Python is a hot topic and Python technicians are in high demand. Python has a very clear future.
We will use Visual Studio Code to write code
Visual Studio Code(VS Code for short) is free, open source, cross-platform IDE(Integrated Development Environment) developed by Microsoft.
- Completely free and open source, stable and has frequent update
- Cross-platform editor, to meet the daily use in different systems
- Less system resources, fast lauching speed of large files
- Massive extensions, highly scalable
- Huge amount of users and active community, easy to find solutions to problems
VS Code has been gaining market share and is becoming a must-have in the programmers' arsenal.
So let’s get started
Firstly let’s download and install Python
We will use windows platform to start our programming journey. Of course, other platforms will also be ok although slightly different.
Firstly, open a browser, such as Chrome, open the below link.
https://www.python.org/downloads/
Click the button to download the latest version (3.10.1 when writing this article), then execute the exe file.
Considering that some Windows users do not have administrative privileges, do not check the first selection. To use Python from anywhere, check the second option. Then click Install Now.
Then wait for the installation to complete.
At the end, a successful installation screen will be displayed.
To verify that our installation was successful and that we can use the powerful Python from now on, we can open the CMD (command prompt window) to verify it.
First we press the Windows key. Then type CMD
and a search result will pop up , and cmd software will show in results. Then click on it, and a black command line window will pop up.
Enter the following command in the command window. If the Python version number is displayed, it means we have successfully installed Python.
python -V
Let’s download and install VS Code
Again, we need to go to the official website to download VS Code. https://code.visualstudio.com/download
Execute the downloaded exe file. Select I agree, then click Next.
The next step is to choose location to install VS Code, the default is fine, and then click Next.
The menu folder is also the default, click Next.
For convenience, check all the options and next.
Then click Install.
Wait for the installation to complete.
Once the installation finished, check Run and click Finish.
VS Code will be lauched and the window below will show.
Say hello to the world
Now that we have Python and the VS Code editor, let’s try them out to see if they work well.
Now create a new say-hello folder in a place you like.
Then open VS Code, click the file explorer icon at the top of the left sidebar, then click the Open Folder button and select the say-hello folder created above.
Check the Trust option and click Yes, I Trust the authors …. button.
Click the New File icon, create say-hello.py file.
For the first time Python Extension Installation will pop up in the bottom right corner and click the Install. This will install Python extensions for VS Code, it will support syntax highlighting (to make it easier to read the program code), running application, etc.
Once the installation finished, select the Python interpreter we installed. It will translate python code to 0 and 1 code that the computer can understand.
Type the following code in the say-hello.py file, you should not to input any other blank characters such as spaces or TABs in front of print. This is because whitespace is meaningful in Python programs. It is used to control the program structure and hierarchy. After editing, you have to press Ctrl+s to save it. There will be a small dot on the filename tab if you haven’t save the file.
print("Hello, programming world!")
After saving the file, make sure the lower left corner is the Python version we selected, and the error and exclamation marks on the right of python version represent errors and warnings, both are 0 representing no errors and warnings. Then click the triangle (Execute Program) in the upper right corner, and the following TERMINAL window will pop up. Here my computer’s Command Shell is by default windows' PowerShell, so it starts with PS in the beginning. As you can see. Our first Python program is executed successfully.
Conclusion
In this article we introduced what programming environment is, why we need to build it, and what hardware and software conditions are needed to build the environment. Then we went step by step through the installation of Python and VS Code, the basic environment used to write Python programs. Finally, we used the environment we built to say hello to the world for the first time, “Hello, programming world!”.