You are on page 1of 18

Chapter 4 – Setting Up My Environment

"The environment is everything that isn't me." -Albert Einstein.

After undergoing the trouble of listing what needs to be done and visualizing the flow of your
solution, what is next to do? It is to implement them as designed. To do that, you will need an
environment to do so. Environments are essential to accomplish things. Human have Earth to
live in. Programs have the Computer to run into. But how about the source codes? We store
them into individual files.

This is the main coverage of this module. To setup your working environment and to familiarize
with it.

At the end of this module, you will be able to:

1. Identify the latest tools used to develop C++ programs


2. Identify the steps needed to install and configure your working environment
3. Identify the parts of the Visual Studio Code
4. Argue the importance of having version controls

Again, researching beyond the coverage of this module is highly encouraged to supplement
your understanding of the topics covered. And as always, think and see beyond the box.

What are we waiting for? Let us continue our exploration of the world of Computer
Programming.

Recall

In the previous module, we continued our discussion of flowcharts and pseudocodes. We


augmented our understanding of flowcharts through solving problems and writing technical
work items. We enumerated the characteristics of Technical Work Items, namely:
a] Concise
b] Unambiguous
c] Classifiable as either INPUT, PROCESS or OUTPUT
d] Specific
Lastly, we worked on sample problems, interpreted them, wrote Technical Work Items,
drafted flowcharts and composed pseudocodes.

Introduction

Working Environment is essential to organize, categorize, control and ensure efficiency and
productivity of accomplishing tasks. These tasks include but is not limited to our software
development activities and configurations. This provides ways for us to be able to conduct
our development activities away from other activities such as Office Productivity, Business
Intelligence and Entertainment. In addition, having our working environment ensures us
that the tools and development files that we will use are organized in two separate
directories, a utility-centric root directory and a projects directory.

Tools of the Trade

When we talk about environments, we deal with all that is needed for software
development. We are not limited to IDEs only. We also include the operating system where
we will be storing our files. We also include the compilers that will eventually compile our
source codes. And much more. Let us do this!

Operating System

One of the main thing we consider when undergoing Software Development is the
operating system. It is here where we develop our software. It is here where we run our
software. It is here where we look for IDEs that we can use to augment our development.
Choosing the best suitable operating system enables us to better forecast the features that
we will place in our software and the various permission requests that we will need.
For this course, we will be using Microsoft Windows as our operating system Majority of users
use Microsoft Windows as their operating system because of its user-friendly interface and
easy navigation. Aside from that, the power that Windows deliver to the user is tremendous.
Majority of configurations are available for the users to exploit and manage. As for the security,
vast access control and file management is available and easy to configure.

You may also try using any distribution of Linux operating system like Ubuntu and Fedora in
writing and compiling your C++ source codes. However, this course will only cover Microsoft
Windows. The setup and installation process may vary, however IDE configuration and setup
will virtually be the same.

Integrated Development Environment

In Software Development, we have the so-called Integrated Development Environment [IDE].


IDEs are fully-integrated software that contains various features dedicated to software
development. They organize source codes and development artifacts. They contain several
shortcuts that enable the developer to compile their source codes without leaving the IDE.
Some examples of IDEs are Eclipse, Visual Studio Enterprise, and Android Studio.
Our choice of IDE for this course is the Visual Studio Code (VSCode) of Microsoft. Visual Studio
Code is the latest iteration of Microsoft Visual Studio series available for free. It is a lightweight
IDE which means it uses minimal storage size and RAM resources. It supports a variety of
programming languages like C++, C#, JavaScript, Python and PHP. This IDE supports syntax
highlighting, intellisense, plugins, and file system organization. Visual Studio Code is available
for Windows, MacOS and Linux.

Compilers

Not only do we need to have an Integrated Development Environment, we also need to enable
our Integrated Development Environment to compile our selected compiled programming
language to executables. In our case, we will need to have a specialized compiler to be able to
compile our C++ source codes. Since C++ is a longstanding programming language, C++ has a
number of compilers. These compilers vary mainly on how they support internal libraries, up-
to-date third-party libraries and code optimization.
Minimalist GNU for Windows, or simply MinGW, is a development utility for Windows. It
presents minimalistic approach in presenting tools and libraries necessary to develop
application for Microsoft Windows. This focuses on Native Microsoft Windows Application
Development, hence any third-party libraries and non-standard utilities are omitted to ensure
that the development process adhere to the standard of Microsoft Windows without needing
to install additional unnecessary dependencies for your application, usually without the
developers' knowledge.

There are a number of development utilities and compiler-centric tools to build and compile
C++ applications. Some Integrated Development Environment have their own compilers built
within the IDE like Visual Studio Express.

Version Control

Now that we have a list of tools that we minimally need to develop our very first C++
application, we need to secure a version control for our files. Version Control is a way to
organize the development files and configurations in a centralized repository. Having version
control for small projects are optional considering the low number of files that are processed,
however this course will make use of version control to allow you to revert and secure copies of
changes that you will commit to the repository, and build your initial reputation in the Open
Source Community.
We will be using the Open Source Community's most famous and most used online version
control repository since 2016, the Github. Github is a free and public web-based repository that
allows distributed version control and source control management tool that uses extended Git
functionalities. The repositories for Github are public for free users which we will exploit for this
course.

Microsoft has its own version control repository for Open Source projects called CodePlex
which tried to be in par with Github. CodePlex was made to allow developers in the Open
Source Community to publicly share software.

Installing, Setting and Configuring Our Work Environment

In this section, we will install, setup and configure the tools that we will use for the
development. Let us get started!

Creating a GitHub Account


We will start with creating our very first Github account If you already have an existing account,
you may use that account and skip to the next subsection.
1. Visit the GitHub, Inc. website through the link https://github.com/.
2. Click the "Sign up" link on the upper right corner of the page.
3. For Step 1:
a. Enter your preferred username, valid and active email address, and
password.
b. Click "Create an account" button.
4. For Step 2:
a. Select "Unlimited public repositories for free".
b. Leave the "Help me set up an organization next" checkbox unticked.
c. Click "Continue" button.
5. For Step 3:
a. Select the most appropriate options you desire. This course will not limit you on
how you will use your GitHub account in the future.
b. Click "Submit" button.
6. You are now ready to create your first GitHub project.
Now that we have our GitHub account, we need to create a repository for this week's
configurations. The initial steps might differ depending if you already have created repositories
in the past, or if this will be your very first GitHub repository.
1. To create an initial repository:
a. If you do not have yet any repository,
i. Click “Start a project” button.
b. If you already have an existing repository(-ies),
i. Click "New repository" button.
2. Enter "AMAOEd-CompProgl-Week004" (without spaces) in the "Repository name" textbox.
3. Enter "My very first C++ application." in the "Description (optional)" textbox.
4. Make sure the "Public" checkbox is ticked.
5. Tick the "Initialize this repository with a README" checkbox.
6. Set the Gitlgnore template:
a. Click the "Add .gitignore: None" button.
b. Enter "C++" in the "Filter ignores" textbox.
c. Click "C++" in the typeahead.
d. Verify that the button changes to "Add .gitignore: C++".
7. Set the License template:
a. Click the "Add a license: None" button.
b. Enter "GNU General Public License v3.0" in the "Filter licenses" textbox.
c. Click "GNU General Public License v3.0" in the typeahead.
d. Verify that the button changes to "Add a license: GNU General Public License
v3.0".
8. Verify that the fields are correct and accurate.
9. Click "Create repository" button.
10. You now have created your Github repository for this week's activity.
Week 4 Hello World
Build and run our application.

1. Click the "Debug (CTRL+SHIFT+D)" icon.


2. Click the "Start Debugging" button with a green play icon.

A command prompt-like window will appear. This command prompt-like window is called
console. For the rest of the modules, we will work with console applications to build your
fundamentals in computer programming.

Notice that in the console, the words "Hello World" are displayed.

You have successfully created your very first application using C++!

Glossary

Integrated Development Environment (IDE): A fully-integrated software that contains various


features dedicated to software development.
Compilers: A programming language-specific lightweight application that translates source
codes to executables.

Source Code: A file containing human-readable program codes.

Development Artifacts: Files of varying purposes that are used for Software Development.
Compiled Programming Languages: Programming languages that needs a third-party software
to translate source codes to executables.
Executables: Runnable application. Computer-readable file that performs a specific set of read-
only instructions.
Native Microsoft Windows Application [Development]: A development paradigm for Windows
wherein the entire process depends solely on the built-in libraries and utilities of Windows to
develop Microsoft Applications.
Utility-Centric [Root] Directory: A directory located in the root directory of the current
operating system that will contain all utilities and tools to be used for the development process.
Projects Directory: A directory located in the users Documents directory that will contain all
projects for the development process.
Commit: Upload a file to a repository that serves as a final agreement that the changes to be
saved is final.

Repository: A virtual online directory where source codes, configurations and documentations
are stored that typically allows defined users to review and download the contents.

You might also like