Recent Articles

Feb 2006

Generic Generics

by in Feature Articles on

In the last year or so, we saw the concept of generics in managed code. Microsoft introduced them in their .NET 2.0 platform and Sun brought them into Java 5. If you haven't heard of generics before, they're kind of like templates in C++ and improve code reuse by allowing you to define classes and methods without specifying a particular type. It's a step above using the Object type because the compiler can ensure a better type safety. For example ...


The Ultimate Address Book

by in Feature Articles on

Das recently started at a small software company on the verge of completing the ultimate application: a fully-customizable system. The initial design of the system was to be so generic that they could simply edit some configuration files and go from a client management system to an order entry system. Halfway through, when they realized that they had essentially reinvented Microsoft Access, they decided to change directions and build the application towards the actual client requirements: a contact management system.

However, they still wanted their system to be fully-customizable, so they developed it so that no "business specific" information was hard coded. Instead, numbers were used for variables (e.g. V0221), classes (C0221), forms (F0221), and the "business information" was stored in the database. Some might say this is a bit of overkill for the local suburban city hall, but the designers figured that the mostly-volunteer staff might, some day, want to navigate through the maze of attribute and type configurations to redefine something like "Gender":


Of Ifs And Bools

by in Feature Articles on

It's jumble post time! Today's theme: ifs, booleans, and stuff like that.

Let's start off with Mark Glennon, who stumbled across one of the more complex ways of testing that a number is not zero ...


Certified Bumblehead

by in Feature Articles on

We don't get to see too many stories from our friends on the hardware end of things, so I thought I'd share this story that Sean Wolfe sent in ...

I was working at a medium sized "body shop" before the bubble burst days. Our internetworking team had just hired on a new engineer who dazzled them with the latest buzz-words and claimed he was a Cisco Certified Engineer. After being hired, the internetworking group had serious doubts about his skills when he responded to tech talk with rather terrible errors. They brought this up to a manager, in which they decided to follow up on his Cisco Certification, asking him to bring in a copy (letting him to believe that they wanted to add it to their "wall of certifications") he stalled various times.


Enumerating The Difficulties

by in Feature Articles on

As we've seen here plenty of times here, one can learn a lot about a system from just peeking at a few lines of code. But many times it's the enumerations defined in the system that will tell you more than you'll ever want to know. I'll leave it as an exercise to the reader to imagine the innards of this C#-based warehousing system that P.G. had the pleasure of working with ...


The Replacement

by in Feature Articles on

A few months back, Joachim Roppert had to go to the hospital for a few weeks. Unfortunately, he was in the middle of a "mission-critical" development project, so his company decided to bring on a short-term consultant to keep the project alive. They were a bit concerned about the quality of work the consultant might provide and figured that the best consultant probably charged the second highest rate. So, they hired him.

Surprisingly, the "second highest" formula didn't work out so well. Aside from setting the project back even further when Joachim returned, he seemed to have a very interesting interpretation of the coding guidelines his company requested use ..


JOIN ON WTF

by in Feature Articles on

It's a general rule that things will look better on paper then they will when built. In the world of design, you don't have to worry about things like "reality" getting in your way. Of course, when you start off with an idea like …

The database design will be fully extensible. All tables will have only a few columns (such as ID's and created dates), and the rest of the data will be stored in an XML-formatted TEXT column


Discount Enterprise

by in Feature Articles on

As a consultant who develops small- to medium-sized software solutions, Timothy is pretty used to seeing jaw drops when he quotes prices. Then again, most of the people that come to Timothy really don't need the fully-custom system they ask for, and he helps set them up with third-party software with some add-ons. Sometimes, the only thing that will do the trick is a complete information system built from scratch.

One of Timothy's recent prospects was not only shocked, but insulted that he would have the audacity to quote "six figures for a few servers and some programs." Instead, they decided to buy their own hardware and hire a team of overseas programmers for "less than a tenth of the cost."


A Career of a Web Service

by in Feature Articles on

It's a code-free post today; but that's OK. I don't think we really want to see the code behind Luther's story ...

There's a thing several states are getting into called Streamlined Sales Tax. It's effectively a way for other states to collect sales and use tax for other states participating in the program. I would like to tell you about my state's* (and employer's) attempt to implement the program.


The Secret to Better C

by in Feature Articles on

At first, Adam Quinn was a bit confused to see expressions like "repeat until(freq LT testFreq)" in the C application he was maintaining. But after a little bit of digging, he was thrilled to find the secret to "Better C" buried in an appropriately named header file.

As tempted as I was to hoard this secret for myself, I feel an obligation to share such things with my fellow programmers. Now that this well-kept "Better C" secret is in the public, I suspect there will be nothing short of a complete revolution in the world of C programming. Say goodbye to the C that you know and welcome your new best friend, "Better C" ...


Got Time?

by in Feature Articles on

Please program in more days, read the subject of one of Peter's unread e-mails. As the replacement for Noah, the company's veteran programmer, Peter was starting to get used to strange-sounding emails requesting simple hacks and tweaks to applications used by their clients. He opened up the message ...

Hey Peter -- Could you add more days into our transaction age report? Not sure if that makes any sense, but Noah had to do this whenever we wanted to run against longer periods.


Real Coders Don't Need Drivers

by in Feature Articles on

Today feels like a great day to revisit this classic post from Stian Søiland. The good news is that, since originally posting this way back in July of '04, I have only seen one or two other variations of this driver-less SQL sent in ...

When asked to fix an application here at the university that lets students create their own mailinglists, I stumbled over this python script that tries to synchronize database entries with Mailman.


Fortune Cookie Software

by in Feature Articles on

One of the greatest things about Chinese food*, aside from those sugar-coated deep-fried donut things they serve at dinner, are the fortune cookies. Really, who doesn't love those fairly cryptic and often nonsensical messages, especially after gorging on deep-fried goodness (and rice)? I can only imagine the joy that Charles Hanon must have in his job with MatWroX, some PBX management software developed by the same folks who make those fortune cookies ...


C'mon, There's Nothing Wrong With That!

by in Feature Articles on

Johannes Nordh's employer was going through big changes. They had a new image, new managers, and most importantly, a new vision statement. They also decided that they would need a fresh team of "highly talented" software developers to help realize the company's goals.

While reviewing some of the new code developed, Johannes brought up a bit of a security hole he found. At my last place we always did this all the time, the new expert responded, it's a heck of a lot easier to fix problems if they ever lose the password; c'mon, there's nothing wrong with that! ...


Code it on iBay!

by in Feature Articles on

As you may have noticed, I try to anonymize code before I post so that it cannot easily be traced back to any individual or company. When Jonathan S sent me some of the code that he came across while working at the world's number one auction website, I thought I might make an exception to the rule. After all, it is kind of interesting to see a piece of the inner workings of one of the top five websites. But I've decided to stick to my principles and conceal what company these snippets found on a single ASP page came from ...

 


Exceptional Singleton

by in Feature Articles on

Balázs Szabó worked in a large company maintaining a few modules within a huge J2EE system. The system was notorious for its complete lack of error handling, providing users (and developers) with a simple message of failure:


The Perils of Error-free Code

by in Feature Articles on

Writing error-free code in Visual Basic is a cinch; just tack "On Error Resume Next" up at the top, and you're good to go. But when it comes to Java and C#, it's a bit more of a pain. As Dave found out, you have to wrap every single line with some silly Try/Catch block ...


Pop-up Potpourri: Se7en Deadly Messages

by in Pop-up Potpourri on

It's that time again! Link to the previous: Pop-up Potpourri: Sixth Time is the Charm.


Let's kick it off with this message that Alberto Martinez Perez came across while visiting some fairly obscure news site. I wonder what the code for this Javascript-based Javascript detector might look like ...


COBOL_SECURITY

by in Feature Articles on

They say that, as a programmer, you'd better keep your skills and knowledge current, or the latest "revolution" will leave you spinning in the dust and bumped to management. Obviously, "they" haven't heard of the Microsoft's Common Language Runtime, which allows for any programming language to be adapted for development within the rich .NET platform. This means that some languages that some might consider outdated, such as, perhaps, COBOL, to become a tool for developing modern software. As you might imagine, this can yield some fairly interesting results.

One of Dan Waters' older coworker decided that, since their consulting firm no longer offered mainframe services, he should do some web development. Of course, since he had been programming since abacuses were invented (his words) and pretty much knew everything (also his words), he didn't need any training on how this "web thing" (my words) works. He was given the simplest assignment the company had, a simple "giving" page where donors entered their credit card numbers and administrators would print off and process the gifts by hand.


Let's Go Dynamic

by in Feature Articles on

Adam Machanic was reviewing code from stored procedure and noticed that there a lot of flow control logic with repetitive SELECT statements ...