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

by TJ Mott in CodeSOD on 2015-01-27

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); 

60 Comments - Last Comment @ 2015-01-28

Flying is Easier than Math

by Mark Bowytz in Error'd on 2015-01-23

"I travel a lot for work and watch my 'premier (elite) qualification' with United fairly closely," writes Lincoln, "Imagine my surprise when I was looking at my account and United was showing 4,100 qualifying segments as my beginning balance. Sadly, like many aspects of the new United, 4100 plus 37 equals....78."

87 Comments - Last Comment @ 22:36

Backwards Interview

by Remy Porter in CodeSOD on 2015-01-22

There are a lot of different schools of thought on administering programming tests to new hires. On one hand, you’re hiring them to program, so it might be nice to see if they can actually do it. On the other hand, given the time constraints of most interviews , it’s nearly impossible to give them a meaningful test.

Rot a renegade, wed a generator

84 Comments - Last Comment @ 13:29

Images...Why Settle for Just One?

by snoofle in CodeSOD on 2015-01-20

Grab a handful...you know you want to!We've all seen folks who have trouble dealing with for-switch statements, exception handling, dates/times and so forth. As such, it should come as no surprise that people have at least as much trouble dealing with images.

In practice, there are only so many things you can do with an image. You can load it from a file or URL. You can calculate its size. You can stuff it into some buffer. You can even display it in a variety of ways. As long as you have a graphics library handy, one would think that these things would be fairly straightforward tasks.

20 Comments - Last Comment @ 2015-01-26

For Those Who Insist on Zapping Their Tongues

by Mark Bowytz in Error'd on 2015-01-16

"Cool! Amazon now apparently offers a battery that comes in various flavors to enhance the experience," writes Evan C.

74 Comments - Last Comment @ 2015-01-19