Smarty
5 Principles For Creating Stupidly Brilliant JavaScript ApplicationsThe smarter an application is, the dumber its code should be. Make your code maintainable, extendable, and bug-resistant.
Andrew Townsend
Andrew Townsend
 • 
April 11, 2022
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
Smarty Launches US GeoReference Data, Providing the Easiest, Most Accurate API Needed To Access Census Tract and Block
Arrow Icon
PROVO, Utah, April 10, 2024 – Smarty, the address data intelligence leader, announces today the launch of US GeoReference Data, a set of updates to Smarty's US Address Enrichment solutions. US GeoReference Data is a cloud-native solution that will allow organizations to append the geographic data found in U. S. Census Block and Tract information into accurately geocoded addresses.  Smarty's US GeoReference Data is the simplest and fastest way for organizations to access Census Blocks, Tracts, location names and statuses, as well as additional Census ID information relevant to a property.
International Be Kind to Lawyers Day
Arrow Icon
Lawyers get a bad rap. Lawyers have been around for a long time, and when you're this old, you're bound to collect your fair share of good and bad. It's true, ask your grandpa. We've got records of people described as "lawyers" going back to ancient Greece, Rome, and the Byzantines. These first individuals were folks who were asked to speak for the accused because those under scrutiny were—understandably so—shaken up by the situation. It went from someone who was your friend and did you a favor by speaking on your behalf to someone who knew all of the laws, and you'd hire them to speak eloquently for you.
Navigating the Future: Geocoding & Address Data Trends in the Cloud
Arrow Icon
In a recent webinar, Berk Charlton, Chief Product Officer at Smarty, provided an in-depth look at our industry-leading address intelligence suite designed to provide highly accurate geocoding and address validation. Here are the main points Berk covered during the session:Comprehensive Product Suite: Smarty offers a wide range of products, including address validation, rooftop geocoding, global address auto-complete, and address data enrichment. These tools are designed to handle various aspects of address management and enhancement in industries from Insurance to Healthcare to Telecom and more.
Ready to get started?