Monday 23 March 2009

Back to Basics – A .NET Engineer Reading C

Well it’s been a while since I delved into the realm of C code, but a project recently has me reading very old C code with the final goal to produce a modernisation of an existing project so that we can continue support of it into the future.  I suppose some people might argue that C code is very supportable, and they wouldn’t be wrong, however there are just a lot more .NET programmers out there and moving this code into a .NET environment would let our existing developers start support of this product without learning a language they have forgotten how to use.

I’m starting to remember what it was like to program in C now, reading through pages and pages of code to do tasks that I would consider trivial with more modern languages.  30 odd pages of code that simple read from a parameter file and allow the core application to retrieve the results.  Stepping through byte arrays and using structured code and global variables that are just so difficult to locate when you need them.  I wonder how I ever did it.

On the other hand, there’s something very satisfying about identifying the purpose of this code so that we may re-engineer it.  The code is not badly written, in fact some of the most talented C developers I know worked on it, it’s just that the style and form is so different from modern languages that it makes my eyes water just a little bit.

No comments: