Venturing into the world of programming might seem like a Herculean task, especially when faced with the initial decision: Where to begin? This article will guide you through the essential steps to set up your programming environment, ensuring a solid foundation for your coding journey.
Choosing a programming language is the first and perhaps the most crucial step in the learning process. Several factors to consider when selecting a language include:
While there are many valuable and potent languages, for the purpose of this course, we’ve chosen Python. This language is renowned for its simplicity and readability, making it ideal for those just starting out. Moreover, Python boasts an active community and a wide range of applications, from web development to artificial intelligence1.
.exe
file.1python --version
.pkg
file.1python3 --version
1sudo apt update
1sudo apt install python3
1python3 --version
An IDE is a tool that streamlines application development by combining commonly-used functionalities into a single software package: code editor, compiler, debugger, and more. Choosing the right IDE can make the programming process more fluid and efficient.
When evaluating IDEs, consider:
For this course, we’ve selected Visual Studio Code (VS Code). It’s a popular IDE that’s free and open-source. It’s known for its straightforward interface, a vast array of plugins, and its capability to handle multiple programming languages2. Its active community ensures regular updates and a plethora of learning resources.
.exe
file..zip
file..app
to the Applications
folder, making it available in the Launchpad.1sudo apt update
2sudo apt install software-properties-common apt-transport-https wget
1wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
1sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
1sudo apt update
2sudo apt install code
code
or find it in your list of installed applications.Once you’ve set up your programming environment, it’s time to dive into coding.
This is arguably the most iconic program for beginners. It’s simple, but it introduces you to the process of writing and executing code.
1print("Hello, World!")
Running the Hello World program
This program is a tad more intricate. It doesn’t just print out a message; it also performs mathematical calculations.
1# User input
2side1 = float(input("Enter the length of the first side: "))
3side2 = float(input("Enter the length of the second side: "))
4side3 = float(input("Enter the length of the third side: "))
5
6# Perimeter calculation
7perimeter = side1 + side2 + side3
8
9# Area calculation using Heron's formula
10s = perimeter / 2
11area = (s*(s-side1)*(s-side2)*(s-side3)) ** 0.5
12
13print(f"The triangle's perimeter is: {perimeter}")
14print(f"The triangle's area is: {area:.2f}")
Running the Triangle program
Setting up a programming environment might appear daunting at first, but with the right tools and resources, it becomes a manageable and rewarding task. We hope this article provided you with a solid foundation to kickstart your programming journey. Happy coding!
Cheers for making it this far! I hope this journey through the programming universe has been as fascinating for you as it was for me to write down.
We’re keen to hear your thoughts, so don’t be shy – drop your comments, suggestions, and those bright ideas you’re bound to have.
Also, to delve deeper than these lines, take a stroll through the practical examples we’ve cooked up for you. You’ll find all the code and projects in our GitHub repository learn-software-engineering/examples-programming.
Thanks for being part of this learning community. Keep coding and exploring new territories in this captivating world of software!