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/.