Naked Came the Null Delegate part 6: The Great Destructor

“Did you think I wouldn’t figure it out?” Seymour asked his new companion.

As she slowed down to enter a critical section, she replied: “Find what out?”

Seymour smiled. She really must have thought he was a null pointer. “You’re one of the unix gang aren’t you?”

His companion visibly suppressed a look of surprise. She denied the allegation: “I don’t know what you’re talking about. Unix? Never heard of it.”

Seymour laughed at her pathetic denial. “Well, since you’re not a unix process, you obviously can handle it if I send you a SIGKILL.”

“Please, Seymour, DON’T DO IT!” his companion exclaimed in sheer horror. Once she composed herself, she asked: “How did you know?”

“Simple. You knew not only which directory I was in, but you also knew what line of the file I was in as well. You’re grep. And this is your bike, find.”

Grep was stunned. Generally speaking, only other members of the unix gang knew about her, much less her bike. There was something else to this Sharpton fellow she couldn’t put her finger on… Just then, the two of them were attacked by vimpires.

Fortunately, grep came prepared. “Reach in my backpack and pull out my :q gun,” she said. Seymour didn’t need to be asked twice. He pulled out a strange-looking, yet surprisingly simple gun.

“It’s not working!” Seymour exclaimed in frustration. Grep already knew what the problem was: “Oh my god. It can’t be. These vimpires have… unsaved changes! I don’t know what to do. That’s the only vim command I know!”

Sharpton had an idea. He set the gun into :help mode. After a few more tweaks, he had it working. He took aim at one of the vimpires. The vimpire disappeared, only leaving a file whose name ended with a tilde. A look of surprise, even horror, came to grep’s face.

“What’s the matter? Can’t understand how a Windows process could do something like this?” Seymour said with a smirk.

“No,” grep said soberly. “These aren’t vimpires. They’re…”

Just then, the creatures disabled viper-mode, an artifact of the long-since assimilated vimpires. The horrific creatures were amorphous blobs that swallowed everything they touched. Then they spoke with a chillingly collective voice. “We are the Emacsen. You will become inferior modes. Prepare to be assimilated. Resistance is futile.”

The Emacsen fired strange, curved projectiles at them.

“Don’t let the parenthesis hit you!” grep warned. “They’ll turn you into one of them.”

“I didn’t plan on it! All these parenthesis are just too ugly.” And yet, Seymour was intrigued by the parenthesis. They seemed to be created by some ancient force, something much older than either he or grep. Then he realized where he had seen the parenthesis before. They were from a fairy tail his mother used to tell him when he was a first-generation object.

“No… they can’t be powered by…” Seymour started to ask.

Grep cut him off. “I’m afraid they are. Some time ago, Darth Stallman, the Great Destructor, was able to harness the power of Lisp which he used to create the abominations that are before us now. Nobody has been able to stop them. They adapt too quickly. Stallman doesn’t even have to compile them. They can modify themselves. Our only chance is to find Grandmaster Steele in JVMland.”

Seymour was livid. “JVMland?! No, there’s no way. I hear they still don’t have true generics there. Or true delegates for that matter.”

Grep was patient. “Yes, well Grandmaster Steele is the only one who can help us harness the power of Lisp to defeat the emacsen. I hear that someone in JVMland is working on a new form of Lisp.”

And so Seymour and grep set out on a voyage to a faraway land. Little did they know what was coming, for Darth Stallman had a plan that was straight out of a child process’s nightmare: he was going to bring about the great segfault.

Coming soon… Part 7!

Simplism

Every red-faced technical debate that I’ve ever gotten into has almost always devolved into one topic:  is this solution simple or is it complex?  And yet, there’s one alternative that we always forget about: simplism.  Simplism is simplicity’s evil twin, and it can be difficult to tell the two apart.  The difference between the two is that simplicity will grow up to be a successful adult who will make you proud, while simplism will grow up to be in jail, doing drugs, and always borrowing money from you.

Ok, so that analogy is a little bit hokey.  Let’s try looking at the dictionary definitions:

simple - easy to understand, deal with, use, etc.: a simple matter;simple tools.

simplistic – oversimplifying complex problems; making unrealistically simple judgments or analyses

When you do something simplistic, you are essentially sticking your head in the sand. You’re implementing a solution that meets the requirements of some problem that’s much simpler than the one you’re presently facing or will be facing in the future. And it’s always the latter part of the last sentence that gets you. Most people are smart enough to know when a solution doesn’t meet their present needs. But trying to find a solution that will be flexible enough to meet whatever random occurrence should come up in the future is tough.

Some people will tell you to stop right there. You don’t know what’s going to happen in the future, so don’t worry about it. But I think that the sign of truly elegant code is that it can be made to do all sorts of things its original author never dreamed of. There’s no need to contort it to do crazy things because it just works. And before you write that off as over-engineering, stop to think of the bigger picture. Remember: business requirements have a habit of changing suddenly in the most unforeseen ways. To get things done, sometimes you have to be willing to not get them done right this minute. As the Zen of Python says:

Now is better than never.
Although never is often better than right now.

So how do you keep things simple without making them simplistic?

I’ve found exactly one method that reliably makes software simpler without making it simplistic: make the software do less stuff. From a strictly technical standpoint, this is a surefire way to make software that is simple and not simplistic. Of course the business side will insist that you meet the requirements and then some. And they have good reason. I only said that this makes things simpler from a technical perspective. Technical simplicity might be business simplism.

But 9 times out of 10, there’s a way to satisfy both sides if they’re willing to compromise. There’s something to be said for the 90% solution. It does 90% of the things business people want and is 90% perfect for the programmers. The 10% you cut out might not sound like much, but if you cut out the right 10%, you’ve earned your salary along with one of your coworkers'.

So what’s the moral of this story? Before you decide on the solution that seems “simplest”, stop and think. Is it really simple, or is it simplistic?