English
Entering Refactoring

Entering Refactoring

A retrospective and why we use the Stack before diving into refactoring

Reason for recording

After about 7 weeks of short and long projects, I think I've gotten to know React to a certain extent. But unlike I thought, I want to keep this friend nice and neat, but somehow it's like watching a beard that grows messy...

So, I thought, "Let's fix that code!" and I'm going to take this opportunity to try out TypeScript while keeping a record of my simple project.

Why React?

In the previous project I participated in, I had the opportunity to use VueJS, so I had experience writing code based on Vue, but I wasn't experienced enough to compare the pros and cons, and I hadn't even used React before, so I thought, "It's the hottest framework right now, so let's try it!". I think it was an opportunity to realize the advantages of React rather than the disadvantages of Vue.

Ecosystem is wide

I think this is a well-known advantage, both numerically and otherwise, but most of the libraries I used in Vue are also available in React, and I felt that this is the main thing and Vue is a freebie.

Intuitive

I don't know if it's because I haven't used a lot of Hooks yet, but I felt much more comfortable with the way Props are handled and the way I write code.

In the case of UE, I felt like I had to write templates, scripts, and styles like a head, chest, and stomach to make a sense of distinction between the code, but React basically writes the Function Component in a way that does not distinguish it from the JavaScript code, so I felt much more convenient in accessing variables, etc.

Of course, if you separate them like Vue, it might be easier to read the code, but from a writing perspective, there was a clear difference, and even now, if I were to ask, "What should I use?" I would use React.

Event handling was convenient

This is somewhat shared with the above, but I remember that writing EventHandlers was much more intuitive than when I was using Vue. In the case of Vue, I think there were many parts that separated functions and variables, but React allows you to declare and process variables on the spot, just like using a general programming language, so it felt like a warm and comforting feeling like the vitiligo I used to eat every day.

Why do you want to use TypeScript?

Although the pros and cons of React may be different from the pros and cons of the actual industry, I was able to personally point out the above advantages of React and still chose React in the refactoring process.

Similarly, I think it's good to write down the reasons why I want to use TS instead of JS when refactoring, so I'll leave it here.

Error Catching

I think a lot of the strengths of TS address the weaknesses of JS. Basically, I think JS is a very loose language, and it is, so there are times when errors occur in strange places and are difficult to solve, and I expect TS to catch them well.

Familiarity

JS has a lot of things that I personally don't like about it as a programming language due to its inevitable development history. However, TS is obviously based on JS, but it provides a very tight structure that solves what JS was lacking! Of course, it can be tweaked more, but the comfort that comes from the familiarity of a stable structure is what makes me use TS...

Conclusion

I will continue to write about what I've learned and compare it to my previous code in future posts. I don't know how long it will take, but I expect it to be a very rewarding process!

댓글 작성

게시글에 대한 의견을 남겨 주세요.

댓글 0