Magento: the Importance of Lean Development Practices

Here at Watermelon, we regularly work with Magento (or WordPress) projects starting from the ground up by estimating project costs, implementing Content Management System (CMS) solutions, creating and deploying site designs, and working with product, customer, order, and content data for a variety of eCommerce, membership-driven and boutique web sites. Magento and WooCommerce are favorites for different reasons.

We also regularly get requests to inherit Magento and / or WordPress sites already in production that require design updates, customized site functionality, and/or code updates in order to resolve errors or other unexpected site problems. When we feel we can provide solutions for inherited sites like these, we typically respond with an enthusiastic “Yes, we would be happy to plug in”! We pride ourselves for identifying and resolving issues as efficiently as possible, taking great care to be non-disruptive while working with production sites.

Unfortunately, we often find problems that stem from inefficient or confusing development practices from prior developers. For example, problems with code written without regard for ‘future-proofing’, hard-coded variables that cause unexpected front end behavior, and code written with what I call the ‘swiss army knife’ approach, that attempts to implement a variety of customization features but are fragile, convoluted, and prone to breaking when the core features of the site require an update.

We recently have been resolving the ‘swiss army knife’ approach on a very large, very active Magento 2 eCommerce site, which required so much additional troubleshooting, different staging environments, and trial and error approaches to enabling/disabling features that prompted us to write this post, which we hope will outline our coding practices that attempt to circumvent these common customization problems. This style of coding is called Lean Development, and is essential to keeping sites easy to debug, easy to update, and easy to implement new features.

The idea is simple: when creating new features, keep things simple, short, well documented, and focused. I will first describe a recent example of how this style of code production was NOT utilized, the problems it created, and how they could be avoided.

When the Magento 2 Swiss Army Knife Breaks Down

In a recent Magento 2 site we inherited, we noticed immediately the core structure of the code base was highly modified, which was the first red flag. Upon further review, we noticed the prior development team implemented the ‘swiss army knife’ style of development: there was one, large, convoluted custom extension that handled a huge variety of features. The code base was fractured and didn’t conform to Magento 2 standards of code isolation and scope. The extension also used a large amount of simlinks, which linked from where Magento 2 expected the code to be, back to the convoluted structure of the custom extension.

This made it a huge problem to determine what parts of the code could be disabled for testing: if we disable this specific module, will it have reprocussions with other modules in the extension? Usually it was unclear (and often disruptive) to determine the answer to this question.

The client also wanted to make sure the Magento 2 core code was up to date with the latest version. This would almost certainly cause the site to break upon doing so. Because the code was written in a structure not recommended by Magento coding best practices, finding the code that needed to be updated was far more difficult than if the structure was using acceptable coding methods.

Another problem was wading through all the code to disable features the client no longer needed. If the custom code base was organized properly, finding and modifying the correct files would have been much simpler. The ‘any-size-fits-all’ approach added much more overhead to our development time, which of course adds a great deal of unnecessary burden to the project budget.

The Philosophy of Magento Lean Development

So, how can the lean development philosophy help to avoid this problem in deploying site customizations? Here are a few key principles to adhere to:

1. Keep it Simple

All Content Management Software (CMS) solutions have an established, documented code structure. Your custom solutions should inherit the ‘best practices’ defined by the CMS code base. More importantly, the customizations you need should be concrete and well-defined. An ideal customization should do exactly what the customization spec requires. No more, no less. ‘Bloated’ code only makes future updates more difficult. This idea is similar to the next principle.

2. Keep it Lean

Isolate and define the parts of your customization in such a way that isolates the code in discrete, easy to understand chunks. This means creating discrete classes that do simple, easy to understand functions. It is much easier to deal with 10 different, defined chunks of code that do different tasks, than dealing with a 1000 lines of code in one file. This makes development and debugging much faster and much easier to make incremental changes.

3. Separation of Concerns

This philosophy can be applied to all manner of software creation, such as UI, back-end programming, database schema, and more. The idea is to properly separate parts of the program dependent on their functionality. Keep code that displays the front-end separate from code that executes custom business logic, or code that accesses database information, or code that responds to actions from the user. This philosophy increases the ease of addressing issues by keeping the code organized in a sane fashion.

4. Testing

This one is a no-brainer. Be sure to allow time in your development budget for a proper QA of the site after customization work is done. Explore all the site features that can be impacted by your customizations from a typical user perspective. Attempt to ‘break’ your code, with unit tests or submitting erroneous input data. This step is critical, and while some QA will occur during development, there should always be a final QA assessment before customization is complete.

Keeping these principles in mind saves time, effort, and ultimately budget hours. We strive to provide the best solutions as efficiently as possible, and by following lean development best practices, our job becomes that much easier to do so.

 

Are you wondering if your Magento developer is using Lean development practices? Get in touch and we’ll help you find out.

 

 

Work With Us

We've been building websites for over twenty years, and have learned a thing or two about how to make web projects go smoothly.

What Our Clients Say

Watermelon Web Works, LLC place picture
4.7
Based on 19 reviews
powered by Google
OMS Anita profile picture
OMS Anita
22:20 29 Nov 24
Watermelon Web Works has been incredible to work with. They are patient, understanding, and quick to answer any questions (or emergencies) you might have. After switching over to them to help re-vamp our online retail store, we hired them to build our wholesale website as well. I can't recommend them enough - Thank you team!
Garrett Lister profile picture
Garrett Lister
19:55 10 Jul 24
Jared and the watermelon team were great - they quickly interpreted our website needs and designed a wonderful site. The project management site worked great to keep track of project.
N B profile picture
N B
21:23 14 Nov 23
My previous web developer who I was very happy with retired and I was pretty sad about it because it seems now days it is hard to hire a web developer close by with a good set of skills who is interested in helping small business at reasonable prices. Then I found Watermelon and I have been very happy. They are responsive, are able to solve problems, and work at reasonable prices.
Dark Star Magick profile picture
Dark Star Magick
18:05 03 May 23
We hired Watermelon to help us with our website. They were very thorough and took the time to explain in layman's terms what they were doing and how we could improve SEO and site functionality. We will definitely be back for future website needs!
Astoria Column profile picture
Astoria Column
18:42 24 Apr 23
Great work and amazing service! We're a non-profit, and our priorities are always focused on maintaining the Astoria Column. We had a website built by someone else a few years ago, but without regular updating and maintenance, sections of our site were no longer functional. Joanna and the rest of the team came in and had everything working within a week and it's been smooth sailing since then!
Ben Harris profile picture
Ben Harris
19:25 26 Aug 19
Watermelon has been a fantastic web development partner. Through every phase of our project they have always been 100% responsive to our requests and have always provided highly knowledgeable, creative, prompt, and personable team members to work with. As a financial institution we’re always concerned about the security and maintenance or our website and Watermelon has always provided the appropriate resources in order to meet and/or exceed our compliance and security requirements. We would surely refer them to any business associates looking for a qualified WordPress web designer in the future. – Denali Federal Credit Union
Mohr IP Law Attorneys profile picture
Mohr IP Law Attorneys
00:33 11 Apr 19
Watermelon Web Works did a great job creating a custom shopping cart page for our firm. Gavynn in particular was especially helpful and responsive. We appreciated the upfront costs and the technical competency of Watermelon Web Works and would not hesitate to work with the people there again.
Kim Markle profile picture
Kim Markle
23:36 08 Feb 19
Our company has been working with the Watermelon team for more than 10 years to help build and grow our website and customer portal. They are not only extremely talented and responsive, but are continuously looking for ways for us to enhance our current website. They are consistent, provide excellent customer service and really know what they are doing. Highly recommend!
Rick Brodner profile picture
Rick Brodner
23:23 12 May 17
I cannot say enough good things about Watermelon. They are terrific communicators, highly competent coders, and really, really nice people. They were instrumental in helping us to assemble a very usable, easily maintainable website for our organization. They' have demonstrated great flexibility in accommodating our evolving needs. They have been highly responsive to any technical issues, typically resolving them in less than 4 hours. Watermelon Web Works will make your organization better, and your CFO/Treasurer will be happy when they see the bill - what more can you ask for?
CLOSE