Dangerous Punctuation

Originally published on Figment on April 18, 2012, as a dramatization of this Github thread, in which Bootstrap opted not to use semi-colons in their JavaScript, which didn’t work in Douglas Crockford’s JSMin (and didn’t make Mr. Crockford very happy). Not using semi-colons in your JavaScript is a way to start a culture war, so I decided to write this culture war to its logical end:

THE END OF THE WORLD.

 

Dangerous Punctuation

Chapter 1

Jacob Thornton leaned back in his chair, folding his hands behind his head. He was left with another free afternoon in the offices of Twitter from all the time saved in not inserting unnecessary semi-colons. Yes, life was beautiful.

Suddenly, Douglas Crockford stormed into the office, red-faced and sweating, and bee-lined right for Jacob’s workstation. “You asshole!” shouted Doug. Jacob sat up quickly and jolted the desk, nearly toppling his mug of Stash chai green tea. Doug continued his tirade: “What’s this lack of semi-colon shit that broke JSMin? It’s insanely stupid code. Learn to write JavaScript properly or I will fucking end you.”

Quickly, Jacob assembled in his brain just what the heck was going on. For a while now, he’d been writing JavaScript without semi-colons ever since he learned they were optional in the language. It was a style of coding he’d come to love, and he’d never heard any objections about it. Recently, however, one of the JavaScript libraries that he’d open-sourced had become popular, and had apparently come to the attention of Doug.

Doug was the Old Guard, one of the early educators of JavaScript. Doug was, like, the guy that you would talk about when you talked about what JavaScript really was. In the early days of the Internet, when everyone was doing JS wrong, Doug was the guy who came along and told everyone how to do it right. If there ever was a national monument erected of JavaScript Greats, Doug’s face would be the first to be carved in stone.

And now, Doug was standing in front of him and trembling as if he might soon transform into a large, inarticulate, green humanoid.

Jacob tried to choose his words carefully. “Doug, I’m not sure–“

“Don’t give me that shit!” spat out Doug. “You know this is about Bootstrap. A well-meaning JS programmer tried to put your stupid library into my tool, and it didn’t work! And then, you had the sheer audacity to tell him that the problem was with JSMin! JSMin is perfect! I designed all of it myself, and it works with all JavaScript code, as long as they write it correctly.”

Jacob sighed. “I did write it correctly. Not every line has to end with a semi-colon. In fact, most don’t. As you’ve said yourself, JavaScript is the world’s most misunderstood programming language, and the idea that semi-colons end statements in JS is one of the biggest things people misunderstand.”

As soon as Jacob saw Doug’s reaction, he knew it was probably a mistake to use Doug’s owns words to imply there was something about JavaScript Doug had misunderstood. And he was right.

“How… DARE YOU?!” screamed Doug, shaking more violently.

“Everything alright in here, man?” came a voice from behind Doug. It was Mark Otto, Jacob’s broheim at Twitter, or so he liked to call himself. Jacob suppressed a smile. Mark always had a good sense of timing.

Doug jumped at the voice and whipped around. “I… uh…” he started and trailed off, looking between the two Twitter employees. Doug glanced around and realized that nearly everyone was watching him in the open workspace, and his anger seemed shaken upon being publicly observed, but only for a moment. Doug turned back to Jacob, his face once again contorting with rage. “Fix that library,” he said in a raspy whisper, “or get this lackey to do it for you. I don’t care. But don’t you ever say there’s a mistake in my work again.”

Doug whipped around and pushed aside a surprised Mark, who didn’t quite get out of the way in time. Doug took a few more steps, spotted a trash can, and attempted to push it over. Jacob and Mark watched, bemused, as Doug struggled against the can. Finally, Doug seemed to realize that he wasn’t going to succeed, and stood up and walked out as if nothing had happened.

Mark turned back to Jacob, eyebrows raised. Jacob leaned back and let out a long breath.

“Jesus,” said Jacob. “Jesus, man, Jesus.”

“Really?” said Mark. “I thought it looked more like Doug Crockford.”

Jacob laughed and shook his head. “What the hell, man. Dude was pissed.”

“About Bootstrap?”

“Yep.”

“The semi-colons?”

“Yep.”

Mark rolled his eyes. “These old coders and their baked-in ways. It’s not enough if your code works, it also has to live up to their standards of beauty. I’m suprised he didn’t go on another rant about four spaces versus two spaces to indent.”

Jacob grinned. “He probably would have gotten around to it eventually, but on the other hand, that probably wouldn’t break JSMin.”

“Oh, brother. JSMin. You mean the code minifier that doesn’t correctly minify unless you write your code ‘correctly’ ?”

“That’s the one.”

“Coders and their minifiers. Most of the people getting upset are probably building small-business websites. I doubt they’ve ever tested minified code against non-minified code to see if there’s any performance difference. They do it because they believe that’s what they’re supposed to do, because people like Doug Crockford have said it’s what they have to do.”

“In a blog post comparing 100,000 concurrent website requests with minified versus unminified code.”

“Exactly. And then they get righteous about it, even though their website gets 100 hits a month.”

Jacob thought about this for a moment. They were, of course, exaggerating, and likely a number of people who raised their voice about the “right” way to do things ran sites with significant loads. But, in his experience, the majority of coders who were dogmatic about what you should do were unjustifiably so. In fact, likely the reason they tried to impose their views on others was because their work had so little influence. That was one of the advantages of working at Twitter. You didn’t have to convince anyone about how you should do it. You did things the way they made sense to you and the other guys in the office, and you let the rest of the world work it out for themselves.

And they didn’t really have anything against minifiers. At Twitter, these were also necessary, because they really did have hundreds of thousands of web requests, not by the day or month, but by the minute. Yet they never minified their HTML or CSS classes, and no one ever seemed to complain about that, or insist that everyone shave off a few more bytes. It was probably too much work. Or maybe no guru had come out with a CSS minifier that they insisted everyone use. If Paul Irish tweeted about such a thing tomorrow, then they were all fucked.

“So, what do we do about Bootstrap?” said Jacob. “Anything?”

Mark sighed. “We might as well look at JSMin, since a lot of people use it. If the change is small, who cares? It’ll make Doug happy. But I don’t think we should start throwing in semi-colons everywhere.”

Jacob shook his head. “No, I’m not about to go back to a semi-colon-riddled world.”

“Yeah, stuff like this calms down and is forgotten in no time. I mean, we know that better than anyone, don’t we? People will probably tweet a bunch of angry things about semi-colons if Doug makes a fuss about it, but they’ll be back to re-tweeting Felicia Day in no time.”

Jacob nodded. Mark was right. There was no reason to let Doug get under his skin. Coding JavaScript without semi-colons was just… cooler, and he didn’t see any need to change. After all, it was just JSMin and a few other code minifiers that were the issue. It’s not like leaving off a semi-colon was the end of the world.

 

Chapter 59 (I skipped a bit.)

Fire and ashes were beginning to fall on the buildings in the distance.

“Now, you fools!” shouted Doug, not letting the eyes leave the console of the machine he had built. It was the machine that was going to save them all, and he wasn’t going to avert his focus from it, even for a moment. He reached out his hand and opened and closed his palm. “NOW!” he shrieked again.

Jacob swallowed, then quickly stepped forward and put the memory stick into his hand. Doug carefully oriented it and plugged it into the USB port.  Jacob began sweating even more than he already was. He glanced at Mark, who returned the same unspoken question: Did we do enough testing?

But they had. It was the most important piece of JavaScript they had ever written, the critical piece that handled the firing sequence for Crockford’s machine. And they’d tested the hell out of it, and had every one of their team at Twitter hand inspect it, as had everyone in the open source community. Jacob felt another twinge of guilt about some who had responded to their code by demanding the number of indented spaces be changed. He still wasn’t sure if Obama should have executed them, but because of what was at stake, maybe it was for the best. He looked at the fires outside. There was a good chance the four-space indenters were in a better place than him right now.

Doug rapidly typed some commands on his keyboard. My GOD he could type fast. Jacob watched his fingers fly as he loaded their code.

Doug took a deep breath. “Here we go,” he said in a deep breath. Everyone tensed.

He pressed “Enter”.

Nothing.

Then, worse, his machine began to make a high-pitched whine.

Doug stepped back, his eyes growing wider. “No…”

The whine in the machine turned into a clatter. Doug stepped forward and began frantically typing, amazingly at a faster speed than just before. Jacob ran next to him. “What’s wrong? We ran this through every simulation. What’s happening?”

“I don’t….”  Doug kept typing. “It’s your code,” he said with a dead finality.

Defeat and despair hit Jacob. “No, it can’t be. We tested everything. Everyone looked at it.”

Doug continued rapidly typing. “It’s failing. It’s failing on every line. It barely gets anywhere.”

Jacob looked at the screen. He saw the list of errors, but at the same time, he saw something else. It was the error console for JSMin. But it wasn’t JSMin. It was the machine’s JavaScript interpreter.

“What the fuck?” said Jacob. “This isn’t the virtual machine we tested on. Why does it look like JSMin, Doug?”

Without turning away, Doug said dismissively, “You don’t think I would just plug your JavaScript into my machine without having something check its syntax beforehand, do you? This is too important.”

The clattering in the machine turned into a loud clanking. People in the room began to back towards the door.

Jacob saw it now. Doug was insane. And his insanity was to a depth where the only JavaScript interpreter Doug trusted was himself.

And Doug loved semi-colons. And Jacob’s code had almost none.

Rage bubbled up in Jacob, and he grabbed Doug, twirling him around, looking the bearded bastard in the eyes. “ARE YOU FUCKING SER–“

Jacob didn’t remember the explosion. There was just that moment, and then there was the moment after, where he was opening his eyes. There was pain in his whole body, but as he came to and began to move, nothing felt too damaged.

He lifted his head up and looked around. Through the dust cloud, he could see that most of the room was demolished, the windows blown out. He saw Doug at the same time he saw the console embedded in his chest. Doug’s head was hanging down, motionless, his eyes peering at the console, as if he was still trying to understand the problem, even in death.

There was a coughing behind Jacob. He sat up and turned around. Mark was propped up against the wall, holding his stomach. His shirt was soaked red.

“Mark?” Jacob crawled over to him, just as his head slumped over. He caught Mark’s head in his hands just before it would have hit the floor.

Mark’s eyes were unfocused, but eventually found his face. “Jacob?”

“Yeah, buddy, it’s me. We’re going to be okay.”

Mark slowly shook his head. He knew, just as well as Jacob did. “Were we…”

“What?” asked Jacob.

“Were we… too self-righteous? Did we do it wrong?”

“No,” said Jacob, the tears beginning to fall on Mark’s shirt. “We did it just right, broheim.”

Mark sighed. “Good.” And that was the last thing he said.

Eventually, Jacob Thornton put Mark’s head on the floor and stood up. There was a deep rumbling and vibration that seemed to come from nowhere and everywhere.

He walked over to Doug’s body and looked down. Amazingly, the console embedded in Doug’s chest still had power, and even though the screen had several cracks running through it, he could clearly see a line of code and a small flashing cursor.

He recognized the code. It was a line he had personally written. But it had been altered. It looked like one of the last things Doug had done had been to insert a semi-colon at the end. The cursor was flashing after this new character.

Jacob knelt down and turned the blood-spattered keyboard towards him.

He pressed a single key.

Backspace.


Why Your Best Friend Should Always Be Joel

You Know Joel

Therefore, love Joel.

Joel Died For Your Sins

Wait, I may be thinking of someone else. Still, it’s plausible.

Joel Is Better Than Not-Joel

Think of someone who is not Joel. Are they your best friend? No. Therefore, Joel is your best friend.

Joel Will Always Be There For You

But maybe not if you don’t seal the friend deal as soon as possible.

Because Joel

There are some who are Joel-like. But they are not Joel. Joel is the best reason to Joel.


Amazing Grace

I wrote this take on Amazing Grace some time ago, and it’s still one of my favorite songs I’ve written. Lyrically, as Homer would say, it’s just beautifully sacrilicious.

Has Daddy Had His Coffee Today?

It’s sunny outside! It’s time to play!
But has daddy had his coffee today?

The park is filled with fun, I bet!
But has daddy had his coffee yet?

Maybe we’ll find the funnest spot!
But is coffee brewing in the pot?

We could skip stones down the stream!
But does daddy’s coffee yet have cream?

We’ll make the day a wondrous trip!
But has daddy had a coffee sip?

You’ve put shoes on and laced them up!
But has daddy finished all his cup?

There’s lots of things to do today!
Daddy’s had coffee!
Let’s go play!

Are You With the Right Partner?* (* NOW WITH MORE T-REX)

Original story discovered here: https://www.facebook.com/photo.php?fbid=656437111052603&set=a.560340610662254.23312430.554481657914816

And now, with more T-Rex…

During a seminar, a woman asked, “How do I know if I am with the right person?”

The author then noticed that there was a large man sitting next to her so he said, “It depends. Is that your partner?”

In all seriousness, she answered: “How do you know?”

“Let me answer this question because the chances are good that it’s weighing on your mind,” replied the author. “Here’s the answer–”

Suddenly, an individual named Jonathan Thunderous T-Rexington III cleared his throat. He was a T-Rex.

“Pardon me,” said the spectacled T-Rex, startling the humans in the seminar. “But I want to just clarify what just happened. A woman asked if she was with the right person. You,” he said, motioning with his small clawed hands at the author, “pointed to the fat man next to her and asked if that was her partner. She said, ‘How do you know,’ and then you said, ‘Chances are good it’s weighing on your mind.’ ”

“Y-Yes,” the author stammered, staring at the T-Rex’s long teeth.

“Well,” said the T-Rex, “already this sequence of events doesn’t make sense. Was the woman expressing bewilderment in that you know it was her partner? If so, this was not difficult because they arrived together and sat next to each other. In which case your answer meant you were about to reveal the ability to draw simple conclusions. Or was she literally unsure as to whether that was her partner. In which case, she has dementia, and being unsure would weigh on one’s mind.”

“Or,” continued the T-Rex, “was she ignoring her partner, and continuing with her original question. As were you, in which case this fat man is being slighted by everyone.”

“I…was there a question?” said the author.

“Terribly sorry,” said the T-Rex, “I know I tend to ramble. So, again, for clarification, does that woman have dementia and are you humoring her?”

“How dare you!” said the woman. “I honestly want to know how you know if you’re with the right partner.”

“Is that tasty-looking man next to you your partner?” asked the T-Rex.

“Yes.”

“Then I’d wager you’re not with the right partner.”

“How do you know?”

“Because you brought him to a seminar where you questioned the validity of your relationship publicly. Or because you have dementia. Either way, who your partner is does not seem like the pressing problem for you to deal with.”

“Sir, that’s quite enough,” said the author. “You are interrupting this seminar, and I’m just trying to help this woman with her relationship.”

The T-Rex frowned. “Aren’t you an author of young adult steampunk vampire fiction?”

“Well… yes.”

“Then I’m afraid you’re not going to help her.”

“Sir,” said the author. “Either sit down and be quiet, or please leave.”

“Hmm,” said the T-Rex, “I think I have a better, third option.”

And with that, he promptly ate everyone at the seminar.

Remember this always: God determines who walks into your life. It’s up to you to decide to treat your partner respectfully, or end up eaten by a T-Rex.

Why Mommy Is Mad At Daddy

Do you remember your last holiday?
When you and your Mommy travelled away?
And Daddy stayed home, with much work to do,
Even though he’d have liked to travel with you?

Well, the night before you and your Mommy came home,
Daddy was having an evening alone,
Baking some muffins with apples and cream,
And making sure all of the dishes were clean.

The kittens were fed and the beds were all made,
The shelves were all dusted and the bills were all paid.
And Daddy had fixed the bad cabinet door,
That Mommy had asked him to do months before.

Daddy was just getting ready for bed,
Excited to think of the morning ahead,
He had muffins for you, and had bought you new toys,
But suddenly Daddy heard a strange noise.

It was a low chuckle, a strange little snicker,
The laughs started slow, but soon became quicker,
And the toilet swirled and out through the hole
Burst a grinning and wet unpredictable troll.

“What in the world!” cried Daddy on sight,
But the troll only clapped his troll hands with delight,
And it jumped through the house, and it skipped and it pranced,
And wiggled its bum in a little troll dance.

“Stop!” Daddy said. “You must leave here right now!”
“Why you’re here I care not, nor do I care how!”
“But my family is coming home in one day,”
“You’re not welcome here, so you must go away!”

“That’s too bad!” laughed the troll, “for I’m here for some fun!”
“You’ll have some explaining to do when I’m done!”
And with that, the troll kicked in the cabinet door,
And dumped all the dishes all over the floor.

It grabbed all the muffins with apples and cream,
And gobbled them whole, as if from a bad dream,
And it pushed your new toys in the sink garbage grinder,
Along with the bills and the payment reminders.

And then it popped open each bottle of beer,
To make it appear Daddy’s friends had been here,
And ordered the movies that Mommy won’t watch,
And drank down the rum, and emptied the scotch.

It even took food from each of the kittens,
And destroyed all the things that Mommy had written:
Instructions for Daddy, and the time of arrival,
The things Daddies need to know for survival.

And with all of the house in complete disarray,
The muffins all gone, your gifts ground away,
The dishes all scattered, and covered in grime,
The troll clapped his hands in glee of his crime.

And Daddy said, “Please! Please fix this right now!”
“There’s little time left to turn this around!”
And the foul little troll only giggled and said,
“There’s less time than you think, when you’ll wake from your bed.”

Said the troll, “This was fun! I suppose I’ll be off!”
And into the toilet it jumped with a splosh,
And waved a goodbye as it swirled down the hole,
Leaving Daddy alone, now a poor worn-down soul.

And even though nothing had been Daddy’s fault,
He decided to bring all this mess to a halt.
He would fix all again while there was still time,
Even though, you must see, this was not Daddy’s crime.

But the little troll’s mischief was not yet complete,
For magically, Daddy forthwith fell asleep.
And he slept through the night and he slept through the morning,
Until you and your Mommy arrived without warning.

And sadly, for Mommy believes not in trolls,
She falsely thought Daddy played the principal role,
The troll was long gone, leaving only poor dad,
And that, my dear child, is why Mommy is mad
At Daddy.

THERE IS NOTHING HERE

Good day, sir.

I said good day.

The Story of Remembrance Day

A lot of Canadians have misconceptions on what Remembrance Day really is. Some of our young people even refuse to wear the red poppy, saying that it’s associated with war. Instead, they wear a white poppy with the word “peace” on it.

But their actions are seriously misinformed, and might, in fact, have the deadliest consequences. For not only is the red poppy not associated with war, the white “peace” poppy has a most terrible association: the impending Robot Uprising of 2032.

I know what you’re thinking. First, how can I know about this uprising? And second, how can it already have a planned date? And third, if it has a planned date, can we not prevent it?

You’re right to be skeptical. I myself was when I walked into that bar that night. I ordered a vodka lime soda. I’m somewhat allergic to beer, and even wine sits a bit heavy. The beer allergy seems fairly new, and I’m not sure just what the F is up, but for some reason nowadays, I have a little beer and I start to feel nauseous. (Yes, nauseous, grammar Nazis. The “incorrect” usage now has more widespread usage than the “correct” usage of “nauseated”, meaning it will soon be accepted as the primary usage. So back off, I’m trying to have a drink here.)

Anyway, I was at that bar, and I decided to just find my own booth and play some Fruit Ninja. It had been a while since I’d played it, and like many games on my iPhone, it had a few weeks of novelty and regular play, and then it suddenly vanished from my life like I had never derived pleasure from it. But, there was this part of me that just wondered if it was an attention span issue. Is it possible I was done with the game, or had something newer and shinier simply distracted me from it?

“Is that Fruit Ninja?” said a voice.

I’m going to skip ahead a bit. The guy in the trench coat turned out to be a robot and told me about the Robot Uprising of 2032. Obviously, I killed him by surreptitiously connecting to his wi-fi radio  and uploading a virus via the iIndependence iDay app.

Oh wait, I almost forgot, there was this one part where he told me about how the white poppy was part of the assimilation program, using widespread social programming. But then he also seemed to suggest the red poppy was part of some prior effort? Guys, I don’t know, truth be told, I’d actually had quite a few vodka lime sodas.

Here’s the takeaway: Fruit Ninja is still worth playing. But I think we can all agree that it’s a relic of the past that we’ll soon leave behind.

The Night Before Christmas* (*NOW WITH MORE T-REX)

‘Twas the night before Christmas, when all through the house
Not a creature was stirring, not even a mouse;
The stockings were hung by the chimney with care,
In hopes that St. Nicholas soon would be there;

The children were nestled all snug in their beds,
While visions of sugar plums danc’d in their heads,
And Mama in her ‘kerchief, and I in my cap,
Had just settled our brains for a long winter’s nap —

When out on the lawn there arose such a clatter,
I sprang from the bed to see what was the matter.
Away to the window I flew like a flash,
Tore open the shutters, and threw up the sash.

When, what to my wondering eyes should appear,
But a full-grown tyrannosaur, his mouth full of deer.
“What the devil!” I said, alarmed and stared down
At the T-Rex before me, and soiled my gown.

The creature turned sharply, at my sudden shout,
Sniffing the air with its great bloody snout,
And it stepped towards the house, with its giant clawed toes,
And crushed a small sleigh that was parked in the snow.

Mama, by this time, had laid eyes on the ‘Rex,
And I covered her mouth, lest a scream further vex,
And I held her to me, and whispered in haste,
“Our movement is what T-Rex vision is based!”

He stepped toward the house, his nose sniffing the air,
He knew there was prey, but for now, knew not where.
The shutters did rattle with each step that he took,
And my teeth went a’chatter, and my arms and legs shook,

But still we did stay, as his nose touched the shutter,
And we both held our breath, so no sound we would utter,
When suddenly David, our youngest of boys,
Opened our door, to study the noise.

And stopping all thought, I rushed to the door,
Provoking the ‘Rex to let out a roar,
And the scream now came quick, from Ma by the bed,
And now I was sure that quite soon we’d be dead —

When the dinosaur stopped, and his eyes rolled around,
And to our surprise, he fell straight to the ground.
Everything shook with a terrible rumble,
And I crept back to see what had made the beast tumble.

The ‘Rex lay below, a long dart in his neck,
And a man in red robes held a gun on the deck,
He stepped to the beast, and he gave it a kick,
And I knew in a moment it must be St. Nick.

St. Nick gave a sigh, for the T-Rex was beaten,
But not before several deer had been eaten,
He stood there in front of the slumbering beast,
And called out the names that had been a ‘Rex feast.

“Now! Dasher, now! Dancer, now! Prancer and Vixen,
“On! Comet, on! Cupid, on! Donder and Blitzen;”
Why he called them by name, I at first did not know,
But from the beast’s mouth there now came a strange glow.

And the gun in Nick’s hand, strip’d in red and in white,
Began also to glow with a brilliant light,
When, what to my wondering eyes did appear,
From the jaws of the ‘Rex, eight living reindeer.

They swept out of the mouth, as St. Nick waved the gun,
But here, the night’s magic had only begun,
With a sweep of his arm, at what remain’d of the sleigh,
It righted itself, and all hurt poofed away.

His eyes — how they twinkled! His dimples: how merry,
His cheeks were like roses, his nose like a cherry;
He twirled his gun, which now seemed a wand,
As a bundle sprang forth from the beast there in slumber.

The bundle of toys flew then straight to his hand,
And he shook as he laughed, what a marvelous man!
He turned then to us, Mama, David, and I,
And gave Dave a wink, with a gleam in his eye.

He opened the bag, and pulled out a toy,
And quick with a spark, it flew straight to my boy.
The three of us laugh’d, the horror now done,
Fix’d by St. Nick and his magical gun.

The rest of the children now rushed in to spy
What transpir’d in front of Ma and David and I.
Their eyes bulged out wide at the sight down below,
A giant T-Rex and St. Nick in the snow.

He gave us a wink, the jolly fat wizard,
And sprung to his sleigh from the thunderous lizard,
He placed his gun in a rack, and he tied up the deer,
He threw the toys in the back, and danced with good cheer.

He sprung to the seat, and then gave a whistle,
And away they all flew, like the down of a thistle:
But I heard him exclaim, ere he drove out of sight —
“Happy Christmas to all, and to all a good night.”

O I wish I could say that all had been mended,
That Christmas had come, and terror had ended.
I had thought we had faced all the trials we could take,
When the T-Rex below us
Began to awake.


Notable Awesomologist

I was interviewed recently by Matt Posner for the School of the Ages blog. Check it out!

http://schooloftheages.webs.com/apps/blog/show/34609815-author-interview-awesomologist-matthew-dean