About the Author
Avatar photo

Gabe Schmidt

Gabe is a senior software engineer and team leader with 15+ years of .NET development experience. Highly adaptable, Gabe’s abilities, working expertise, and technical knowledge extend from data and process modeling to web development and database design. He is an excellent listener, a strong communicator, and quick to pick up complex topics. Recent development projects include work with a .NET MVC application with React front end, as well as extensive C#.

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.

Go To SQL

Gabe Schmidt Articles, Databases, Go, Programming, SQL, Tutorial Leave a Comment

In between projects here at Keyhole, I’ve been tasked with applying a relational database access and mapping framework in the Go language.

In this post, I go step by step to create a Postgres relational database, then perform CRUD operations against it in the Go language.

I won’t get into the specifics of configuring Go in this blog, but you can check it out yourself here – https://golang.org/. Additionally, Keyhole’s very own David Pitt wrote an excellent primer on the subject here – https://keyholesoftware.com/2019/09/26/go-on-the-fly/.