To Rewrite or Not to Rewrite?

To Rewrite Or Not To Rewrite

Kevin Roper Articles, Development Technologies & Tools, Opinion, Programming Leave a Comment

A recent project got me thinking about the old trope that, upon getting involved in an existing project, the first thing any developer wants to do is rewrite it.

Obviously, thatโ€™s not always true, and in fact, Iโ€™ve rarely been tempted. But the following situation made the thought cross my mind, and it also led me to realize the reasons I didnโ€™t bite.

Letโ€™s talk about it, but first, Iโ€™ll talk more generally about rewriting codes, the potential benefits, and the reasons itโ€™s typically best not to.

Refactoring Strategies For Ugly Code The Does Everything

Refactoring: Ugly Code That Does Everything

Gabe Schmidt Articles, Development Technologies & Tools, JavaScript, Node.js, Programming, Tutorial Leave a Comment

If youโ€™ve been writing code for a significant amount of time, youโ€™re sure to have seen theโ€”anything but godlyโ€”โ€œGod Method.โ€ It’s a method that performs way too many processes in the system and has grown beyond all realistic logic to become โ€œThe Method That Does Everything.โ€

This single unsightly method can span dozens, if not hundreds, of lines. Sometimes even over 1,000! This type of โ€œugly codeโ€ is an unbearable beast to maintain. This is why itโ€™s considered a โ€œcode smellโ€ or anti-pattern.

In this tutorial, we walk through a tangible โ€œGod Methodโ€ and step through the process to refactor it into something more manageable and human-readable. Our code is written in JavaScript for a Node.js service, but the principles apply to any language.

Code For Maintainability So The Next Developer Doesn’t Hate You

Rik Scarborough Articles, Programming 7 Comments

Attention: This article was published over 12 years ago, and the information provided may be aged or outdated. While some topics are evergreen, technology moves fast, so please keep that in mind as you read the post.Unless your problem domain includes some specific need for highly optimized code, consider what is your biggest coding priority. I’m going to suggest that …