The Johnson Blog

Ramblings of a Computer Geek and his Wife…

The Johnson Blog Header Image

C and .NET

August 30th, 2006 @ 10:39 am by EJ · 2 Comments

A coworker and I have been trudging through a lot of code recently. .NET code written by a C programmer. Folks, these things should never mix, because when they do, you end up with:

byteArray = new Byte[hexString.Length >> 1];
That’s right. Don’t divide by 2. Bit shift. And nevermind that there is a builtin .Net function that does what this line of code came from. And nevermind yet again that there’s a good helping of HEX shit like this in an ASP.NET web app.

Tags: · , ,

Related Posts ↓

2 responses so far ↓

  • 1 Dave // Aug 30, 2006 at 12:34 pm

    Software engineering is still computer science — don’t trash talk the bit shift. Are you forgetting your roots?

  • 2 EJ // Aug 30, 2006 at 12:46 pm

    Don’t go there. A very large part of software engineering is code maintainability. The POS we’re looking at completely forgets elegance and maintainability.