DEV Community

Kien Nguyen Chi
Kien Nguyen Chi

Posted on • Updated on

OSD600 - Week 3 - Lab 2

This week, I have an interesting lab based on project I did last week, which is a program converting .txt files to .html files. I need to review and change my partner code in order to implement a feature that supports converting .md files to .html files. Same as last week, I worked with Thanh Van.

It was hard for me at first because I work in C++ environment and my partner works in JS environment. It takes me some time to understand how his code works and how I would be going to write code in JS language. I made a small change in his structure. If the files go in is a markdown file, it will go into a separate function to handle. Also, I have a small function using expression to convert all heading 1 in the file to h1 tag in html. At first, I imported library 'marked' and use it to convert. My partner said I need to change in order to implement 1 feature for this lab only. So I went back, changed the code, cleaned it up and requested for the second pull requests.

You can take a look at the following tasks I have done on my partner's project:

In contrast, Thanh also had hard time to figure out how to write code C++. He also wanted to add a heading 1 feature to my program as well as accepting Markdown input files. I refused his first pull request because he misunderstood how each variable in my program works. We had a call for an hour to discuss how the program works. It was interesting for both of us to talk to each other nicely. I reviewed his code carefully and he did a great job on the second pull request. You can take a look at the following task he has done on my repo:

Overall, it is interesting to go over and change the code that I haven't write it from scratch. This is a difficulty to me at first and also an experience to me. Also, it is amazing that someone can be able to change my code and make it works.

Discussion (0)