In this lab, we'll be taking our first steps towards becoming software engineers by creating a simple "Hello World" program. While the syntax we'll use in this lab is specific to Python, the concepts we'll learn form the foundations for programming in any language. If you find any part of this lab confusing, don't worry, that's completely normal. The best way to overcome confusion is to keep practicing and asking for help when needed. Your teacher, peers, and even the AI tutor are here to help you along the way. Let's get started!
GitHub is a web-based platform that facilitates version control and collaboration for software projects. It allows multiple people to work on projects at once, enabling them to branch off the main project, make changes, and then merge those changes back into the main body of code. GitHub is based on Git, a distributed version control system. It now has over 100 million developers using it.
Collaboration: Students can work together on a project, seeing real-time updates and changes.
Version Control: Helps in tracking changes and reverting to previous versions of code, which can be particularly useful for debugging and understanding the evolution of a project.
Learning from Others: GitHub is not just for private projects; it hosts countless public repositories. Students can review others' code to learn new techniques and best practices.
Portfolio Building: Over time, the repositories can serve as a portfolio, demonstrating a student's coding skills to future employers or educational institutions.
To help distribute and collect assignment I'll often use GitHub Classroom. This will set up repositories for you and automatically give me access so that I can look at and give you feedback on your work.
Ensure you have a GitHub account and that you are signed in
Join the GitHub Classroom and accept the assignment: Software Engineering Projects
Clone the repository to your computer using GitHub Desktop or open it online using Codespaces
Visual Studio Code (VS Code) is a program that lets you write, edit, and run code for many different programming languages, including Python. It's free to use and can be downloaded from the internet.
One of the great things about VS Code is its flexibility. It can be customized to suit your needs using extensions. Extensions are like add-ons that you can install to make VS Code do more things. For example, there are extensions that add support for different languages, that make it easier to format your code, or that integrate with other tools like GitHub.
Some of the other features of VS Code that make it popular among developers include:
Syntax highlighting: This means that VS Code will color-code different parts of your code to make it easier to read and understand.
Code completion: VS Code can suggest how to complete your code based on what you've typed, which can save you time and help prevent errors.
Debugging: If you have a problem with your code, VS Code can help you find and fix it using a feature called debugging.
Source control integration: This means that you can use VS Code to work with version control systems like Git, which can help you keep track of changes to your code over time.
We can also use the online version of VS Code by clicking "Open in GitHub Codespaces"
Install VS Code if necessary, along with the Python extension
Open the project with VS Code, this can be done directly from GitHub Desktop (or online using Codespaces)
Open lab1.py
Python is a programming language that's both easy for beginners and powerful for experts. You can use it for lots of different things like making websites, games, or even doing advanced stuff like machine learning.
No Need to Compile: You can run your code as soon as you write it, making it quick and easy to test things out.
Simple Syntax: Python's language rules are straightforward, so it's easy to read and write code.
Not Just for Beginners: Even though it's simple, professionals use Python for complex tasks, too.
Huge Library: Python has lots of pre-made modules that make complicated jobs easier. You can do a lot with just a few lines of code.
The following video is from Harvard University's "CS50P - Introduction to Programming with Python". You are doing the same beginner lesson as Harvard University students!
After watching the video above, write your own "Hello, world!" program
Press Ctrl + F5 to run the program or open a terminal and type python lab1.py
You should see "Hello, world!" in the terminal
Whenever you finish your work for the day, or complete a milestone you should commit and push your work.
A "commit" is like taking a snapshot of your code at a particular point in time. When you commit, you are saving the current state of your code to your local repository. This allows you to keep track of changes and revert to earlier versions if needed.
After committing your changes locally, you'll want to "push" them to a remote repository, like GitHub, so that others can see and collaborate on your code. Pushing uploads your committed changes to a remote repository in the cloud.
Close VS Code and go back to GitHub Desktop, or use the Source Control tab in VS Code
Enter a commit message. E.g. "Lab 1 complete"
Press Commit to main
Press Push origin
Your work is safely backed up to the remote repository at GitHub where I can also see it. You have also hopefully learned a little about VS Code and Python. The lessons learned in this lab will be used consistently throughout this course.