Develop Url Checker Open Source Named Url-fi

This is a post to document my journey to create an URL checker command-line tool. There are various languages I can use to create this tool such as NodeJS, Go, and Java. I chose NodeJS as a language and worked on creating it under Unix. I created a GitHub public repository to push my codes so other people can review or test my tool.

When I completed my tool, I asked to review and test my code on Slack. Mr. David Humphrey and Mr. Calvin Ho gave me some directions to improve my code. The following are the things they ask me to change

  • Change all var variable type to let variable type. Also, if the value is not going to change, use const variable type
  • Move the regex (data type: const) to the top
  • If I need to check error with other conditions, check error early and then check others
  • The async function is not needed
  • I don't need to cover 'finding the error and exit the process' code into if statement because if I exit the process, it's already done

It was really interesting to discuss the things I can improve. Some of the things such as changing the variable type and moving the regex to the top are the ones I already know. However, I did not catch them when I wrote my code. Some other things are the ones I did not think while I'm writing the code. I realize I can learn much more if I show my code to other people and ask them to review it.


After I got checked my code to them (Mr. David Humphrey and Mr. Calvin Ho), Kimin Lee who met on Slack suggested reviewing each other's code and file issues into our repository. As we used the same language (NodeJS) to create the tool, it seemed goot to work together. I looked over Kimin's project (https://github.com/klee214/findBreakURL) and Kimin looked over my project (https://github.com/hyunjiLeeTech/URL-FI). When I looked over his project, it was impressed that people can write different codes using the same language. He and I used different modules. Also, the way of his coding and the way of my coding was different.


These are the issues I filed to his project

  1. Spelling and content on README (https://github.com/klee214/findBreakURL/issues/1): There is one spelling mistake. He wrote 'description' to 'describtion'. Also, The tool should handle all types of files not only HTML files. However, he only mentioned HTML files on README
  2. Regex issue (https://github.com/klee214/findBreakURL/issues/2): He wrote the constant type of regex pattern in the middle of the file. I request him to move it to the top
  3. Types of files to be handled (https://github.com/klee214/findBreakURL/issues/3): The tool should handle all types of files but it only handles HTML file. I ask him to fix it to get all types of files


These are the issues Kimin filed to my project

  1. Linux common command-line options (https://github.com/hyunjiLeeTech/URL-FI/issues/1): The way I get the version argument was --v or --version. Kimin said --version is for Window but -v is for Linux so -v is more appropriate for my tool. I accepted this
  2. Error: getaddrinfo ENOTFOUND (https://github.com/hyunjiLeeTech/URL-FI/issues/2): As I make the process throw the error when the program creates an error, this tool does not check other links once it has an error. I decided to print out the error not throw the error
  3. Possible skipping the link issue (https://github.com/hyunjiLeeTech/URL-FI/issues/3): He said there's one case my tool skip the link. However, it does not happen to me and another person I asked to test. I decided to close this issue for now.

It was amazing how others can discover the things I missed. I've learned a lot from others and I get confident my knowledge can be helped to their project. I had lots of fun fixing all issues.

Comments

Popular posts from this blog

Lab 8: Automated Testing and Continuous Integration

Open Source Project: Lab2 (Pull Request)

Release 0.3: External Project (Hasura GraphQL Engine)