Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
252 views
in Technique[技术] by (71.8m points)

web applications - How do i refactor and improve my finished web app?

I have finished another small project and has reached the point where all my code works. The problem is that during the month I've been spending on it, there has been a lot of different ways to solve problems and there has been a lot of adding and deleting. It's time to refactor and upgrade the app.

My question is: what approach is generally used to refactor and improve your code? I am still new to programming, so I don't follow a specific design pattern, mostly because I'm not sure how to.

So far I've just tried to separate some big functions to make it all bit more neat, but I always end up with some variable missing, because it's the old file.

Do I go in and look for a design pattern I could use and then try to start over on my project or is it more a question of making my functions into reusable blocks, so i can separate som of the bigger files.

I feel like I'm at a point where I can make apps that works, but I now need to learn how to evaluate them and make them more "commercial" or "professional". I hope someone can help or point me in the right direction.

If interested, my project can be found here: https://github.com/mikjo15/REST-react-recordspage.git

question from:https://stackoverflow.com/questions/65951888/how-do-i-refactor-and-improve-my-finished-web-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

In my experience, refactoring code is not the best way to move forward and improve in case you are just starting to learn programming. Instead of refactoring, try to think of what could have been done in a better, more efficient way and allow your mistakes to teach you a lesson that you can use to your advantage in your future projects.

I would suggest starting a brand new project where apart from tackling new problems that arise and diving into new concepts that the project requires, you could concentrate on avoiding mistakes that you made in the past and eventually produce better, cleaner and more scalable code.

With every new project you work on, you face new problems, explore new concepts and, most importantly, make tons of mistakes, which are crucial for improvement.

This may not exactly be an answer to your question, but I felt like it was worth sharing, since I was asking myself the same question in my early years of programming.

Hope this helps and wish you all the best!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...