5 Principles For Creating Stupidly Brilliant JavaScript Applications

Andrew Townsend
Andrew Townsend
 • 
April 11, 2022
The smarter an application is, the dumber its code should be. Make your code maintainable, extendable, and bug-resistant.
Tags

Have you ever tried to add a minor feature to your application only to discover that you’ll have to re-write large blocks of code first? Or maybe you’ve spent hours deciphering hundreds, or perhaps thousands, of lines of existing code just to find out a task only required two lines of additional code. If you’re like most developers, you’ve wasted countless, frustrating hours wading through immensely complicated code trying to force it to do things it wasn’t built for.

In his presentation, Mike Manwill, Frontend Team Lead here at Smarty, discussed 5 principles to help you create stupidly-simple applications that are maintainable, extendable, and bug-resistant. He calls it “writing stupid code”.

“If you can’t explain it simply, you don’t understand it well enough.” - Albert Einstein.

Mike explained that “smart” code is “dumb” for several reasons. It is difficult to read and understand, making it difficult to hand off to predecessors or other coders on the team. It is bug-prone, and debugging can be very very difficult. Extending it becomes time-consuming and difficult, especially if you’re not the one who authored it. Estimating work needed becomes virtually impossible if your code is too smart. And finally, it tends to have a short lifespan and needs to be overhauled frequently because it can be so frustrating to work with.

Smart Code is Dumb

Aside from spotting those challenges, there are five other symptoms of “smart code”.

  1. Your functions take lots of parameters
  2. There is a lot of conditional logic
  3. You need to explain your code via commented code
  4. Brittle code (it breaks every time you change it)
  5. The code is difficult to follow

So, we’ve identified the problem. You’re tired of being frustrated with this “smart code”. How can you make it better? For the main part of his presentation Mike went over the five principles you can follow to create brilliant “dumb code” that lasts.

  1. Take time to really understand the problem
  2. Decouple different ideas
  3. Pass the thing instead of the parts to build the thing
  4. Refactor (just because it’s working doesn’t mean you’re done)
  5. TDD (Red, Green, Refactor)

You can watch the video recording of his session (super short, only 28 minutes!) and see his examples and explanations first hand by clicking the button below.

Try our stupidly brilliant address validation and address autocomplete tools. You can sign up for a free account by clicking the link below.

Get Free Account

Subscribe to our blog!
Learn more about RSS feeds here.
rss feed iconSubscribe Now
Read our recent posts
6 Ways Telecom & Internet Companies Leverage Address Data
Arrow Icon
In a recent webinar, we showed how address data tools help managers improve business performance in the following areas:Network PlanningAsset ManagementCustomer Acquisition and RetentionData BlendingMail and Parcel DeliveryFraud Reduction1. Network PlanningAccurate address data plays a critical role in overcoming network planning challenges. We presented solutions at each of the following steps in the network planning process: Clean existing address data with US Address VerificationKeep incoming data clean with US Address AutocompleteMap all addresses using our US Master Address List and hyper-accurate US Rooftop GeocodingAdd context to maps with enriched US Property DataAnalyze, get spatial insights, and make confident business decisions 2.
A Fresh Start: Clean Out Your Computer Day
Arrow Icon
In a world where the lines between digital and physical spaces blur, the health of our computers has a massive impact on our productivity and overall ability to perform well at work.  Clean Out Your Computer Day, observed on the second Monday of February, is the perfect opportunity to ensure that we declutter and optimize our virtual spaces. Just as we regularly clean our homes and offices, this day underscores the importance of maintaining a streamlined, efficient computer setup. The Digital Declutter: Where to StartStarting with the basics, sift through your files and programs.
Smarty's 2023 Address Data Deep Dive: Trends, Challenges, and Breakthroughs
Arrow Icon
We recently hosted a webinar where Brent Francom and Jeffrey Duncan, two of our Product Managers, talked about the lessons we learned and the improvements we've made in 2023. Here are the highlights. When you process so many addresses, you see things. We processed 327 billion+ addresses in 2023, equating to nearly 900 million per day or over 10,000 per second. When you process that many addresses, you find many funny and interesting ones. We keep a "Wall of Shame" with funny and malformed addresses that somehow validate.
Ready to get started?