Prepared for the Real World

by in CodeSOD on

Usul is taking a college course on Java programming, and it’s doing an excellent job preparing him for the real world. Already, he’s been forced to cope with someone who knows one true fact and has run off to apply it in the dumbest way possible. This would be his professor.

Our true fact is this: A Java PreparedStament object, used for running database queries, should be closed after use. This returns its connection to the pool and frees any resources the statement was using. You should do this, and you should do it as soon as you’re done with your connection.

Raiding the New Manager

by in Feature Articles on

David was recently hired on to head the company’s development team. This was a brand-new position; previously, William, the company’s IT Manager managed the developers directly in addition to his other duties.

While getting his workstation set up, he was unable to install the FileZilla FTP client. It was completely blocked via domain policy. Finding this very strange, David talked to the IT Manager and hoped there was a legitimate reason.

The Refactoring

by in CodeSOD on

I have certain mantras that I use to guide my programming. They generally revolve around this theme: "Thinking is hard, and I'm not very good at it; every block of code should be simple and obvious, because if it makes me think, I'll probably screw it up and break something." It's a good rule for me, and a good general guideline, but it's a little vague to implement as a policy.

Erika’s company wanted to implement this idea as a policy, so they set a limit on how many lines could be in a single method. The thinking was that if each method was short- say, under 100 lines- it would automatically be simple(r), right?

{{$Errord_title = null}}

by in Error'd on

"Wow! Those folks from null and undefined must be big fans! I mean, just look at that voting turnout!" Kayleigh wrote.


by in Feature Articles on

Alan worked for Maria in the Books-and-Records department of a massive conglomerate. Her team was responsible for keeping all the historical customer transaction records on line and accessible for auditors and regulatory inquiries. There was a ginormous quantity of records of varying sizes in countless tables, going back decades.

Maria was constantly bombarded with performance issues caused by auditors issuing queries without PK fields, or even where-clauses. Naturally, these would bring the servers to their proverbial knees and essentially prevent anyone else from doing any work.

The Red Queen with Alice, from the original illustrations of 'Through the Looking Glass'

Dictionary Definition of a Loop

by in CodeSOD on

Ah, the grand old Dictionary/Map structure. It’s so useful, languages like Python secretly implement most of their objects using it, and JavaScript objects imitate it. One of its powers is that it allows you to create a sparse array, indexed by any data type you want to index it by.

Catherine’s cow-orker certainly thought this was pretty great, so they went ahead on and used the Dictionary to map interest rates to years. Years, for this application, were not tracked as actual years, but relative to an agreed upon “year zero”- the first year of the company’s operation. There was a new annual interest rate tracked for each year since.

That Lying First Impression

by in Tales from the Interview on

Pickup truck with spoilers

Dima had just finished her Masters in electrical engineering, and was eagerly seeking out a job. She didn't feel any particular need to stick close to her alma mater, so she'd been applying to jobs all over the country.

Countup Timer

by in CodeSOD on

Dan has inherited a pile of Objective-C. That’s not the WTF. The previous developer had some… creative problem solving techniques.

For example, he needed to show a splash screen, and after three seconds, make it vanish. You might be thinking to yourself, “So I set a timer for 3000 milliseconds, and then close the splash screen, right?”