Foreword As the project grows and the code becomes more complex, it becomes even more important to keep the code readable and maintainable. In this article, I’ll introduce you to three fascinating JavaScript refactoring tricks so you can say no to those mountains of shit! 1. Use polymorphism instead of conditional statements The Chinese of […]
Tag: refactoring
Unity game framework construction 2017 (23) refactoring gadget Platform
In daily development, we often encounter or write such code <pre> var sTrAngeNamingVariable = “a variable” ; # if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR sTrAngeNamingVariable = “a! value” ; # else sTrAngeNamingVariable = “other value” ; # endif There is nothing wrong with the macro itself. But on the MonoDevelop IDE, as long as the […]
JavaScript code refactoring
References Once explored “JavaScript Design Patterns and Development Practice”; Notes on “javaScript Design Patterns and Development Practices” 12 Javascript tips to help you improve code quality Patterns and Refactoring There is an inherent relationship between patterns and refactoring. From a certain point of view, the purpose of design patterns is to provide targets for many […]
Super detailed Vue2 old project SSR refactoring
Vue2 old project SSR refactoring For business needs, the old Vue2 project needs to be reconstructed from the previous static project to an SSR project. If you don’t want to watch the process, you can directly pull it to the end. The source code is pasted at the end. There are also Vue3/Vue3 SSR / […]
Refactoring: logo aggregation and dispersion animation in banner
1. Effect display view online 2. Instructions before starting Reference source code for effect realization: Logo gathering and scattering The original effect code is implemented based on react jsx class components. Old dependencies and redundant code. I’m going to refactor based on this, refactor target: Based on the latest dependency package, use ts + hook […]
The Dotnet9 website returns to Blazor for refactoring, the access speed is fast, and the interaction is more convenient!
Hello everyone, I am the wolf at the end of the desert. The Dotnet9 website returns to Blazor for refactoring, and the access speed is really fast. At the same time, using the interactive capabilities of Blazor, the webmaster also added several online tools at the same time. This article shares the refactoring process of […]
Refactoring of array API (shift, unshift, forEach, every, some, filter, map), method of deduplication of array, method of flattening array and return length/longest word of longest word in string
Directory Refactoring of the array API refactor shift Refactor unshift improve code Refactoring forEach Refactor every refactor some refactor filter Refactor map Array deduplication method indexOf method Double for loop method includes method forEach + indexOf/lastIndexOf/includes method filter + indexOf/lastIndexOf/includes method set method output result Flatten Array Method Array flattening using recursion toString() method flat() […]
Improve Your Code: Use These 5 Refactoring Techniques
This article was first published on the WeChat public account: Daqian World, my WeChat: qq449245884, I will share with you the front-end industry trends, learning paths, etc. as soon as possible. For more open source works, please see GitHub https://github.com/qq449245884/xiaozhi, including the complete test sites, materials and my series of articles for interviews with first-line […]
[Go microservice development] gin+micro v4+rabbitmq+etcd refactoring memo
Write in front Recently refactored the previously written micro-todolist module slightly Project address: https://github.com/CocaineCong/micro-todoList This upgrade upgrades the original micro v2 to micro v4 version, v5 is still developing, so it may not be stable, so I chose the v4 version. Compared with grpc, the difference between micro is that grpc is relatively primitive, and […]
Operator overloading (refactoring)
auto increment operator overload Refactoring the += operation refactoring + +i operation Refactor i++ operations total implementation code Input and output overloaded operators output operator overloading Input operator overloading function call overloading Subscript access operator overloading Increment operator overload Previously, we learned how to implement the addition operation of two complex number objects, and the […]