in Modernizing PHP, PHP

Part 2: Code Is The Most Expensive Solution

This Series: Modernizing PHP

Editor’s Note: This is the second in a five-part series on refactoring and modernizing PHP applications.

If you were to identify the most expensive part of any development project, what would that part be? The planning phase? Acquiring copyright or intellectual property? Marketing and advertising? All of these would be wrong. The most expensive part of any software project is the creation of the software itself. It’s the part that requires the most time, energy, and money to do correctly.

In other words, every single development project you have ever worked on was the most expensive solution possible to the problem being solved.

Kind of shocking, isn’t it?

Consider: if you and a team of two developers are making $75,000 a year plus benefits (for a US-based salary), and it takes you six months to complete a project, it cost $112,500 to complete that project for the company. This doesn’t take into account maintenance and bug fixing of the code in the future. If the company could have purchased an off-the-shelf solution for $55,000, it would have saved at least $57,500. That’s a significant savings for any company.

So what does all of this mean?

Sometimes there isn’t a solution that can be purchased off the shelf to solve your particular problem. There are not likely to be software products that adhere to your specific requirements for insurance adjustment, for example. Or to your specific, proprietary process for doing whatever your company does. After all, that’s why you have a job: because you’re necessary to solve whatever business problem your company is experiencing.

This is where your programming skills really shine. Your job is to solve the business problems that can’t be solved in any other way. All the business problems that can be solved with off-the-shelf technology? Go ahead and recommend that. Focus on the expensive problems that your business really needs you for.

What does all this have to do with refactoring and modernization? You are likely to come across parts of your application that need modernization and could be replaced with off-the-shelf technology. Consider for a moment the humble queue. In days of old many of us implemented queues by writing to a database table and having a worker read that database table, first-in, first-out. We have logic that maintains this ordering and reads this table. You might be tempted to maintain your homegrown queuing system, but it would make more sense to implement one of the other wonderful queuing systems that have been invented since your homegrown solution was developed. Modifying your worker to receive data from RabbitMQ will be simpler than refactoring the software to read from the database and maintain the state of the queue.

When it comes down to it, writing code is the most expensive thing any company will ever do. It should be avoided until it is absolutely necessary to solve a business problem that cannot be solved in a less expensive or more convenient way. Then, and only then, should we take the time to write code.

Frustrated with your company’s development practices?

You don't have to be!

No matter what the issues are, they can be fixed. You can begin to shed light on these issues with my handy checklist.

Plus, I'll help you with strategies to approach the issues at the organization level and "punch above your weight."

Powered by ConvertKit
Brandon Savage is the author of Mastering Object Oriented PHP and Practical Design Patterns in PHP

Write a Comment

Comment