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.

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.