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.
Comments
2 responses to “C and .NET”
Software engineering is still computer science — don’t trash talk the bit shift. Are you forgetting your roots?
LikeLike
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.
LikeLike