Development Tools¶
Introduction¶
This tutorial describes some development tools beyond Jupyter Notebooks that you can use in complex projects. These tools are not required for the course, but they can be useful for more advanced projects, so take this unit as an encouragement to continue learning and exploring computer science, knowing that the best way of learning programming is by programming.
In general, the main tools that you will be using when working on a development program are:
Software Project Management Tools: Tools that facilitate the adoption of agile development methodologies. Agile development has become almost a de-facto standard for software development, and consequently, the use of software tools that help software project managers manage software releases is becoming increasingly important. Github and Gitlab provide some basic tools off-the-shelf.
Integrated Development Environment (IDE): A software application that provides comprehensive tools to facilitate computer development. An IDE normally consists of a source code editor, build automation tools and a debugger. Most modern IDEs have intelligent code completion, and even smart coding assistance based on Artificial Intelligence. IDEs increase programmer productivity providing code syntax highlights to spot errors, auto-complete features to speed up coding, error detection, and many more. Some prominent examples are Visual Studio and Pycharm.
Continuous Integration and Continuous Delivery (CI/CD): Also known as continuous deployment, is a software development practice where developers regularly merge their code changes into a central repository, after which automated builds and tests are run. This is done to ensure that the code can be integrated into a shared codebase at any time. CI/CD is a key component of agile software development, and it is often used in conjunction with agile project management tools. CI/CD is a key component of agile software development, and it is often used in conjunction with agile project management tools. Jenkins is a popular open source CI/CD tool, but again, Github and Gitlab have their own CI/CD tools.
Git¶
As mentioned above, Git is a free and open source Open source distributed Source Code Management (SCM) system, a software for managing and tracking software development projects developed by Linus Torvalds. If you are not familiar with Linus, he is the creator of the Linux operating system.
As with most other distributed version control systems, and unlike most client–server systems, every Git directory on every computer is a full-fledged repository with complete history and full version tracking abilities, independent of network access or a central server. Like the Linux kernel, Git is free software distributed under the terms of the GNU General Public License version 2.
Before we dive into details, let us first create a Github account. Go to Github and create an account. You will just need a username, email and password.
☝ Important: If you have an email account from a university, you can get a free Github Student Developer Pack that includes a lot of free software and services!! Use it to create your Github account!!
Git Installation¶
Git is a command line tool, so you will need to install it on your computer. Go to Git and download the version for your operating system. Follow the installation instructions. You can check if Git is installed by opening a terminal and typing git --version. You should see something like this:
$ git --version
git version 2.17.1
☝ You can skip this step if you are going to install an IDE, as most IDEs come with Git support.
Git features¶
Distributed workflows¶
The main difference with other SCM is that every user clones the entire repository, so that there is no central copy subject to failure. Combined with branching and merging, this enables different types of distributed workflows. Check https://git-scm.com/about/distributed for more information.
Branching and merging¶
Git allows you to create branches, which are essentially an independent line of development. The master branch is the “default” branch when you create a repository. Use other branches for development and merge them back to the master branch upon completion. Developers can create different branches to implement or experiment with different features without colliding with each other. Merging one branch into another means adding the changes of the former to the latter. You can learn more about branching and merging in this tutorial.
Git Commands¶
Git is a command line tool, so you will need to use the terminal to interact with it. If you are using Windows, you can use the Windows Subsystem for Linux to run Linux commands on Windows. If you are using Mac, you can use the Terminal application. If you are using Linux, you can use the Terminal application.
Git has a lot of commands, but we will only cover the most important ones. You can find a complete list of Git commands here.
Git clone Create a clone of a repository into a new local directory
Git branch: Create, delete or update branches
Git switch: Switch local directory to another branch
Git commit: Record changes in local directory files into the repository. Commit requires a message describing the changes
Git push: Upload changes to repository
Git pull: Download changes from repository to local directory
IDEs¶
IDEs are a very important tool for software development. They provide a lot of features that can help you to develop your code faster and more efficiently. In this section, we will use as an example, Visual Studio. To install it in your system, just go to the Visual Studio website and download the version that suits your system. Once you have installed it, you can open it and start working with it.
Visual Studio¶
Visual Studio is a powerful IDE that can be used to develop applications for Windows, Linux, Mac, Android, iOS, and the web. It is a very powerful IDE, but it is also very complex. It has a lot of features that can be overwhelming for beginners. In this section, we will only cover the most important features that you will need to start developing your code.
Copilot¶
Copilot is a service provided by Github that uses machine learning to help you write code. It is free for academic use. You can read more about it here. To use it, you will need to install the Github Copilot extension in Visual Studio. Once you have install it, it will ask you to login to Github. Once you have logged in, you can start using it. You can read more about it here.
Clone a repository¶
To clone a repository, you need to open the Source Control tab on the left side of the screen. Then, click on the Clone Repository button. You will then need to enter the url of the repository. You can find the url of the repository by going to the repository page on Github and clicking on the Clone or download button. You will then need to enter the url of the repository. You can find the url of the repository by going to the repository page on Github and clicking on the Clone or download button. You will then need to enter the url of the repository.
Create a file and start coding¶
Ok, now you are ready to create the first file in your repository, for instance, a Jupyter Notebook file. Just click on the Explorer tab on the left side of the screen. Then, right click on the folder where you want to create the file and select New File. You will then need to enter the name of the file. For instance, hello_world.ipynb. Once you have created the file, you can start coding.
Staging and committing changes¶
Once you have found the file you want to edit, just double click on it. You can then start editing the file. Once you have finished editing the file, you will need to stage and commit the changes. To do this, you need to open the Source Control tab on the left side of the screen. Then, click on the + button next to the file you want to stage. You will then need to enter a commit message. Once you have entered the commit message, you can click on the check button to commit the changes.