Alex's Notes

Alex's Notes

Alex Reid  //  Software developer from Newcastle upon Tyne, UK. All of the dubious opinions stated here are purely my own and not those of my employer.

Jan 1 / 2:52am

There's no shame in code that is simply "good enough"

Back when I started developing what could loosely be called software around fifteen years ago, I didn't know what I was doing. If it compiled, ran and produced (mostly) the expected results, then the job was done. 

As a new programmer, I was immensely productive. 

Of course, problems came when it was time to fix bugs or extend the software. It was often easier to just start again than to try and understand the rat's nest of poorly structured and unintelligible code. 

Fast forward ten years and I have been fortunate enough to have had exposure to some huge, well architected and complicated systems, not to mention some extremely clever people. As a result I realise I knew nothing back then. In another ten years I'll probably think the same about my current knowledge and ability. But that's the nature of software engineering. You never stop learning and evolving.

I do however miss those naive days of being able to crank out code with such velocity. It was fun back then. Yeah, what I did then might have been inefficient and probably quite flawed. But for the most part, it worked and served a purpose.

Back in those days of youthful ignorance I didn't have the experience to know what could go wrong when I hit the database fifty times to service a request. That was learnt the hard way. I just ploughed ahead, thinking in functional terms about how the application would behave for a user. I didn't worry about code being performant or extensible or even dream of coming up with my own framework. No yak shaving, I just focused on the task in hand. This was perhaps a good mindset to have.

A decade later, I am not suggesting that we should lash things together in this way. It'd be moronic to suggest we shun our collective experience, knowledge of patterns and the advanced features of programming languages. Not to mention security. However, I have found that as my knowledge increased, there was a dangerous tendency to obsess over tiny details relating to both scope and implementation and not produce anything at all.

"Will my peers think I am fool for using a TABLE element to display this on-screen calendar?"

"This web service I am creating isn't really RESTful, but if I make it RESTful it'll be really slow."

"Hmm. That query on a million records took over 75ms. Slow. :("

"This won't scale very well with more than 1000 concurrent requests. :("

"Yes, we're creating an online pizza shop but what if we want to support tapas or greek food as well? We may want to the ability to sell mountain bikes and custom coffee mugs using the same software at the some point...."

Would an engineer design a small, single lane bridge for a rural Northumberland village so that it could support the weight of a thousand double decker buses? No. So why do we, as software engineers try to do exactly this? That day will never come.

Why expend effort over engineering software in places that you don't yet know are important? Sure, it'd be nice to get a background task running in one second rather than ten - but if it's a one off nightly scheduled job, does it matter? 

I have come to the conclusion that there is no shame in producing well considered, simple, fit-for-purpose code that is just good enough.

Good enough doesn't imply half-arsed or lashed together. It should concisely meet the requirements at hand, not what you think the requirements might be next week. It doesn't mean you are naive and haven't considered the big picture, nor are you lazy or stupid. It doesn't mean you are a moron if you don't use wildcard generics and don't have a fetish for multiple inheritance.

I believe all developers should have a geek valve that prevents them from introducing overly-generic, indecipherable black magic to a codebase. In conversation you would look a bit unusual if you insisted on using flowery language to express a point that could be adequately conveyed in more standard terms. Some people may miss your point. The fact that their grasp of English isn't as advanced as yours doesn't make them stupid. It means you aren't communicating efficiently. Why can't the same logic apply to code? Favour explicit and clear over clever.

Software evolves over time, in some cases decades. If the architecture is kept as simple as it can be and is easily understood by all, on-going maintenance and evolution is likely to be a hell of a lot less risky. It will be more likely to be undertaken in a reasonable timeframe by anyone on the team. To me, that's true extensibility.

Filed under  //  development   rant  
Apr 28 / 2:53am

Developers, eggs and baskets

I am currently handing over the system that I have worked on for the past three years. It is written in ColdFusion. 

I have noticed two things:

  • some developers are initially wary of something less familiar, while some are keen to embrace something new
  • an implicit assumption is made that you must be wedded to that platform you work in: "I am a .NET developer so you must be a ColdFusion developer."

In actual fact, I see myself as just being a developer.

Someone actually remarked that they were surprised that my new employer made use of ColdFusion. They don't, of course. Do developers get typecast? 

I develop in many different languages and frameworks. Java, mainly, but also C#, T-SQL, Python, Objective-C and Cocoa. Does this versatility make me a jack of all trades and a master of none? Some would say yes.

I just prefer to consider myself as someone who is not shackled to any particular platform. Us developers have transferrable skills which mature throughout our careers. Implementation languages and frameworks are only half of the story. I'm not saying that it is wrong to specialise and become expert in something. I am not saying it is wrong to specialise. I'm saying it's wrong to deny the existence of any other technology. 

I understand why management favour a unified and supported technology path. There's less risk. It makes sense. If you have a pool of .NET developers available, in theory they should be able to maintain each others code. 

It can, however, be a ball and chain, particularly in a mobile context. 

Successful companies and individuals will think outside their bubble and comfort zones.

It's simple economics. It makes sense to write software for the iPhone because it's huge at the moment. The tooling and documentation for the iPhone SDK are excellent.

Does this mean I'll burst into tears as Android's popularity continues to rise and the iPhone's popularity inevitably wanes and Apple go bankrupt (despite the billions) if we are to believe many of people I follow on Twitter? Will I have wasted my life in Xcode, typing square brackets? Not at all. I won't have called myself an iPhone developer. I'll still have been just a developer - developing for iPhone, Android, BlackBerry and ... whatever else.

Being a mobile developer in 2010 will be very different to being one in 2015, that's for sure.

Filed under  //  android   career   development   iphone   mobile   rant   software