On Languages

latest-small-64So many things in software become religious wars, languages is probably number one. Which language should you use for any given task? Which language is generically the best? Which language is fastest/smartest/structured/extensible/prettiest?

Which languages have I seriously coded in? Well, lets think, Basic (C64/Spectrum/ZX81), ASM (Z80, 8086, 68k), Pascal, Forth (White Lightening), C, C++, Eiffel, Java, PHP, Javascript, Objective-C, Visual Basic (yes really). Which languages have I had to work in now and again, Shell (CSH, BSH, ZSH), Perl, TCL/Tk and probably plenty of others. Which is the best? Who knows? I use Java most but thats through familiarity not through any sort of belief it’s the best choice?

And what makes it a language? Does XML or HTML count as a language? God no! Why? Languages to me, mean some sort of branching or decision making. So a specific XML dialect could be language, but for god sake, HTML is not a programming language. The next resume I see with it listed under programming languages I’m going to burn!

The answer? What language is the best? Well who gives a flying ferret? You’re here to get the job done, you pick the language which suits based on all sorts of factors – some of which have nothing to do with engineering.

  • Is it fast enough?
  • Does it integrate to whats required?
  • Does it run on the platforms you need it to?
  • Whats the library support like for thing things you need to achieve?
  • Whats security like? Patching? Bugs? Flaws?
  • Do you know it?
  • How long will it take to get used to it?
  • Does anyone else know it on your team?
  • Does anyone else know it in the company/support department?
  • How soon does this thing need to be built?
  • Will the target customers run it in their environment?

So the first few up there are certainly engineering thoughts, but what about the rest? Is anyone actually going to be able to support this thing you build? Are customer’s going to be able to use it? The minute you start working for bigger companies there are so many policies to comply to – you need to consider it all.

As always, I’ll end with thing for yourself! Don’t let me or anyone else give your a crutch to rest on. Consider all the factors but limit yourself to simply which is technically the best – consider everything and don’t let your religious bias cloud your way.

On Naming

latest-small-64So, why “Kev on Software”? As you can imagine the first bit is easy – my name is Kevin, but why “on Software”. Back way back when there was a blog called “Joel on Software” – by Joel Spolsky. He wrote passionately about what made good and bad software, and where he saw the pitfalls. It’s been many years since I’ve been regular reader but most of his opinion pieces stick with me, even if I didn’t agree. I think thats what his blog taught me most, that thinking for yourself is the key to everything, especially in software. Guidelines, methodologies, courses and approaches are all great, but if you stop thinking for yourself you’ve already set up to fail.

As I was thinking about the name, it occurred to me I care about naming in software more generally. When you’re building code, or documentation or even marketing material the names you use mean everything. The right name makes something instantly memorable, the wrong name can be useless or in the worst case mislead. Consider the following:

I have an object that contains a set of Book objects. If thats it’s only description in your system, then BookList makes a perfectly good name. However, where in your system is a collection of books meaning really only a collection of books?

Is it a Shelf? Is it a Catalog? Is it a Library? Does it really matter? Well yes, it can do and this is where the thinking for yourself bit comes in.

  • Who is reading this code, is it only ever you or are there other people maintaining it?
  • Does the context mean it doesn’t have all the properties of a list, e.g. can you add and remove items? (Yes, you could for for ReadOnlyBookList, but now its getting silly)
  • How long is this code going to last, does the design of the interface to this class really matter at this stage?

Reading the above you’re probably saying, but you’re not arguing either way, and that’s correct. Think for yourself!

If the code isn’t going to last more than a day, who cares what it’s called? Why waste perfectly good cycles on a name that will disappear shortly. That said, are you sure it’s only going to last that long – and are you willing to put the time into change it (and it’s ripples across the code base) if the code does end up lasting longer?

Is the addition of methods in the interface for a BookList going to imply something outside of the context of the class? Is removing items from the list possible in the context, and if not, is having the method going to mislead and confuse?

Are you the only one who is ever going to maintain this code? In which case does it really matter given you’re going to keep the whole thing in your head anyway? Are you sure?

The above questions, and many others, sound like a lot of thinking to do as you’re endeavouring to code away as quickly as possible. However, once you’re thinking about it every day as you code, it’s split second decision making – that you don’t need to cross check with every guy around you and his dog.

You think, then act. If a discussion does arise later then you know why you made the decision and if things have changed you refactor.

 

Why now?

latest-small-64So here we are, another day, another new blog – but this time its personal. I’ve been developing software a while, 20 odd years commercially and if you count all the years I spent as a kid we’re talking 30 years.

I’ve watched software turn from something a few people knew how to do, to being a skill, to being a formal method, to being a discipline in its own right and finally being an integral part of every enterprise business everywhere. It’s been fun and I thought until recently I didn’t really mind how it was done as long as I still had a job.

Then it happened, I became a manager, I watched as teams of people I looked after did things different ways, and believed and subscribed to different methods than I did. No, it didn’t scare me, its positive right? Well yes it is, but then you start seeing the time thats so important to your business disappearing down rat holes of belief and opinion. Remember, when you’re writing software it shouldn’t ever be just for “the sake of it” or worse still as an “engineering exercise”. Commercial software serves the business it’s written for, like it or not, as a software developer you’re a cog in a large machine thats trying to make money.

The reason for this blog? I posted this on facebook today and got a score of replies about software. I didn’t realise but I actually care, not sure when it happened, but I do and I’ve done this stuff, a lot. This blog documents my opinions and hopes to drive discussion if not agreement.

fb1