Feeds

When good software gets complicated

Build for simplicity

Combat fraud and increase customer satisfaction

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. ®

SANS - Survey on application security programs

More from The Register

next story
This time it's 'Personal': new Office 365 sub covers just two devices
Redmond also brings Office into Google's back yard
Oh no, Joe: WinPhone users already griping over 8.1 mega-update
Hang on. Which bit of Developer Preview don't you understand?
Microsoft lobs pre-release Windows Phone 8.1 at devs who dare
App makers can load it before anyone else, but if they do they're stuck with it
Half of Twitter's 'active users' are SILENT STALKERS
Nearly 50% have NEVER tweeted a word
Internet-of-stuff startup dumps NoSQL for ... SQL?
NoSQL taste great at first but lacks proper nutrients, says startup cloud whiz
IRS boss on XP migration: 'Classic fix the airplane while you're flying it attempt'
Plus: Condoleezza Rice at Dropbox 'maybe she can find ... weapons of mass destruction'
Ditch the sync, paddle in the Streem: Upstart offers syncless sharing
Upload, delete and carry on sharing afterwards?
New Facebook phone app allows you to stalk your mates
Nearby Friends feature goes live in a few weeks
Microsoft TIER SMEAR changes app prices whether devs ask or not
Some go up, some go down, Redmond goes silent
prev story

Whitepapers

Securing web applications made simple and scalable
In this whitepaper learn how automated security testing can provide a simple and scalable way to protect your web applications.
3 Big data security analytics techniques
Applying these Big Data security analytics techniques can help you make your business safer by detecting attacks early, before significant damage is done.
The benefits of software based PBX
Why you should break free from your proprietary PBX and how to leverage your existing server hardware.
Top three mobile application threats
Learn about three of the top mobile application security threats facing businesses today and recommendations on how to mitigate the risk.
Combat fraud and increase customer satisfaction
Based on their experience using HP ArcSight Enterprise Security Manager for IT security operations, Finansbank moved to HP ArcSight ESM for fraud management.