DEV Community

Alex Romanova
Alex Romanova

Posted on

Merging isn't bad

I'll be honest - I looked at lab 3 the day before the due date. I didn't realize it actually existed. Forgot. Anyways, today I expected a lot of struggles and there were none. I'm not sure if I was very lucky, or it wasn't supposed to be hard.

I decided to add 3 out of 4 features, since all 3 I knew exactly how to implement. Besides, the more you do - the more experience you get.

Language support

...was probably the most complex one, however it used the same tools I already implemented before. Adding more options for parameters, catching that extra parameter, adding it to the actual generated page.. that's it. Wasn't tough at all. And that was the toughest of the three!

Exit codes

It's literally one line. I looked for a place where my program gets to if it runs properly and put exit(0) there.

Now, why is it just this line? Well, you see, I have just worked on another feature, or, rather... issue. Before this I tried to fix it along with two other ones: default paths, callbacks. I took on too many tasks and when in the end nothing worked - my code became too spaghetti to really understand where my problem was. I had to delete the branch and start over from master. That's how I learned to instead tackle one problem at a time.

So I tried again. This time only caring about error handling and general structure improvements. I'm not sure if I did it right. I added a shit ton of try{}catch with custom messages. Idk if I overdid them. It makes my code much less readable for me, maybe I'm just not used to it. I also placed my functions in order of their calls. So you can follow the program easier... Hopefully. Here's the result.

After fixing that issue where I already added exit codes (-1) to try{}catch blocks, the only one left to add was exit(0).

hr support

My partner for lab 2 used a different approach to handle .md files. So any code in that area has a different style. I decided to follow that same style, since I learned to tackle things one by one. I might get back to this and re-structure it for my taste, however it's not even required. It would be just for the sake of style continuity. Technically, it's just one line again, however I decided to change my hr css, since you couldn't see the default one.

One place where I actually messed up - I created issue branches from another branch, instead of master. So I had to delete them and re-create again.

No conflicts??

I think this lab was supposed to show me how to resolve merge conflicts. However, I never got any. It auto merged just fine. I have dealt with some conflicts in lab 2 I think.. So I somewhat know what to do. I think it auto merged well becacuse I already did my error handling and structure improvements before starting those other issues.
Here are those 3 successful merges:

Look at how nice they slid in my master. Oh yeah.

Top comments (0)