Archive for the 'geek stuff' Category

Why Postel’s Law is awesome

Caveat: Web standards are good. Everyone knows this. Without standards we’d have anarchy, or anyway we’d be stuck in the late 90s, trying to implement as many versions of our webpages as there are browsers. In my opinion, this does not at all mean that Postel’s law is wrong.

Be conservative in what you send, liberal in what you accept.

Lets start by taking a step back. What made the internet into the thing it is today? What makes it so appealing for so many people, all over the world? I’m willing to venture some of these things had something to do with it: free content, diversity of content, breadth or scope of content, and ease of access to that content. The internet is SO amazing because it is so diverse, and so immense, and so incredibly huge.

Sure, technology is cool. I personally find all the latest trends in programming to be really cool. But the technology that runs the internet is just one very narrow slice of content. It’s no lie: Content is king.

Now why is the internet so huge? How come there is so much content? Well, the answer to that is Postel’s law. Or rather, the answer to that is that early browser developers adopted Postel’s law. Because they made it easy enough to put stuff on the internet that pretty much anybody can do it. And they did do it! And that’s why the internet is so fucking awesome!

Can you imagine how much more frustrating web content creation would be if you saw errors every time you fucked up some html? Yes, for those of us who are web development professionals, it can occasionally be frustrating when the browser doesn’t tell you what you’re doing wrong… but this is an argument for better debugging tools, not for stricter html. I mean, do you really think debugging should be turned on by default? Hell fucking no!!! I know I laugh whenever I see backend error messages on a webpage. Fucking amateurs!

So IMHO it’s only fitting that each new version of a browser, or each new version of a web standard brings with it new pains and frustrations for those of us in the web development profession. After all, it’s our job to make sure this stuff works… We get paid the big bucks for those pixel perfect designs!

But if the browser developers are doing their jobs right (and damn straight the standards people better be doing their jobs right), content creation should only ever get easier. After all, it’s what makes the interweb such an amazingly awesome thing.

Joel on software has lost all my respect.

I have really enjoyed, or at least learned from Joel Spolsky (from Joel on Software) in the past. But his latest article has me wondering if he isn’t a M$ weenie (and a dickhead).

I don’t link to stuff that I don’t like, so I’m intentionally leaving the inspiration for this post unlinked. The name of the article was “Martian Headsets”, I’m sure you can find it if you want. If someone hadn’t sent this out at work today, it wouldn’t even necessitate a response, but they did, and I now feel the need to comment on how much I do not appreciate his bullshit rant.

I guess the thing that most pisses me off is that he’s actually trying to incite the very flame war that he “predicts” in his article. His main strategy seems to be making us all out to be at one end of two extremes. There are two kinds of web developer (or perhaps browser developer): “Idealists” and “Pragmatists”. He’s implying that pro-standard means anti-backward compatibility. He’s also implying that pro-pragmatism means anti-standards. Neither of these are even remotely true.

Anyway, the article is written with a very subtle sympathy for microsoft. The bulk of the article consists of a long-winded and misleading analogy involving martian mp3 players. (M$ is supposed to be the developer of these mp3 players, which are supposed to represent IE8.) Initially they make the players, and also the headphones. (In the analogy, the headphones are webpages.) So you can see right away how stupid his analogy is… if we “buy” this analogy, then at some point, M$ was somehow the sole browser developer, and they also developed all the webpages. He just keeps piling more and more shit onto this analogy, trying to sell us on this idea that the more webpage developers and browser makers there are, the harder it is for M$ to write a decent product. Oh, poor microsoft!

Go Team Clockwork!

Watch the F1 youtube video.

F1 Website Challenge

A few months ago, Chris linked me to Sierra Bravo’s F1 Overnight Website Challenge. It’s somewhere between a grownup lock-in, a charity event, and work. The premise is that you (as a developer) sign up to help out a bunch of non-profits spruce up their websites in 24 hours. I thought it sounded like fun, and signed up. I also conned a bunch of my co-workers into doing it too, so we’ve got a team that’s worked together before, and should be able to actually pull something together in the alloted timeframe.

Chris isn’t local anymore, so he won’t be there (too bad, really), but there are a surprising number of other people I’ve worked with who are also doing the event. I’m looking forward to seeing (and competing against) approximately eighty other web developers all at once.

I’ll have my camera with me, and definitely intend to do some flickr uploading while I’m there. (Or if the network is bad, after it’s over.)

Wish me luck!

disturbing iphone correlation

I have to do more testing to be sure, but I think I’ve noticed a disturbing correlation between days when I listen to music on my iPhone on the way to work, and days when my iPhone decides to randomly show “No Service” and disconnect itself from AT&T.

I don’t really use my phone as an iPod all that often, and this issue hasn’t shown itself all that often either.

Notably:

  • A power-cycle has (so far) always fixed the issue.
  • I usually just unplug my headphones when I get into work, having verified once or twice that this “turns off” music playback.

Anyone else noticed this?

MinneWordCamp anyone?

Even though it makes me cringe every time I look at the code, I have to admit that I <3 WordPress. That is why I added my name to the Sign Up list over at the MinneWordCamp wiki as soon as I heard about it this morning.

Con-damnation!

I was just reminded about Con of the North, which is a local gaming convention. I’ve been meaning to go for years, but I never really know when it is. Well, guess what, it’s this weekend.

But I’m already signed up for Frozen Perl on Saturday, so I’ll probably just pay the one-day fee, and go on Sunday or something. (I have plans Friday night to see Jumper with Florence.)

In con-pletely unrelated news, I am someone’s version of nice stuff.

BigText.org

I spent a bit of time (probably too little) one afternoon this week searching for a website that created ascii versions of text. Instead, I found a command line utility called FIGlet, and approximately 4 hours of dev time later, (including 3 hours after about 11:30pm last night), BigText.org was born onto the internets.

Feedback is welcome/desired. I’m especially curious whether anyone can break it, as obviously security is a concern.

UPDATE: There are many other web-based figlet servers out there. I’m glad I didn’t notice them until now. I probably would have given up.

Typography in Code: A Field Guide to Whitespace, Part 1

We all know what we like and what we don’t like when it comes to whitespace in programming. I can only speak for myself, but here are some elements to consider.

One of the universally accepted natures of code is to indent where appropriate, and this first installment of Typography in Code: A Field Guide to Whitespace will focus on the various incarnations of the all-important topic of (queue thundering god voice) indentation.

Topic: Tabs versus Spaces

This primordial, often invisible question is at the heart of the indentation beast. Like good and evil, right and wrong, vim and emacs — tabs and spaces are diametric opposites, warring factions facing one another across a never-ending epoch in which all our text files are smoking battlefields. One kicker is that both sides use ninja assassins. YOU CANNOT SEE THEM COMING, until… that is… you find them lurking in your legacy code, buried at the beginnings of lines near the ends of your files, like trip mines in long forgotten functions.

This is when you spend hours constructing that one perfect regex to rid your code of the enemy once and for all. (Also, unless, of course, you are one of those odd ducks who likes to see their whitespace characters. I respect you, even if you are crazy.)

Where I fall on this fence: My heart titters for tabs. But I didn’t always believe in them! I admit it, I was once an indentation swing state. But here’s why tabs are king for indenting: Tabs are like using semantic markup. We all (mostly) want code to all indent the same width (no matter what that width is), and a single tab character means that width. You can even change this width (tab stop) with a single command in any decent editor. This alone should be enough for the triumph of tabs over spaces.

Topic: How wide?

Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3. (Linus Torvalds, From Documentation/CodingStyle of Linux, via wikipedia)

This is a trickier beast. I believe in the power of four. It’s more legible (discernible) than two, especially across dozens of lines, and eight is just too wide a gap. With a tabstop of eight, you only get ten indentations before you’re out of 80 column width entirely! This is as opinionated as I get, since four just looks right to me, and I can’t really cite any good reasons for it. Just take it from me: you’re an IDIOT if you prefer anything else.

Yea, and the number of spaces to equal one tab shall be four. No less, and no more. The number shall not be three, and the number shall not be five. Fuck that the number shall definitely not be odd. The number shall not be two, and the number shall not be eight. The number shall be four.

Truthfully, I don’t care what your tabstop is set to, as long as these things are true:

  1. I can set my tabstop to something different and the code doesn’t look all fucked up. This means, yes, tabs.
  2. Never use a combination of tabs and spaces. (Fuck you, default dreamweaver settings.)
  3. Tabs should never be used anywhere but at the beginnings of lines. (This violates #1, but is also a really bad practice for other reasons that maybe I’ll get into in a later article.)
  4. Consistency, consistency, consistency. (WTF BSD, WTF!?)

Extra Credit: Read (and care about) the wikipedia article on Indent Style.

Next topic: How many line breaks look the best: Between Function Definitions, In Functions, Around Comments, and more!

TypeSites

I love typography.

It’s true. I always have. I think think that, in the same way that most writers love words, for some of us, it just keeps cascading down. A love for prose and poetry leads to a love of words, which leads to a love of letters, which leads to a love of the shapes of letters… and then the spaces between letters… etc… etc…

Today my friend (and co-worker) Kyle launched http://www.typesites.com/, “a biweekly showcase of websites with interesting typographic design”. There’s just one review there… (for now), but it’s getting some attention already.

There was a brief time when I thought I would become a designer. But really I just wanted to shape letters on a page. I think this is part of the reason I ended up designing everything in black and white. For example, my brother Dan’s website, which I designed for him back in something like 2000, basically just uses his old email signature’s ascii art as navigation and design element. (I spent part of this last weekend re-vamping that site so he could use wordpress to manage his pages.)

In my present occupation, programming does actually fill some of these same needs. (I’m a bit of a syntax fascist, enforcing strict whitespace rules whenever I can.) Which leads me to an article on the typography of code, which another co-worker sent around the office today. I liked the article, but think it spent all its efforts on the fonts the author uses (or has used) to write code, which is really only one aspect of typography. I’m contemplating writing my own article, about the arrangement of code independent of font, a sort of field guide to whitespace in fixed width font environments. Then again, I’m lazy, so don’t expect it any time soon…