DEV Community

Tuan Thanh Tan
Tuan Thanh Tan

Posted on

Process of reviewing my friend's code in Nodejs


Hi everyone, I'm a Computer Science student at Seneca College, this is the 2nd week of open source programming course, we have an assignment about reviewing my colleague's code which is about static site generator.To be honest, this lab is quite realistic mainly because all programmers have to not only write their own codes but review and read other people's code as well. So I found it quite interesting when being matched with Ritik Bheda (a very brilliant Indian guy), who's been working for CGI Toronto 8 months as he said, which means he has a lot of experience. Lucky us, we all used Node to do this assignment.

Me reviewing his code

At the beginning, I had no trouble reading his code because he's done it pretty clean and understandable. But everyone makes mistakes right, he also did :) He had a few typos in his code that could have been tracked by an extension in Visual Studio if he had used it (Code Spell Tracker) but that's no big deal at all Issue on github can be found here. After a few hours reading, I found another thing that could have been improved which is the program version. I read it online saying that the program version can be pulled off of the package.json so we don't need to hard code the program version everywhere Issue on github can be found here. The third problem that I found is quite important and it can lead to severe errors as he forgot to handle cases when users type in invalid files or folders Issue on github can be found here. Other than those small bugs, I couldn't find any other bugs as he did it very well.

Me fixing my issues that he filed

I had no doubt that he would definitely find bugs and errors in my program, and here he goes. The first time he tried to display my program version, it failed LOL. That was my big mistake because I moved all the files into BIN folder but I completely forgot to change relative links in those folders. The other 2 bugs (Not really bugs) that he found out were the options thing. Thanks to his recommendation, I used commander library to fix those 2 issues and it now works perfectly fine.

Wrap up

As we discussed, this is just the very first version of our programs, so it still has problems and edge cases that we have not thought of. But as time goes on, we will get better as well as our program. I'm very happy to work with you in this assignment. Although this is just a very small project that we had together
but I learnt a lot from him like how he handle and simplify different kinds of things.


Top comments (2)

ritikbheda profile image
Ritik Bheda

Hi Tuan, I thank you for finding bugs in my code and helping me improve my Static-Site-Generator! You did an amazing work on the release 0.1! I feel lucky to work with you on this lab. Lets work on more academic/non-academic projects together.

tuanthanh2067 profile image
Tuan Thanh Tan

Yesssss of course, it's my pleasure to work with you too. Keep it up!