Skip to main content

Release 0.1

The past few weeks I have been looking at the differences between declaring variables for JavaScript.

Var, Const, Let are the variable declarations that are widely used, each one having a specific purpose. New developers mostly use 'var,' as it is the first technique taught.

However, 'var' declarations is no longer widely used by JavaScript developers. The modern practice of variable declarations is with 'const' and 'let'.

Before starting anything, I had to first understand the difference between the three:
  • Const declarations means the values cannot be changed/reassigned. 
  • Let declarations should be used when declaring local variables in a block scope. 
  • Var declarations hold the weakest signal which can be used outside of a block, and can be reassigned.
For Release 0.1, we were asked to look into a library called 'filer.js.' The task was to go through one of the test files, and change the old-fashioned 'var' declarations to the modern 'const/let' declarations. The task was to fork the GitHub library and create a new branch to make changes to. After that, we were required to create a pull request to make the changes to the 'filer.js' master branch

My Issue: https://github.com/filerjs/filer/issues/728
My Pull-Request: https://github.com/filerjs/filer/pull/730

The file I explored was 'filer/tests/spec/fs.shell.spec.js.' The file contained only 'var' declarations, and needed to be updated to the modern format of 'const/let.' The first step I took was to fork the library to my own GitHub account. After that, I opened Terminal and pulled the repository to my local machine. I created a new branch in the new forked repository, and was ready to make changes. Through Visual Studio Code, I edited the 'fs.shell.spec' file and added it to the git files ready to be pushed. After pushing the files to the repository, I created a pull request to the original filer.js library.

Upon completing my own task, I went into all of the pull requests made by my peers. Most of my peers correctly changed the variable declarations, but I found one that had some issues.

Reviewed Pull-Request: https://github.com/filerjs/filer/pull/729

This pull request declared all of the variables with 'let' which according to the articles I read, was wrong. The variables should have all used 'const,' as the variables did not change values. Some examples of the code:


Upon finding these errors, I commented a message to let my peer know to change it.



Other peers have already been reviewed, and this issue was the only one left that had errors.



Comments

Popular posts from this blog

Git Commands

There are many commands on git that new developers do not know of. These commands can make working in open source projects, or group projects easier to understand. Of all these commands, I will be going through two that most new developers do not know of. Log While working in large groups, there are many commits that you or others may have done within a repository. Using 'log,' you can view the history of all the changes made. Basic command:    git log  With this basic command, you can view the commit id , author of the commit, date of the revision, and the details the user wrote.     git log --follow filename    This command allows you to follow the commit history of a single file. It is useful for working in big groups as you can follow a file that you contributed to, instead of viewing the whole repository. Simply replace ' filename ' with the directory of the file you want to view.   git log - number    git log...

Lab 3: Potential Projects

In this lab, I will be going through three potential open source projects I would like to contribute to. 1: iD Repository : https://github.com/openstreetmap/iD iD is an easy to use OpenStreetMap editor, which uses Javascript. It supports all of the current modern browsers, and the intention is to do the basic tasks without breaking other people's data. I chose this open source project, as I was always interested in figuring out how to play around with Maps. I am going to go through the issues to see if there is anything I am capable enough to fix, or find issues on my own when going through the code. What I would need to learn is Javascript, how to support all browsers, and how to properly contribute worthwhile issues to the project. 2. Teammates Repository : https://github.com/TEAMMATES/teammates Teammates is a cloud-based open source project that provides users to manage peer evaluations and other feedback for students. It is used by both the educator and the stud...

Release 0.3 Update

For this release, I am working on an issue for an RPG game that uses JavaScript React. This project requires a global tracking of all of the stats, such as monster kills (by monster type), player death count, and high-score tracker. I will be working to implement these features into the project. Issue:  https://github.com/ASteinheiser/react-rpg.com/issues/14