TJ Mott

I've been a developer for the past seven years. Currently I'm in the aerospace industry and work with a variety of programming languages and operating systems.

Jan 2015

When You Really Want to be Sure it's an INT

by in CodeSOD on

Datatypes are difficult. So is typecasting. And if you don't understand one, you probably don't get the other either. And if you don't get either, you should probably give up on writing code and find a new career. You may get a slight pay cut for doing so, but at least you can quit spending half your salary on all those expensive reconstruction surgeries every time your coworkers go on a cluebat rampage against your face. And your coworkers will certainly appreciate not having to lose brain cells to your poorly-written functions, like these submitted by Kevin.

private int GetClassRoomArea(Int32 StudentCount) {
  return ((int)(Convert.ToInt32(StudentCount)) * 2 / 1000); 
} 

Today is Special

by in CodeSOD on

march-2011-whateverShawn's company needed a critical piece of software developed ASAP. The development team estimated six weeks of time to build it from scratch, but those in charge felt that was far too excessive. The devs had a track record of missing features--"Management NEVER told us we needed that feature!", botched rollouts--"What?! You told $newClient their site would go live on Monday? The product won't be ready until August and it's only February!", and going over-budget--"We developed it for SQL Server Express, I don't know why $phb bought us an enterprise Oracle instance."

Against the objections of everyone who did the actual work within the company, management partnered with the local University to have graduate students, most of whom had zero experience outside of academia, develop the new system for internship credit. Unpaid, of course. The plan then was that Shawn would spend "an hour or two" to polish the code up a bit and get it going in production.