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.

Testing React Native with Jest and Testing Library

Using Jest and Testing Library with React Native Part II: Our First Test

Justin Leach Articles, Development Technologies & Tools, JavaScript, React, React Native, Testing, Testing React Native Series, Tutorial Leave a Comment

This is Part 2 of our series, Using Jest and Testing Library with React Native. This post will cover the steps you’ll need to take to write your first test. We will also break down the code line-by-line, so you have a clear understanding of the process.

Using Jest and Testing Library with React Native Part I: Setting Up

Justin Leach Articles, Development Technologies & Tools, JavaScript, React, React Native, Testing, Testing React Native Series, Tutorial 1 Comment

In this post, Part 1 of Using Jest and Testing Library with React Native, I’ll give a brief introduction to Jest, Testing Library, and React Native. Then, we’ll walk through how to set each of them up. This will prepare us for Part 2, creating our first test.

Keyhole Team Design Contest with MockOla!

Keyhole Software Articles, Company News, Design, Development Technologies & Tools, Keyhole Creations Leave a Comment

Attention: This article was published over 6 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.**For more information about MockOla, its features and capabilities, and how it was built, visit its product page on the Keyhole Labs site.** Start …

How and Why to Containerize Your Development

John Hoestje Articles, Development Technologies & Tools, Docker, Opinion, Python, Tutorial Leave a Comment

This is a tutorial for how to use the VS Code Remote-Containers extension to containerize your development environment. First, I will discuss my reasons for separating my programming environment and why virtual machines didn’t work. Then, I’ll show a simple example using a containerized Python development environment. Finally, I’ll give you my reasons why containerizing the development environment fits what I’m looking for in a solution.