Refactoring

Showing 1-3 of 3 results
EngineeringIcon ChevronWeb front-end

Write Code to Rewrite Your Code: jscodeshift

by Jeremy Greer

How many times have you used the find-and-replace functionality (or RegEx) across a directory to make changes to JavaScript source files? Up your refactoring game by using codemods, scripts used to rewrite other scripts. In this article, Toptal Freelance Developer Jeremy Greer walks us through three common uses of codemods, using the toolkit “jscodeshift”.

15 minute readContinue Reading
EngineeringIcon ChevronTechnology

Great Developers Know When and How To Refactor Rails Code

by Radan Skoric

>If it ain't broke, don't fix it. It's a well known phrase, but as we know, most of the human technological progress was made by people who decided to fix what isn’t broken. Especially in the software industry one could argue that most of what we do is fixing what isn’t broken. Fixing functionality, improving the UI, improving speed and memory efficiency, adding features: these are all activities for which it is easy to see if they are worth doing, and then we argue for or against spending our time on them. However, there is an activity, which for the most part falls into a gray area: refactoring, and especially large scale refactoring.

14 minute readContinue Reading
EngineeringIcon ChevronTechnology

Build Dumb, Refactor Smart: How to Massage Problems Out of Ruby on Rails Code

by Daniel Lewis

Sometimes, clients give us feature requests that we really don't like. It's not that we don't like our clients, we love our clients. It's not that we don't like the feature, most client-requested features are aligned perfectly with their business goals and income. Sometimes, the reason we don't like a feature request is that the easiest way to solve it is to write bad code, and we don't have an Elegant Solution on the top of our heads. This will throw many of us on fruitless searches through RubyToolbox, github, developer blogs, and stackoverflow looking for a gem or plugin or example code that will make us feel better about ourselves. Well, I'm here to tell you, it's okay to write bad code. Sometimes, bad code is easier to refactor into beautiful code than a poorly thought out solution implemented under a time-crunch.

7 minute readContinue Reading

Join the Toptal® community.