Feeds

When good software gets complicated

Build for simplicity

Gartner critical capabilities for enterprise endpoint backup

Complexity can hide bad practices

Another reason to keep it simple is that simplicity often highlights poor design or implementation at an earlier stage.

I was recently reviewing some code written by an offshore development team. In examining one particular set of functionality, I found that the complexity in the way they had implemented their solution made it hard to determine what was going on.

By refactoring the implementation, with the aim of simplifying the implementation, I gained not only a better understanding of what the software was trying to do, but uncovered a number of strange behaviors hidden by the complexity. As a very simple example, it turned out that in the course of the implementation, the code did the following (this is intentionally simplified to illustrate the net effect):

String count = “32”; …. cut lines of code … int i_count = Integer.parseInt(count); … cut lines of code … String countStr = i_count + “”;

Without the intermediate int value actually being used.

Simplicity can be copied

Yet another reason to keep things simple is that the first time you design and implement a solution to a problem you may well be doing so to solve a particular problem.

However, this may then become a blueprint to others on how to solve the same or similar problem elsewhere within the team, project or organization. If the solution you create is as simple as it can be, then not only will this approach permeate across the organization, but that "copied solution" will be easier for others to understand.

You'd be surprised the number of times I have heard the answer "I did it that way because that was what was done before" when I have asked (particularly more junior developers) why they adopted a particular approach. When this is followed up with a question about how the solution works, on more than one occasion I have received the answer "not sure really".

Avoid over-engineering

My final comment on keeping it simple is that you should be careful not to over-engineer solutions. That is, you should only implement what you need to implement and not attempt to anticipate future needs. Not only may those needs never actually materialize, but they also make the software more complex and more difficult to understand (not least as anyone looking at the code later on may fail to understand why the additions were included).

Conclusion

There are many reasons for keeping things simple, but there are also exist a number of "pressures" that may limit the simplicity of the solution. These pressures can include the desire to produce some fun code or to “impress other programmers” with your skills. At the end of the day, though, it’s the simplest code that may actually be harder to write than apparently more complex - but potentially less thought out - code. ®

Secure remote control for conventional and virtual desktops

More from The Register

next story
Why has the web gone to hell? Market chaos and HUMAN NATURE
Tim Berners-Lee isn't happy, but we should be
Mozilla's 'Tiles' ads debut in new Firefox nightlies
You can try turning them off and on again
Microsoft boots 1,500 dodgy apps from the Windows Store
DEVELOPERS! DEVELOPERS! DEVELOPERS! Naughty, misleading developers!
'Stop dissing Google or quit': OK, I quit, says Code Club co-founder
And now a message from our sponsors: 'STFU or else'
Apple promises to lift Curse of the Drained iPhone 5 Battery
Have you tried turning it off and...? Never mind, here's a replacement
Uber, Lyft and cutting corners: The true face of the Sharing Economy
Casual labour and tired ideas = not really web-tastic
Linux turns 23 and Linus Torvalds celebrates as only he can
No, not with swearing, but by controlling the release cycle
prev story

Whitepapers

Gartner critical capabilities for enterprise endpoint backup
Learn why inSync received the highest overall rating from Druva and is the top choice for the mobile workforce.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Rethinking backup and recovery in the modern data center
Combining intelligence, operational analytics, and automation to enable efficient, data-driven IT organizations using the HP ABR approach.
Consolidation: The Foundation for IT Business Transformation
In this whitepaper learn how effective consolidation of IT and business resources can enable multiple, meaningful business benefits.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.