usable in any place a human can be used

Showing posts with label rant. Show all posts
Showing posts with label rant. Show all posts

20110318

Fuck You Internet Explorer

[caption id="attachment_907" align="alignright" width="360" caption="This is for you IE"]Girl holding sign reading "Fuck You"[/caption]

Be Warned: This post has very little technical value, more just a rant against my most hated enemy


I hate Internet Explorer, with a fiery passion. Normally I just code along in beautiful browsers and use cross browser CSS and JavaScript frameworks. It's gotten to the point that I can code something up in Firefox and make it pretty and go over to old IE-saurus Rex and load it up and it looks 90% of the way there and a few hacks later it's fine. You see I still hate IE, but I've ingrained in my brain somewhere what things are "safe" and will probably work in that POS browser and which will require hours of tweaking, reading, googling, hacking, gnashing of teeth, and general misery. I try to avoid the latter.


So If I've developed this system to insulate myself from the misery of IE, why the hate today? IE9, that's why. I've read several reviews both positive and negative, but at the end of the day I'm not switching browsers, so I really care about one thing and one thing only, does IE9 make my job as a web developer better or worse. I've come to the conclusion that it's worse, and for that I have a lovely pile of "Fuck You" cake sitting right here with IE's name on it.


Not Available for Windows XP


First of all, IE9 is not available for Windows XP. Great, game over right there you fucking idiots. I don't think people should use 10 year old operating systems, but people are stupid, see: the continued popularity of American Idol for proof. Firefox is taking the responsible route and helping these poor souls bring their browser into the 21st century even if they are fine with an ancient OS. As Firefox Engineering Director Johnathan Nightingale says about XP, "...the best metrics that we’ve got say 40 to 50 percent of the web is still on XP. That’s too big for us to just leave them behind"


Missing a metric ton of shit


IE9 is just missing a ton of stuff. Stuff that web developers care about, stuff that would make our lives easier and happier, stuff that IE9 rapes right before sleeping soundly on a pile of skulls. Paul Rouget of Mozilla makes this case, let me quote some of the juicier parts.


No CSS3 for you

Here's a list of CSS3 stuff IE9 won't support: CSS3 Transitions (for animations), CSS3 Text Shadow, CSS3 Gradients, CSS3 Border Image, CSS3 Flex box model. Great news, don't put photoshop away just yet, you are going to need 1px wide gradients and text with shadows baked in, and fuck it.


Suck it UX

Hoping you might get HTML5 History API, Drag'n Drop from Desktop, or Web Workers to speed up your applications. Not with IE9 you won't.


Not the point though

Let's not get caught up in a feature list shoot out though, because that's not the point. Let's move onto the next subject.


Fractured even further


Does IE9 make my job easier, nope not at all. Microsoft's all consuming obsession with backwards compatibility means that they won't force anyone to upgrade. While other major browsers are moving to a model of strongly-recommended / automatic background updates to keep everyone on the latest and greatest, Microsoft is still playing the game by the old rules. Now the browser landscaped is fractured even further, I have to make sure my code works in IE6, IE7, IE8, and IE9, and if I want to be really sure I should also check in IE7-compatibility, IE8-compatibility, and Quirks Mode. Microsoft has never made it easy to run different IE versions side by side, I've used several products to do this and they all work to varying degrees. Now I will have to run another different virtual machine with either Vista or Win7 so I can test in IE9. And with no / terrible developer tools for all of these browsers, well its a fucking nightmare.


Conclusion


I wish I had one. At this point the only thing I've concluded is Fuck You Very Much Internet Explorer. Here's an idea, stop already Microsoft. I don't care how good you make IE10, the fact of the matter is that since you won't force upgrades, it isn't fucking helping. The only thing you are doing is making more work for the people that actually make the web beautiful. I fucking hate you. Fuck you very much.

20101004

sanity please

I'm sure this tale of woe will be shared by many of my web development colleagues, it has to do with Facebook. As a web developer I have to pay a Facebook Tax, Facebook has an API (I think they might be up to their fourth API now) and they have 500 million people, and so management everywhere wants their product to integrate with Facebook. Here's the problem, Facebook fucking sucks at documentation.


There are as far as I can tell at least 4 competing technology stacks going on over at Facebook: FBML, Javascript SDK, Old REST API, and Graph API. There could be more, some of those might not be fully APIs and are just components, I'm not really sure. I've been reading the pages at the official documentation website for weeks now trying to wrap my head around this thing. Maybe it's just me, maybe I'm dense or something, but I can't seem to figure out what the fuck is going on or what I should be using.


Here's a great example, let's say you want to integrate Facebook Connect (if that's still a thing, I'm not really sure), but more succinctly you just want to allow users to sign in using Facebook as their identity provider. How are you supposed to do this. Well there is this section on Single Sign-On that looks promising. But then later on if you follow the link to learn more about the Graph API you will find a section about Authorization that will lead you to this page on Authentication which I think is showing you how to do the same thing, maybe.


The problem seems to be too many ways and pages explaining the same thing or slightly different things, I just want one canonical authoritative place to look that says, "This is the API you MUST use for Authentication." I don't think that is asking too much. But I'm sure once I finish my primer on OAuth 2.0 and figure out how the extended permissions works it will all be more clear.


The API could be forgiven for giving you more than one way to skin a cat, if it then gave you specific details on how this stuff actually works. Let's say I want to build a website that displays events and then let's people use my website to mark themselves as attending that event in Facebook, is that possible... I have no idea. Here's a section of the Graph API about Publishing data to Facebook and it might be in there somewhere, but I can't tell. I guess I'll have to play around with how this supposedly RESTful API works when I have some state, maybe if I've successfully negotiated an OAuth Secret Consumer Token UID then I can call /EVENT_ID/attending and that will mark me as attending the Event with EVENT_ID, it seems to make sense a little bit, but the extremely helpful description of "attend the given event" and the arguments of none make me have to play around to figure it out.


Seth Call is similarly frustrated and makes a very nice detailed case for why the Facebook API is so woefully inadequate. I couldn't agree more, and I hope that help is on the way.


The problem I'm running into now is frustration and discoverability. There doesn't seem to be a particular flow to these documents, they are just disparate documents hyperlinked together in no particular order. I'm new is there a tutorial or common use case section, maybe somewhere buried 9 links deep. If you are going to embrace and extend then at least have the common courtesy to make our lives easier as you try to take over the world.


Facebook seems to have too many developers working in the API space not communicating, the "Old" and "New" APIs overlap in some areas and miss each other in other areas, there's no definitive answer on when support will end for any of the "Old" APIs, is it safe to use the "Old" REST API for functionality the Graph API doesn't support or will they turn off the tap at some point. When trying to navigate through the documentation it just feels like they made someone do a braindump and didn't try to organize it in any fashion.


Well I'm going to head back in because with the draw of 500,000,000 potential users we can't afford not to pay the Facebook Tax, which is a real shame considering how shitty the Tax Code they published is.

20100407

sitting

[caption id="attachment_827" align="alignright" width="300" caption="In case you didn\'t read it: None of Us is as dumb as All of Us."]meetings demotivational poster[/caption]

<rant>


There is a lie we like to tell ourselves that goes something like this, "I am in control of my life." You are not, it's a cultural lie though, one of those things that we've all agreed makes us feel better so we politely nod our heads and lie to each other and all get through the day a little easier. It's similar to that radical 90's style lie I grew up with during school that went something along the lines of, "Everyone is special and magical and made out of ponies." Everyone gets a trophy, even if you didn't win, because you are special just for trying. It's a lie that everyone knows is a lie, but it makes people feel better, so what's the harm.


Well over the last few months it's become apparent to me that these things are lies, that I'm no more in control of what goes on in my life then my dog is of his own. At any moment someone could walk through the door and kill us all just for laughs, or someone could hand me a million dollars. The uncertainty of it all is unsettling and exciting. The one thing that has slowly crept into my life recently is the subject of my post, and that is the hallowed institute of meetings. Somehow I went from a code ninja hacking down mountains of whatever was thrown in front of me to a table jockey. I am now scheduled to attend no fewer than 8 meetings per work week.


That works out to 1.6 meetings/day, and rest assured there is at least 1 meeting everyday. I know people that do nothing all day but meetings, it boggles the mind. I would say that I "hate" meetings, but that really doesn't convey the depth of my loathing for them. Meetings are the bane of my existence, I could stomach maybe 1 a week, a short sweet status meeting, but what I can't handle is the bread and butter corporate meeting, and I'm going to detail why.



  1. Marketspeak: I don't know what the fuck happens to people when they get in meetings but everything, everything gets some fancy new moniker. Sure I could say that I'm working on some stuff, but wouldn't it be better to say that goal-forwarding has been achieved on several Tier-1 action items. There are no people anymore, just assets and resources, dehumanized by the cruel tongue of Marketspeak. Every concept, no matter how simple, is wrapped in shiny new clothes, as though you might confuse the dog turd covered in whipped cream as a delicious fudge sundae.

  2. Teleconferencing: There is always some person (sorry, meant to say "stakeholder touchpoint") who thinks its appropriate to call into the meeting on a 1992 Nokia Celfone while in the middle of a monsoon while driving through a tunnel. Bonus points if this person has a thick accent that makes even high-fidelity communication less than understandable. The other issue is having 10 people on one side of the conference line and 10 on the other, and the fun of each side trying to figure out who is talking.

  3. Pointless Status: Managing people is difficult, so management is obsessed with the idea of status. The problem is that status is normally not quantitative but qualitative, too bad that doesn't fit into the Holy Spreadsheet. People are forced to turn things into percentages, I'm 80% done reflanging the spline, even if that doesn't make any sense. Status reports are a proxy for involvement, they are a way to feel connected to a process you don't have any part in.

  4. Workturbation: Meetings are insidious, if you have 8 hours of meetings you will go home mentally exhausted, more than likely frustrated, and with a feeling that you've really put in a hard day's work. The problem is that when you try to figure out what you've actually accomplished the list is either non-existent or incredibly paltry. Meetings feel like work but rarely accomplish anything of actual significance. Meetings also have the incredible ability of spawning meta-work just for the sake of the meeting itself. Before the meeting you have to prepare whatever pointless agenda you have for your meeting, secure a place to have the meeting, work around everyone's schedules. Afterward someone prepares the minutes and it gets emailed to the companyname-all mailing list where inevitably the tiny list of things that were actually decided are rehashed again and again. Personal bikesheds are floated around, and more than likely all the chatter on the email list will require ANOTHER FUCKING MEETING to sort out.

  5. Punting: Punting is the amazing technique where something interferes with the meeting so it is moved down the road to another meeting. Punting is sometimes necessary when someone wants to discuss in detail some trivial point, but the best and most frequent kind of punting is the following. Design meeting is convened, difficult non-trivial thing is brought up that requires actual thinking and problem solving, meeting participants get frightened by the idea of actually having to dust off the critical thinking part of their brain instead of blithely parroting made up statuses of underlings, issue is tabled to be dealt with in the future, a piece of me dies inside. Keeping the meeting moving becomes MORE important than getting anything decided or accomplished.


The list is in no way exhaustive or universal. At the end of the day though, a meeting is taking up time you could be doing something, they should be looked at that way. All that time you are sitting in meetings talking about all the stuff that could be getting done if everyone wasn't stuck in meetings all the time... my head hurts. What we need are people with their hands on the problem empowered to make decisions and move things forward. Then we can meet once a week to talk about how things are going, instead of sitting around all week wondering why nothing is getting done.


</rant>

20100223

to tweet or not to tweet

[caption id="attachment_758" align="alignright" width="300" caption="web 2.0 kids these days with their tweeters and facespaces, I used to have to text on a 12-button phone and I liked it!"]twitter bird[/caption]

Ever since I started writing ihumanable.com so many many years ago (actually it was the beginning of October) I have tweeted the birth of every new blog post. For those who follow me (see the button at the top of the page to join the elite group of @ihumanable followers) I expect that you spend most of your day with bated breath waiting for the singular moment of glory that a new ihumanable blog post is ready for your consumption. I was pointed to an article today by Shawn Blanc about how to handle the tweeting of blog posts. The logic boils down to the following




  1. Some folks don’t care a dime about my nerdy posts, but have great concern about what I eat for lunch.

  2. Some folks are already subscribed to my RSS feed and would prefer to keep it there and nowhere else.



The solution Shawn Blanc comes up with is to have two separate twitter accounts @shawnblanc for personal "what I ate for lunch" tweets and @shawnblancnet for stuff about his blog. So the question that leaps to your mind is, should you immediately start following @ihumanablecom for all the updates about the great free content / ranting with oddly captioned pictures that I produce? No, no you should not, and I'm about to tell you why.


I have an RSS feed and twitter, some people would argue that I shouldn't tweet about blog posts because what if someone is both subscribing to my feed and following me (thanks to anyone who is so devoted). This poor unlucky bastard will get the grand news of a new post in gasp 2 different places.


This argument doesn't make much sense to me. Twitter is passive, it is the un-email. You follow people you like, you see their tweets, there is no "unread count" or really anything expected at all by the tweeter from the tweetee. This is why people love to tweet, its the best part of any conversation, the part where you are talking. Look at some of the recent important tweets.


Faught an old man for a parking spot at ihopp - AmandaSollenne

A man is a man when he can offer his hand. The Who - wealthmoneynow

Straight up doing nothing. Have a dentist appointment after school. then have to go to court for 5:30. Then have a bunch of homework. Great. - JamieBaskett

Now I'm not picking on these people (I don't even know them) I just went to the public timeline to see what was currently running through the tweet stream. The point is that these are low-value easily ignored communications. If something shows up in your tweet stream that you don't care about, at most its going to waste 140 characters of mental processing power.


The second argument is that somehow people could care more about what I had for lunch than my blog. What I have for lunch is some meaningless data point about my day it means nothing to me (although today's Grinders Chicken Parmesan Stromboli was amazing). This blog which I spend all kinds of free time and energy on actually means a great deal to me. I want to be out there promoting it and if you are following me on twitter I would imagine you would want to see the things that are important to me. If not then why are you following me.


I have people following this site on RSS and people following me on Twitter and I would imagine its not a perfect overlap. When I first started this blog I had no RSS subscribers because it was fresh and new, so I promoted it with a simple (usually less than 140 characters) tweet, one per day. Now I have people following me on twitter solely because of this website, and it would be a disservice to them to stop tweeting about the blog posts now, changing the rules all up midstream.


This blog is important to me, me @ihumanable. The things I write here are an expression of the frustrations, lessons, and victories that make up my life. I could easily start an @ihumanablecom (if its not taken) twitter account and tweet new posts out through that. But that doesn't make sense to me, @ihumanable is where I tweet things about me, ihumanable.com is about me, and so tweets about ihumanable.com will continue to be broadcast through @ihumanable.


The argument against blog post tweets fails to understand the very nature of twitter, it is a passive, non-blocking, stream of information. If someone is spamming hundreds of tweets a day about pointless blather (well then they are probably using twitter) then stop following them. If someone is trying to share something that they have worked hard on and care about once a day, then I would hardly think we need to erect walls of netiquette around it.

20100212

arbitrary

[caption id="attachment_730" align="alignright" width="199" caption="Fucking arbitrary decision, but a good one!"]Lion riding a horse[/caption]

Rant time, oh it's Friday rant time! You see we are making progress on our project at work up to the point that I will be traveling to beautiful Indiana next week to get some specialized training and toolkits. It's a big deal for our project and we are all very happy, I'm glad to get to be an important part of all this and actually look forward to it. I will be heading out there with two other guys from the company and they will be leaving on Wednesday while I stay until Friday. Here comes the fun part, how to drive around after Wednesday?


Rent a car! I hear you shouting at your computer (don't worry I can't really hear you, you are just very predictable). Well it may shock you to find out that I'm only 24 years old and because of the actuary tables I am not allowed to rent a car. You see you have to be 25 years old to do certain things, like rent a car or hotel room or get a nice break on your car insurance. Less than 25 and you are a hellbent young rogue ready to destroy any car you get your hands on. It doesn't matter that I've spent the last 6 years working hard studying at University to get 2 degrees or designing software for a Fortune 1000 company, no the table says 25 years old and by the hammer of Thor we are going by the table.


Now there is a monkey wrench, one I'm sure we'll get settled and figured, but it's not the first time arbitrary decisions have been made that have negatively impacted me, and it probably won't be the last. On this current project we deal with messages and messages have many pieces parts, in the old system you could have thousands and thousands of different pieces parts. In this new system you are limited to about 1,000 unique parts, it has been a challenge trying to figure out how to get everything to work. Is there some reason for this, NO! its completely arbitrary, they just chose a large number, and in the next iteration of the product that limitation will be lifted.


I remember hearing a story from a fellow developer about how new software was installed that all webforms had to send their data to so that it could be sanitized (despite the fact that it was already being sanitized by our program). This new cog in the machine had a limit of 100 fields per form, now only in the dreams of a fevered madman would you need more than 100 fields. Well it did, it was a complicated form dealing with complicated government requirements and to make it easy for the user it was dynamic and beautiful and everyone loved it. Then they had to completely break it, make it work in chunks and find some clunky workaround so that it would never submit more than 100 fields, the users hated it, the developers hated it, everyone hated it. Some digging went forth and the 100 field limit was completely arbitrary and you know in the code somewhere was something like this.


[java]
FormField fields[100]; //No one will ever need more than 100 fields
[/java]

This arbitrary decision causes a world of hurt. Now we don't want to go down the super configurable, just change this XML file which will regenerate this XML file which will be used to partially populate this .properties file which will be dynamically.... fuck you. Just that if you have limits there better be good fucking reasons, or else remove them.


If you are going to limit me to 140 characters there better be a good reason, oh because of the inherent limits imposed by SMS, fine Twitter I understand perfectly. You can't open two spreadsheet with the same name even if they are different files, what are you doing Excel?!


The next time you are about to code something that will result in a clearly arbitrary error message down the road, you better have a good reason to. There better be some sort of machine limitation or design limitation or something, because its not the limit that pisses people off, its their arbitrary nature.

20100203

bureaucracy

[caption id="attachment_677" align="alignright" width="300" caption="Wait until he meets the Undersecretary for Reduction Planning and Appropriation\'s new Assistant"]pentagon bureaucracy cartoon[/caption]

Bureaucracy, long the scourge of people who want to git-r-dun. There are some people out there that hate bureaucracy with a passion I can only really muster up for the pending zombie apocalypse. Make no mistake about it, I dislike bureaucracy, I think it is a wasteful but sometimes necessary evil. I've found myself ensnared in a bureaucratic nightmare for the last few months so I thought I would jot down some observations on bureaucracy.


Zombie Bureaucracy


(Wow lots of zombies in this post so far) A Zombie Bureaucracy is a bureaucracy that had some reason (however flimsy) for existing in the past but no longer needs to exist. Not unlike a zombie this bureaucracy manages to live long past its usefulness shambling into the future pointless and frustrating. This is caused by the ease that more bureaucracy can be created, at the stroke of an email someone can dream up a committee or process, but the difficulty in disbanding bureaucracy. It is disproportionately difficult to reduce bureaucracy because it looks like work, and people don't like having their work taken away, it reduces their sense of job security.



Dev: Why do I need 3 developers to sign off on every commit?
Mgr: Because 4 years ago two of the lead developers got into a pissing war over code formatting
Dev: Why didn't they just work it out?
Mgr: Because they had huge egos and management was too scared to fire either one
Dev: Is this still going on?
Mgr: No, Frank left 3.5 years ago because he didn't want to put up with Mark anymore
Dev: So why do I still need 3 developers to sign off on every commit?
Mgr: Because 4 years ago.... I guess it doesn't make much sense anymore.... That's the way it is!

Just like misery, bureaucracy love company


Bureaucracy is an attempt to control something, to take organic chaotic processes and make them orderly. The problem that often arises is that bureaucracy is its own organic chaotic system, that then requires more bureaucracy ad infinitum. If you've ever been in a meeting where all you decided was the schedule of meetings, congratulations, you are in the Matryoshka doll hell of bureaucracy.


Meetings


I loathe meetings, a bunch of people talking about the work they could be doing if they weren't in meetings all the damn time. Meetings are seductive, they sound and feel and look like work, but they are occupational masturbation. No one has ever brought a product to market because they were able to make it to 10 meetings a day. Meetings have almost no value, sometimes they are necessary, but not nearly as common as corporate culture would have you believe.


And the rest...


[caption id="attachment_683" align="alignleft" width="289" caption="Forgot to file the A34C-Bh amendment releasing liability for tongue trauma"]hot tamales candy box[/caption]

I could go on and on, but I will cut the rant short and get to the point. Bureaucracy at its core is about trust, or more importantly the lack thereof. I don't have my girlfriend fill out the A34C-B form (Confirmation of Confection Purchase Agreement) before running to the store to ensure that she understands that I would like her to pick me up some Hot Tamales. I trust her at her word, there is no need for such ridiculous formalities.


When an organization has enshrined itself in a monument of bureaucracy what it is really saying is, "We've been burned before and now we don't trust you." We don't trust you to deploy your code correctly, we don't trust you to design things properly, we don't trust you to do X, so let's get a bunch of people together to review it. This is fine in small doses, frankly I want people to review my code and my designs, I make mistakes like everyone else. But when taken to the extreme it takes a toll on your motivation, on your creativity, and on any preconceptions that you knew what you were doing. Bureaucracy is the surest way to crush your workforce into a homogeneous mix, you will catch the awful at the expense of the great.

20091230

minimalism

[caption id="attachment_493" align="alignright" width="296" caption="minimalist staircase... looks really dangerous"]minimalism[/caption]

I am a minimalist at heart, I like simple things with clean lines and no clutter. This is one of the reasons I love my new iMac, its just a beautiful magic floating screen filled with win. Minimalism is more than just an artistic movement or an ironically expensive interior design style. Programming is by its nature minimalistic, we programmers (as I have said before) are a lazy bunch. No one wants to type the same code over and over again, so we came up with functions, and then classes, and then inheritance, and frameworks, and aspect oriented programming, and so on and so forth. We want to reduce the amount of work that we as the developer has to do.


Here is a simple windows program that pops up a hello world screen using Visual C++


[cpp]
// GT_HelloWorldWin32.cpp
// compile with: /D_UNICODE /DUNICODE /DWIN32 /D_WINDOWS /c

#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>

// Global variables
static TCHAR szWindowClass[] = _T("win32app");
static TCHAR szTitle[] = _T("Win32 Guided Tour Application");

HINSTANCE hInst;
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
WNDCLASSEX wcex;

wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPLICATION));
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_APPLICATION));

if (!RegisterClassEx(&wcex)) {
MessageBox(NULL, _T("Call to RegisterClassEx failed!"), _T("Win32 Guided Tour"), NULL);
return 1;
}

hInst = hInstance; // Store instance handle in our global variable

HWND hWnd = CreateWindow(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 500, 100, NULL, NULL, hInstance, NULL);

if (!hWnd) {
MessageBox(NULL, _T("Call to CreateWindow failed!"), _T("Win32 Guided Tour"), NULL);
return 1;
}

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

MSG msg;
while (GetMessage(&msg, NULL, 0, 0)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return (int) msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
PAINTSTRUCT ps;
HDC hdc;
TCHAR greeting[] = _T("Hello, World!");
switch (message) {
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
TextOut(hdc, 5, 5, greeting, _tcslen(greeting));
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
break;
}
return 0;
}
[/cpp]

Holy Shit! This is after I stipped all the comments, removed whitespace, and reformatted to 1TB. But here is how much code you need to do something similar in C++ leveraging Qt


[cpp]
#include <QtGui>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel label("Hello, world!");
label.show();
return app.exec();
}
[/cpp]

This is great news for the developer, we can accomplish the same result with much less code. We are now much more productive and so we have freed up some precious developer time that we can spend on something else. Our code is much smaller, much more minimalist now, which is good because we are lazy. This ends up being a dual edged sword because there is now the temptation to start coding up more features, because they are so easy to implement now. We have made our code more minimalist but in doing so have enabled developers to make their applications feature bloated and anything but minimalist.


Jeff Atwood wrote a post yesterday, Responsible Open Source Code Parenting, in which he asserts that John Gruber is being a negligent open source parent.



I don't mean this as a personal criticism. John's a fantastic writer and Markdown has a (mostly) solid specification, with a strong vision statement. But the fact that there has been no improvement whatsoever to the specification or reference implementation for five years is … kind of a problem.

The question I had, and still have is why. I wrote this comment on Hacker News yesterday regarding this post



The idea that since markdown hasn't done anything in years its somehow being stewarded improperly is a bit foolish. Look at Gruber's vision statement, he wanted to make an easy-to-read easy-to-write markup.

He did it, it is done, it's called markdown. If Atwood had his way Gruber would have spent the last 5 years filling it up with features and today we would be reading a post about how Markdown went from slim and sleek to fat and bloated.

Gruber set out to do something, then he did it, now it's done. It's a minimalist approach. Atwood would have rather he spent the last 5 years allowing for "open source collaboration" that would help in "moving forward and maturing" Markdown. To what ends?


It is easy to add feature after feature to something with the belief that you are somehow adding value, but the whole world doesn't think this way. Let's illuminate this with an example.












Apple Remote Windows MCE Remote

[caption id="attachment_496" align="alignnone" width="80" caption="There are 7 buttons"]apple remote[/caption]

[caption id="attachment_497" align="alignnone" width="245" caption="The technical term is an assload of buttons"]mce remote[/caption]


That's how the Apple Remote is intended to look, it's not lacking buttons because they haven't gotten around to putting some more on, they intentionally kept it simple. Now I'm not trying to argue that one remote is superior to the other, I prefer the Apple Remote, but the important word there is prefer. Atwood makes the mistake of thinking since something hasn't changed in 5 years its a problem. What if Gruber did the cost-benefit analysis of the new features for the last 5 years and decided that it just didn't need anything else.


People have asked me if I'm going to use Disqus and although I tried it for a bit I decided to just use the simple built-in commenting system. Disqus was all kinds of bells and whistles, it is (in my opinion, which since it's my blog is the only one that counts ;) ) ugly, and it's benefit doesn't outweigh it's cost in my opinion. By the time I took out all the stuff that made Disqus feel bloated to me I realized I basically had the simple built-in comments, just hosted by a third party, so I abandoned it.


There is a cost to every feature you throw into your software, the cost is added complexity. I have decided that complexity better come with some gain for the user, otherwise I won't add widgets and gadgets and features just to add them.

20091217

bing and what?

[caption id="attachment_432" align="alignright" width="300" caption="look a bird, now I\'m deciding I guess"]look a bird, now I'm deciding I guess[/caption]

I keep seeing commercials on TV, I'm sure you have to, where there is one person and another person asks them a question, the commercial then goes something like this:



  • Normal Person: Hey want to get lunch

  • Freakazoid: Lunch from the latin luncha for eating during the daytime

  • Normal Person: Huh?

  • Freakazoid: Oklahoma abbreviation OK, OOOOOOklahoma where the wind goes...

  • Normal Person: I said "huh?" not "ok?" you stupid fuck


These terrible abortions have been shoved onto the world by Microsoft to promote bing. The idea here is that using Google / Yahoo / etc. causes such a delude of useless results that querying a normal search engine is like talking to the freak from our vignette. The alternative bing is a decision engine and by using that you can "stop searching, start deciding".


First off for full disclosure, I'm not the biggest fan of Microsoft, I think they make expensive sub-par software. On the other hand though, I program in .Net and work in XP and Vista everyday, I also own a Mac and have ubuntu installed at home. I use Microsoft products, there are some that I even like, but their corporate culture and quality control bugs me. If you want to write a snarky comment about me being a linux-head or a mac-fanboy or a windoze-m$-hater, feel free to.


The whole "Decision Engine" thing is what pisses in my Corn Flakes, its such nothing market-speak. They synergized outside the box with a shifted paradigm to come up with Decision Engine. Here is the thing though, what the fuck does it mean? Does it mean that it will make decisions for me, is it a big step forward in finding stuff on the internet? So I decided to do a completely scientific comparison of bing and google.


The first step in this was searching the term "ok" as this is the most annoying example from the bing commercial. Here are my completely scientific results.










bing [caption id="attachment_434" align="alignnone" width="300" caption="bing search of ok"]bing search of ok[/caption]
google [caption id="attachment_435" align="alignnone" width="300" caption="google search of ok"]google search of ok[/caption]

Bing's first result is for Oklahoma! Think about that for a second, and now here it is again because it bears repeating, BING'S FIRST FUCKING RESULT IS THAT OK IS AN ABBREVIATION FOR FUCKING OKLAHOMA! You'd think after the commercial they would have thrown something into their indexing algorithm. Google correctly points me to a wiki article about the term "okay" before suggesting Oklahoma. But let's move past the obvious and focus on the fact that besides bing fulfilling their own prophecy, what about bing helps me decide? Nothing, they are the same page layout, they are the same thing, they do the same fucking thing.


But what is there to decide, maybe this is user error, maybe I should ask it something it could actually answer. I want chinese food for dinner, let's see what happens when I search bing and google for "chinese food near me" (note: I made sure to sign out of each so that neither would have an advantage knowing my location from an account).











bing [caption id="attachment_438" align="alignnone" width="300" caption="bing search for \"chinese food near me\""]bing search for "chinese food near me"[/caption]
google [caption id="attachment_439" align="alignnone" width="300" caption="google search for \"chinese food near me\""]google search for "chinese food near me"[/caption]

Here Google clearly wins, Bing thinks I want to know about chinese food in Maine (ME) and proceeds to tell me all about it. Google makes the same mistake but then also uses some google magic to determine that I live in Columbus, OH and provides some chinese food that is actually in this state.


I don't want this to turn into a who's better at this query or that query type thing. Let's take a step back and look at the bigger picture, bing doesn't help you decide, it is a search engine. And that's the whole point of this post, fuck your market-speak Microsoft. Don't obfuscate, innovate. If you want to take down Google go spend some of your money to design something that is actually better. Bing as it stands today is a moderately effective search engine with pretty pictures, nothing more.


There is plenty of room to innovate, there are things people could do to help me make decisions, but Bing doesn't do any of this. Search engines could start leveraging social networking information to understand the person that I am and tailor my results, they could allow the end-user to vote results up and down for a query so that the group prunes the result set, they could do some research and development and come up with something that would blow my mind.


The problem with Bing isn't that its not a good search engine, its that its not a good decision engine, its not any kind of decision engine, its a fucking search engine. Microsoft is famous for and probably makes a ton of money off of sprinkling marketing fairy dust on their shitty shitty products, so they won't stop, it just pisses me the fuck off. Stop with your dumb commercials with annoying fucks rambling like idiots because you've completely revolutionized searching and you no longer present results in a big list sorted by your concept of relevance, until you actually revolutionize searching, like Google did with their pagerank algorithm.

20091216

making a sandwich

[caption id="attachment_418" align="alignright" width="237" caption="sam waterston is getting ready to rip your still beating heart from your chest, then he's going to go do some lawyer stuff"]sam waterston is getting ready to rip your still beating heart from your chest, then he's going to go do some lawyer stuff[/caption]

Disclaimer: I am not a lawyer, I don't even pretend to be one, except after watching law & order marathons where I shout "I object!!" at people and that one time I asked my girlfriend if I could treat my dog Harvey as a hostile witness in the case of me vs. whoever pooped on the floor.


I want you to close your eyes (but don't actually because then you can't read this). Imagine a world, a terrible world much like the one we live in, but lacking a certain invention, the sandwich. A time-traveling goat went back in time to the 18th Century and decided to kick John Montagu straight in the temple before he could ever ask for "meat tucked between two pieces of bread." The world never got the grand invention of the sandwich, humanity's suffering was unbearable.


Then one day as I'm eating a large pile of cold cuts while blogging and I notice that my fingers, slick with deli meat residue, keep slipping off the keys and the hilarious and witty things I wish to share are being turned into unreadable drivel. Spying the bread I keep handy to fend off attack from a flock of pigeons, the feathered rats of the sky, I have a sudden moment of inspiration. I place some bologna between two pieces of white bread and invent, the sandwich!


Being an enterprising young man I decide that this "sandwich" I've invented is quite the big deal, I decide that I should patent it and live the rest of my days fat and happy off the profit. I write up the vaguely named "Methodology for encasement of edible substances within grain derived substrate" and submit it to the US Patent Office. Then I show family and friends alike the delicious culinary brilliance that is me and my new "sandwich" to hearty congratulations and spontaneous ticker tape parades.


Then the darkness comes, swift in the night like a badger attempting to steal your young. An evil so despised that merely typing his name brings a cold sweat to my brow and a burning desire to my punch-him-in-the-face-center of my brain. Jared Fogle.


[caption id="attachment_420" align="alignleft" width="238" caption="his evil can not be contained"]his evil can not be contained[/caption]

Mr. Fogle decides that this sandwich is big money and so takes my idea and open up a sandwich shop where people can buy a foot long sub sandwhich for $5. He begins pulling in big bucks, soon others join in on the fun and profit, Wendy's starts putting their signature square patties between buns, McDonald's hamburg style hand-steaks become "hamburgers" with the addition of a bun, even chipotle starts packing their rice and meat piles in a wrap they call a tortilla. The last straw though is one day, walking down the street, I encounter a young child skipping off to school, after roughing him up and taking his lunch, what do I find?!? A Peanut Butter & Jelly sandwich!?!?! Where is my royalty check you freckled bastard?!


"I invented the sandwich!!" I scream in my head, and then out-loud to the young lad's startled mother. With a "harumph" I head back to my home, stewing with anger. When I arrive I find a letter from the US Patent Office, after 4 long years of waiting, my patent, "Methodology for encasement of edible substances within grain derived substrate" has been approved. A low rumble of laughter begins deep in my belly and it becomes a diabolical cackle emanating with an other-worldly resonance from my maniacal grin, as I pull out my cell phone and begin to dial my lawyer.


[caption id="attachment_422" align="alignright" width="199" caption="PB & Patent Infrigement"]PB & Patent Infrigement[/caption]

The lawsuit with Mr. Fogle's Subway sandwich shop is long and arduous, but thanks to East Texas' interesting take on justice and patents, I'm awarded a $500 million settlement. Arguments abound about how there is prior work and talk of inevitable discovery. These are swept aside in a tidal wave of lawsuits, Wendy's, McDonald's, Chipotle, even that freckled young lad. I begin handing out subpoenas like Tiger Woods picks up women, anytime, anyplace (zing!). My team of high powered lawyers are figuring out ways to sue people I hadn't even dreamed of, I guess a pizza is just an open faced sandwich, sue away my pretties!


My madness grows as I become obsessed with everyone that has ever eaten a sandwich, couldn't they see my brilliance, where are my residuals!? The populace rightly decides that I am a douche bag and I'm roundly mocked on the late night circuit. This darkens my cold heart into a black pit of vengeance, sandwich vengeance. People are wary of making sandwiches at home, what liability have they opened themselves up to? No one can rightly answer, "experts" abound on the internets claiming this or that, but the murky waters are indecipherable. The Patent Office is challenged, people roundly criticize them for allowing someone to patent such a vague and wide reaching concept. They review the patent and decide that it is in fact a fine and upstanding patent, one worthy of their seal of approval.


The nightmare of a world without sandwiches has been replaced by the new nightmare of a world where I control sandwiches.




Thank goodness though that this is not the world we live in, that such insanity would never happen in this day. Oh, fuck

20091210

weakness

[caption id="attachment_375" align="alignright" width="250" caption="..who drank a soup primarily made up of Zug the Viscous..."]..who drank a soup primarily made up of Zug the Viscous...[/caption]

As I promised yesterday, today's post will be all about the question 'What is Your Biggest Weakness?' Jeremiah Peschka threw down the challenge at me, the challenge coming to him by way of Brent Ozar who himself was tagged by David Stein. This is starting to remind me a bit of the episode of Futurama where Fry becomes King by drinking the previous King, which has my all time favorite quote, "It's just like the story of the grasshopper and the octopus. All year long the grasshopper kept burying acorns for winter while the octopus mooched off his girlfriend and watched TV. Then the winter came, and the grasshopper died, and the octopus ate all his acorns and also he got a race car. Is any of this getting through to you?"


The question being posed though is What is Your Biggest Weakness? now before I answer I would like to examine this question and its prominence in hiring people. Frankly this question is bullshit, you may as well ask someone any of the following because they are about the same.



  • How well can you lie to me?

  • Are you ready to debase yourself for the promise of money?

  • I think you are fucking stupid!*


*Not technically a question

The question is a social contract we have all entered to for reasons unknown, it is like the dance we do when someone sneezes.



  1. Sneezer: *sneezes*

  2. Sneezee: Bless you

  3. Sneezer: Thank you

  4. Sneezee: You're welcome


Four steps to every sneeze, why, because we are afraid our souls are going to shoot out of our nose. No, now it has just become ingrained in the culture as the polite thing to do, even though the reason for its existence long ago stopped being relevant. I'm sure at some point in history the "What's your Biggest Weakness?" question was original and clever and useful. There were people in the world who hadn't heard it and prepared a canned answer. It was a probably a great way to see how someone thought on their feet and could wiggle out of a tough spot. That is no longer the case.


[caption id="attachment_377" align="alignleft" width="300" caption="Sometimes when I fart it smells like cinnamon rolls, that can be distracting for others"]Sometimes when I fart it smells like cinnamon rolls, that can be distracting for others[/caption]

Now this question is an insult to both the person asking and the person being asked. The person being asked knows this question exists and if they have a snowball's chance in hell of ever being employed they have an answer all cued up and ready to go. Some clever little spin on how they work too darn hard, are too much of a perfectionist, or are just too damn likeable for their own good. In that fake answer is the insult to the person asking the question, but really, they deserve it.


If you've ever answered that question with one of these fake answers, don't bother, I have your greatest weakness, you are a whore for money. And guess what people, that's my greatest weakness. When I was interviewing for my current job I recall clearly being asked that question and giving some cock-and-bull "I work too hard and am a perfectionist" line. The truth of the matter is that I'm a bit obsessive compulsive about my code, I am a bit of a perfectionist, but is that my greatest weakness, no. My greatest weakness was that I was too gutless to refuse to answer that stupid question, or too timid to respond with an actual weakness instead of some shrink-wrapped bullshit about working too hard. My greatest weakness that day was letting my fear of living on the streets eating catfood overcome the voice in my head calling out this faux question for what it is, a slap in the face to any prospective employee. I could have answered with any of a wide range of actual professional weaknesses that I have:



  • I get bored easily

  • I don't test simple fixes as thoroughly as I should

  • I don't work at consistent output, I have times when I'm incredibly productive and times when I just want to nap

  • I don't agree with most corporate culture, telling me what to wear, when to show up, how to act, is understandable, but it shows a lack of respect that I find insulting, its a rigid structure in which I am less productive not more.

  • I value my free time more than I value money which makes me a less than ideal candidate when the idea is trading time for money.

  • I like people, sometimes I'm more interested in talking to someone about code (or monkey or robots or zombies) than writing code


Those would have all been great things to say, but I didn't. I sat there with a phony smile and a phony answer, I lied and it worked. I'm hired, I've worked on several projects and they have all been successful, on-time and on-budget. I'm cognizant of these failings that I have and I think that that is my greatest strength.


If I had it to do over again I would have answered with my actual weaknesses, and then I could have spun it a bit. I know that these are the things that can derail me and potentially derail a project. I don't overlook my failings anymore, I remain conscious of them and actively work to counteract my natural tendencies. I'm aware of the fact that I don't test thoroughly the small stuff, so now when I'm pushing a small change that fact pops up and I have to ask myself, did I test this thoroughly or did I cut corners and just run it in the compiler in my brain (which is full of all kinds of bugs and edge cases). The first step to dealing with any weakness is admitting it and being aware of it, the second step is doing something about it.




I'm going to continue this game of blog tag by asking Mark Essel to respond to this question next.

20091103

i can't stop you from being stupid

computer-stupid

I've been working on a skunkworks side project that is nearing release, I'm down to the last 5%, which is the most difficult part. Suffice it to say that this project is a library meant to be used by other developers (and myself) to develop neat and nifty things. One of the most complicated things is trying to define an API that makes doing the right thing easy and doing the wrong thing really hard or impossible. The problem is that the as I pressed on I realized that almost half my code was checking for some stupid thing and protecting against it, attempting to build up state machines and syntax trees in the hope of reporting to you that you had done something stupid, and then it dawned on me, I can't stop you from being stupid.


The other thing that dawned on me is that I shouldn't try to, there are already built in errors that will point out what you did wrong, I don't need to add another layer on top. So I came up with some simple guidelines, applied it to my project, and watched unnecessary code melt away.



  • Pick sane defaults

  • Assume the developer knows what they are doing

  • Make it easy to do the right things

  • Make it hard to do the wrong things


The beautiful part of all of it is that my code became easier to read and understand, which means when there is a problem and you need to drop into my code (since it is open source), you will be able to understand what's going on. Let's take a look at what I mean with a contrived example, an HTML building library with 4 functions for clarity.


[php]
class HTML {
static function open_html() {
echo "<html>";
}

static function open_body() {
echo "<body>";
}

static function close_body() {
echo "</body>";
}

static function close_html() {
echo "</html>";
}
}
[/php]

The way I was programming did a bunch of handholding and sanity checks, which were nice but unnecessary. The class became bloated with so much state and sanity checking that it was becoming unwieldy, let's take a look at an overly protective incarnation of the above code.


[php]
class HTML {
private static $html_open = false;
private static $body_open = false;

static function open_html() {
if(self::$html_open) {
self::handle_error("html is already open");
}
echo "<html>";
self::$html_open = true;
}

static function open_body() {
if(self::$body_open) {
self::handle_error("body is already open");
} else if (!self::$html_open) {
self::handle_error("body must be contained in html");
}
echo "<body>";
self::$body_open = true;
}

static function close_body() {
if(!self::$body_open) {
self::handle_error("cannot close unopened body");
} else if(!self::$html_open) {
self::handle_error("body must be contained in html");
}
echo "</body>";
self::$body_open = false;
}

static function close_html() {
if(self::$body_open) {
self::handle_error("cannot close html, unclosed body exists");
} else if(!self::$html_open) {
self::handle_error("cannot close unopened html");
}
echo "</html>";
self::$html_open = false;
}

static function handle_error($message) {
//What is the correct behavior, should we attempt to fix the error, report it, who knows.
//We'll just stop execution
die($message);
}
}
[/php]

Those sure are some nice error messages and it keeps you from creating malformed html, but what's the point of it all. The browser is more than happy to tell you that your markup is invalid, or run the output through a lint checker or W3C validator, why should this class have some buggy half-implemented validator inside of it. The answer is, it shouldn't.


If you write stupid code you should get stupid results, Garbage In - Garbage Out. Library code shouldn't hold your hand making absolutely sure that you never make a mistake, what's the point of it. If you write the following code


[php]
HTML::open_body();
HTML::close_html();
HTML::open_html();
[/php]

You are clearly missing something about how markup works, it's not the library's job to hold your hand and guide you through this crisis, the browser will slap you in the face and you will have to learn something. Now there is a caveat, here we are generating HTML, there are great utilities for finding errors in HTML, so we don't need to reinvent the wheel. If you are writing a library or application code where if something goes wrong the error displayed is fine, don't reinvent the wheel. If the error is unacceptable you may need to do some error reporting.


At the end of the day you can't keep the user of your creation from being stupid, they are going to do stupid things and stub their toes and curse your name and you need to make sure that they had to go far off the beaten trail to do so, overlooking obvious better ways to do it, so that it's their fault and not yours. Make it easy to do the right thing and hard to do the wrong thing, but if the user wants to open the body tag before the html tag, let them, they have to learn sooner or later.

20091028

related tasks

I remember watching Mitch Hedburg one time talk about how comedy is an odd kind of profession because if you are really good at it you have to stop doing it. The point he was making is that if you are successful enough at stand-up then one day people are going to ask you if you can act and write and star in movies. Here is the pertinent quote.

When you’re in Hollywood and you’re a comedian, everybody wants you to do other things that are related to comedy, but are not stand-up comedy. ‘All right, you’re a stand-up comedian, can you write us a script?’ That’s not fair. That’s like if I worked hard all my life to become a really good chef, they’d say, ‘OK, you’re a chef. Can you farm?’

This is a less severe version of the Peter Principle.

But it's not just comedians, Software Development has a whole host of secondary tasks that are related, sometimes closely, sometimes not so closely, that need to be taken care of. I've found myself in a secondary task day the last few days.

  • New client conference call
  • Functional Specification examination and inquiry
  • Task list creation and time estimates
  • Talking to a hosting company about plan upgrades
  • Researching a fix for PCI non-compliance issue
  • Researching why in the hell IIS6 wouldn't serve .aspx pages (Web Service Extension wasn't permitted)
  • Fighting with a dev environment to get an application running to test whether or not a PCI Compliance fix would break the application
  • Taking a break from fighting with the maddening server to write a blog post

These secondary tasks are all necessary, some are enjoyable (blogging), some I'm surprisingly skilled at (research, talking), some make me feel completely out of my element (time estimates, server configuration). In the landmark The Law of Leaky Abstractions and the follow up The Development Abstraction, Joel writes

Any successful software company is going to consist of a thin layer of developers, creating software, spread across the top of a big abstract administrative organization. The abstraction exists solely to create the illusion that the daily activities of a programmer (design and writing code, checking in code, debugging, etc.) are all that it takes to create software products and bring them to market.

Its not that I don't want to perform these secondary tasks, or that I'm not good at them, it's just that I'm much more productive at coding. My brain is set up for it, ask anyone that knows me, I think about life as one big program, I examine my emotions based off of function arguments, I turn situations into class hierarchies, it's just how my brain works. Programming makes sense to me, I feel at home there, I feel warm and cuddly wrapped in curly braces, and I work really well there.

These secondary tasks, related tasks, need to get done, and because of my availability I'm the one to do them. It's good to learn new things, but also scary and uncomfortable and frustrating.

I don't know if there is a point to writing this, it started off as a rant against feeling forced to waste my time and skills on tasks that I don't feel comfortable doing, but it hasn't ended there. It hasn't really ended anywhere, it's a reality, so I'll deal.

All I know is that right now the abstraction is leaking and getting my clothes wet, I long to wrap myself in comfy curly braces by a warm fire and feel like I know what I'm doing again.

20091022

project documentation

This post is about documentation, not source code documentation, but project and process level documentatino. I've spent the last 3 days working on a quick side project at work. There were 10 tasks, none of which were very complicated, the time spent tackling these tasks was about 5 or 6 billable hours. The time spent figuring out how to deploy these changes was about 3 days. The problem, project documentation

Scattered Information
Like some sort of 80's Nintendo Game I had to find the various colored keys to win the game. One developer knew the ftp server's ip address, another the username, maybe a third the password. It didn't help matters that this was a fairly complex site made up of multiple components (third-party blog, storefront, cms) each with their own credentials. Collecting this information was the first hurdle to leap in getting the code and getting the job done. It took a solid afternoon of pinging different parties but I finally had a list of keys, the blue door, the red door, even the green glowing door could all be opened!

Out of Date Information
Then came the crushing realization, as I found that the red door was rusted shut, the green glowing door didn't use a key but a magic potion, and no one could remember exactly where the hell the blue door was even located. The information was out of date or just plain wrong, more time wasted pinging people to get updated information and missing chunks. But after another day of haranguing I finally confirmed that the doors could in fact be opened, that night visions of tables and source code danced in my head.

Misplaced Information
This isn't really anyone's fault. I was working on a type of system, let's call it a foo type system, this particular foo system had been customized for client bar. I looked in the foo\bar\ folder for documentation and came up empty-handed. I assumed that there was no documentation and so created some there to collect up the hard earned bits and pieces of information I was able to pull together. Being proud of my new documentation with things logically laid out, I reported to my fellow developers the great leap forward in documentation technology I had developed. I was told there was similar documentation in the foo\ folder, why no one mentioned this to me earlier when I was pulling together this information is beyond me. But it didn't make sense to my brain, if there is a foo\bar\ folder why isn't foo\bar\ information in it, why is it in foo\, ah!

So what is the solution? Knowledge Base, Sharepoint, Wikis, Word Documents, what to do? I don't think that any one of these things by itself is a solution, but I do have some ideas.

Convention over Configuration
If you've ever played around with Ruby on Rails you will know the great joy of feeling at home in a rails project. Where are my models?! app\models\ that's where they always are, that's where they belong. I think adopting a standard documentation layout structure would be useful. Here's an idea (off the top of my head, so its not very polished)

  • project-name\documentation - Root of the documentation
  • project-name\documentation\bootstrap - How to get started, pulling the project from source control, initial builds, dev box configuration
  • project-name\documentation\credentials - IP Addresses, Username, and Passwords go here
  • project-name\documentation\database - Everything you'd want to know about the database
  • project-name\documentation\deploy - Deployment specifics are here
  • project-name\documentation\vendor\* - Third party documentation goes in various folders here

It's not perfect but its a start, really the important thing would be to have some sort of standard and stick to it.

Wikis
I like wikis, I think they are neat. Your documentation is easily editable, so it's easy to keep it up to date, and multiple parties can collaborate to break the task of documenting a system into more manageable chucks. I also think that you should follow some sort of system when writing them. Make this part of the convention and don't stray from it unless absolutely necessary. Maybe the sections above simply become wiki pages, with subpages. Wiki markup is easy to learn for any programmer, and as long as you aren't doing anything fancy, easy to remember.

Document your processes, that's the big thing, it would be great if you have a convention, its awesome if you have some collaboration medium that let's you keep it up to date, but the most important thing is to document the process. It's been eye opening to write out a list of steps for some of the "simple" tasks I do on a project from time to time. Since its become routine in my head the task is one step, do the task, but when I write it out on paper there are 13 steps with small conditional branches. It seems easy to do a task you've done a hundred times before, but it can be maddening to someone new trying to accomplish that task without the help of the well-worn mental path you've painstakingly claimed from the jaws of chaos.

I have been on projects with great documentation, and some with not so stellar documentation, and it is like night and day. So here's a thought experiment, a trite and cliche one, but if your entire development team got hit by a bus tomorrow and some new guys had to come in and deploy, how long would it take them, could they even do it? The answer should be, they would simply bootstrap then look in deploy and follow my step by step guide to deployment success, if your answer was, they would pray and put on their detective hats, ding ding ding, you've got some documentation work to do.



20091021

camels, underscores, and dashes

I've been learning lisp, oh it is good fun! Go now, stop reading this stupid blog, learn some lisp! Anyone still here, well let's talk about some stuff since you won't obey my commands... yet.

There are stupid things in life that don't seem important but somehow make a big difference. Really stupid things, things you can't image people would ever care about, like Indent style. Not a programmer, don't think it matters, don't think anyone would ever care? Get 10 programmers together, ask them what their favorite Indent style is and watch as the One True Brace Stylistas (the camp I fall into) and the Allmaniacs start screaming obscenities at each other and begin to fashion crude weaponry.

It seems like a small thing, but as programmers we spend a lot of time parsing text with our eyes and our brains. Reading source with a different Indent style can feel like walking with shoes on 3 sizes too big, sure you still know how to walk but it feels clumsy and unnatural.

Lisp can definitely feel like waking up groggy and putting on a pair of rollerblades instead of shoes. Its syntax can be confounding and lots of new comers really hate the parentheses.

(defmacro once-only ((&rest names) &body body)
  (let ((gensyms (loop for n in names collect (gensym))))
    `(let (,@(loop for g in gensyms collect `(,g (gensym))))
      `(let (,,@(loop for g in gensyms for n in names collect ``(,,g ,,n)))
        ,(let (,@(loop for n in names for g in gensyms collect `(,n ,g)))
           ,@body)))))
Note there should not be any semicolons after the ampersands, syntax highlighter keeps putting them in there (if you know how to fix this please feel free to leave a comment)

Now this is a little unfair to lisp, if this is the first code example you've every seen don't be scared off, it uses lots of advanced concepts, and to be honest, I still don't fully grok the double-quoting and double-unquoting that is going on in this thing. The main thing to take away is look at all those parentheses, goodness me! Actually its not really that bad, SLIME does a great job of balancing them and they are semantic not just syntactic. Unlike other languages, in lisp parentheses are signal not noise.

One of the things I love about lisp and find myself wanting to do more and more in other programming languages is using the dash as a separator. The macro that is defined above is named "only-once" and I like that. Typing it is a breeze, there are no shifts to get capital letters or underscores. Depending on the language this would be written as OnlyOnce, onlyOnce, only_once, but lisp lets you type only-once, and although it seems small, I definitely like it more than any other convention.

I'm a web programmer for my 9-5 actually get a paycheck for programming programming, and there are many things that you can name with dashes. Web pages (my-sweet-webpage.html), image resources (guy-dancing-with-cat.jpg), css class (div.super-awesome), html entity id's (my-super-awesome-div) are all legal. I want to be able to use the same convention in JavaScript or C# or PHP or [insert language here] but I can't.

There is good reason why I can't, it would be impossible to program a parser, don't believe me, parse this JavaScript pretending that you can use dashes in names.

var dash-variable = 10
var dash = 8;
var variable = 4;
alert(dash-variable);

What would the output be, 10 because it looked up "dash-variable" or 4 because it looked up "dash"-"variable" = 8 - 4 = 4. The way lisp gets around this is that there are no infix operators. The same code in lisp would look like this.

(defvar dash-variable 10)
(defvar dash 8)
(defvar variable 4)
(format t dash-variable)
; or
(format t (- dash variable))

Slowly but surely though I'm getting used to gliding around on my lisp rollerblades, and when I have to put on my C# shoes or my PHP shoes they just don't feel right anymore. There is nothing I can about this except be aware, and for the love of the flying spaghetti monster FOLLOW THE LANGUAGE'S NAMING CONVENTION.

Because if I come across some of your .Net code and it looks like Java, or you want to write your JavaScript like its a .Net class, you will incur my unending wrath. I might think that capitalizing the first letter of function names is wrong (I'm looking at you .Net, first letter capitalization is for classes) but consistency of source code is much more important than my petty preference. Lunch is over now, back to writing Allman braced CapWords C# code, because at the end of the day, someone pays me to walk around in these crocs, no matter how ugly I think they are.

20091015

you can't understand google wave

Please everyone, just stop. Everyday someone writes a new article about Google Wave. If you are writing a first impressions, explanation, frequently asked questions type of article, go ahead, this rant is not aimed at you. The rest of you people writing reviews, glowing or scathing, you can't understand Google Wave, yet.

Google Wave is big, that's for sure, its got a Federated Protocol and XMPP and PubSub and all kinds of neat technology. It has an interface too, half email, half chat client, half sentient alien technology. The problem with people waxing inanely about what Google Wave will be is that they have their heads up their asses. They don't know, because they can't know.

Let's go back to 1975 and somebody explains the idea of the World Wide Web, they go on and on about HyperText Transfer Protocols and HyperText Markup Language and they show you the first webpage. Imagine that instead of being the tech savvy web surfing person that you are that you have no idea what HyperText or Uniform Resource Locators are, this is where we are at with Google Wave.

The idea behind it is complex, the foundations are new (at least in application) and also very complex, and the future of Google Wave is unknown, more than that it is unknowable. Could Tim Berners-Lee have guessed what we would be doing with his invention today, could he have dreamed of web applications, twitter, social networking. I guess he could have, but it wouldn't have been immediately apparent.

The technology is too new, it could be a new World Wide Web, or it could be a Gopher. We won't know until we see what people create with it. Google has already produced a collaboration tool that looks very promising, and people are already finding surprising ways to use it.

So if you want to vacillate and bloviate about Google Wave continue doing so, I certainly can't stop you, but you might go down in history as the guy who called the internet a fad.

20091012

perception is _not_ reality

Perception is reality. This is a sentiment that has taken hold in the modern age, and it's easy to see why. We live in a world of constant spin, it's not that this spin didn't exist in the past, it's just that we are bombarded with it. The thing people weren't prepared for was that the information age was to be accompanied by the misinformation age. We have unfettered access to mountains of data, so many voices, look I'm one more.

So the question in this new age is, how do we separate perception from reality? And then someone said it, really thousands if not millions of people said it.

Perception is Reality

With the air of a Matrix quote and with about as much meaning, it is a seductive little phrase. It has a simple elegance about it, it says just enough to sound deep without saying anything at all. It's also a sort of self proving maxim, since the only thing we experience is our own perception, it makes sense, that is our reality. Another aspect of it's seductive power is that it is oddly freeing, it says, there is no reality that you don't make. It takes you from an observer of reality to the actor and center, it is your perceptions that form reality.

And this is why it's an intellectually dishonest concept. It is easy to look up at the Sun and perceive that it is circling the Earth, but that doesn't make it real. It is simple to look at a table and feel the surface and perceive that it is solid, the reality is that it's mostly empty space. Perception is that first attempt to understand reality, not the end of understanding.

Perception is not reality. This does not stop people from believing this foolishness.

Did you spend weeks writing that application, fine tuning it to run fast and work reliably? Great. Ship it off and the user that's running AOL 6.0 with BearShare in the background and clicking away with Comet Cursor (because they want their mouse pointer to look like a fluffy kitty) is going to fire up your application and think that you are a terrible programmer because its slow as molasses on their overworked machine. Didn't you perform compatibility tests with the unpatched pirated version of Norton Web Defender 0.8beta that the user is running, what in the hell is wrong with you?!

The problem is that in a complex enough system people's ability to make reasoned and rational evaluations break down. The cognitive load of the person using your application is normally completely saturated with whatever task the application is intended to perform. This is why troubleshooting from a user's perspective is frustrating and magical. And why as a developer you have to take everything the user tells you with the understanding that they have no idea how a computer functions.

It is frustrating to be on the wrong end of the blame stick for something that BearShare did, but it happens. The best we can hope to do is educate the user, patch up our software, and keep plugging away.

Perception is reality to the user, and that is a reality that we as developers have to come to grips with.




I'm working on a multipart series that should begin to see the light of day this week, I was going to start today but wanted to have a little bit more meat before publishing. Stay tuned...



20091007

just because its better doesn't mean its good

I recently wrote a blog post called why no love for scripting languages lamenting the lack of open source scripting environments in Windows 7. I got some interesting feedback, most of which went along the lines of "POWERSHELL!!!1!!one!"


Being an interested fellow I took it upon myself to look up PowerShell, and it looks like a nice language, really good for administrative tasks. So I read some of the manual and it looked ok, and I started looking for some scripts that would compare old school .bat to the new PowerShell. I found what I was looking for here PowerShell Examples. We will be looking at an example that displays the current date.


[shell]
@ECHO OFF
IF NOT "%1"=="" GOTO Syntax

:: Use BATCHMAN to retrieve day
BATCHMAN DAY
:: Errorlevel 0 means BATCHMAN was not found
IF NOT ERRORLEVEL 1 GOTO NotFound
FOR %%A IN (1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A SET DD=0%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 1%%A SET DD=1%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 2%%A SET DD=2%%A
FOR %%A IN (0 1) DO IF ERRORLEVEL 3%%A SET DD=3%%A

:: Use BATCHMAN to retrieve month
BATCHMAN MONTH
FOR %%A IN (1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A SET MM=0%%A
FOR %%A IN (0 1 2) DO IF ERRORLEVEL 1%%A SET MM=1%%A

:: Use BATCHMAN to retrieve year
BATCHMAN YEAR
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL %%A SET YYYY=198%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 1%%A SET YYYY=199%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 2%%A SET YYYY=200%%A
FOR %%A IN (0 1 2 3 4 5 6 7 8 9) DO IF ERRORLEVEL 3%%A SET YYYY=201%%A

:: Store in variable and clean up temporary variables
SET SortDate=%YYYY%%MM%%DD%
SET YYYY=
SET MM=
SET DD=

:: Display the result
ECHO.
ECHO SortDate = %SortDate%
GOTO End

:Syntax
ECHO.
ECHO SortDate.bat, Version 1.00 for MS-DOS
ECHO Display the current date in YYYYMMDD format
ECHO.
ECHO Usage: SORTDATE
ECHO.
ECHO This batch file uses BATCHMAN, a utility by Michael Mefford
ECHO.
ECHO Written by Rob van der Woude
ECHO http://www.robvanderwoude.com

:End
[/shell]

Rough, if you've ever had to write anything non-trivial in batch you will start to feel that pain at the back of your eyes right now, this is your brain trying to eat your memories. Batch is hideous, and difficult to write, and gross, and everyone hates it. Don't believe me, well you don't have to, Microsoft agreed with me and began development on Monad in 2003, this project would become PowerShell. Now let's look at the PowerShell equivalent of this code


[powershell]
""
"Date / Format YYYYMMDD DD-MM-YYYY MM/DD/YYYY"
"============================================================"
"Yesterday " + (get-date (get-date).AddDays(-1) -uformat %Y%m%d) + " " + (get-date (get-date).AddDays(-1) -uformat %d-%m-%Y) + " " + (get-date (get-date).AddDays(-1) -uformat %m/%d/%Y)
"Today " + (get-date -uformat %Y%m%d) + " " + (get-date (get-date) -uformat %d-%m-%Y) + " " + (get-date (get-date) -uformat %m/%d/%Y)
"Tomorrow " + (get-date (get-date).AddDays(1) -uformat %Y%m%d) + " " + (get-date (get-date).AddDays(1) -uformat %d-%m-%Y) + " " + (get-date (get-date).AddDays(1) -uformat %m/%d/%Y)
[/powershell]

That is much better. I see some stuff that looks like objects in there (I'm definitely seeing the dot operator). I'm a n00b to PowerShell and yet this code is easy to grok and all and all very pretty. Nicely done Microsoft, you get a cookie.


Well this would be a pretty boring post if I just went around patting Microsoft on the head for doing a good job. The interesting thing about PowerShell Examples is that they go on to provide the same example in other languages as well. Here is the same thing in perl.


[perl]
#! perl

# SortDate.pl, Version 1.00
# Display "sorted" date (YYYYMMDD)
# Written by Rob van der Woude
# http://www.robvanderwoude.com

# Parse time string
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);

# Add "base year"
$year = $year + 1900;

# Add 1, since moth seems to be zero based
$mon = $mon + 1;

# Add leading zeroes if necessary
if ($mon < 10) {
$mon = "0".$mon
}
if ($mday < 10) {
$mday = "0".$mday
}

# Concatenate substrings
$sortdate = $year.$mon.$mday;

# Display result
print "\nSortDate = $sortdate\n";
[/perl]

Certainly could use a text formatter of some kind to get rid of the icky manual padding, but for someone who has never written a line of perl, this looks quite nice and readable (although I am quite aware that that is not always the case for perl). So what's got a bee in my bonnet? Well I almost didn't write this until my friend Jeremiah tweeted the following



Writing powershell. This is happily like writing perl. 7:31am Oct 6th

And a little bit later



ZOMG This is seriously just like writing perl... I <3 you #PowerShell 10:41am Oct 6th

Side note: Jeremiah is about the smartest man in the world when it comes to SQL follow him here and view his blog facility9.


Why go about reinventing the wheel, if you are going to make a language similar to perl, just host perl. What's the harm? Its hard to call it harm, but its inefficient and tastes a little bit too much like embrace, extend, extinguish to me. PowerShell becomes the defacto scripting language in Windows enticing open source programmers because it is similar to their language of choice. So why fret, PowerShell, perl, batch, bashscript, who cares? Well there are legion reasons why software developers should care.



  1. CPAN, PEAR, GEMS, etc. - These are huge repositories of tested code that can be leveraged quickly and easily by open source developers. CPAN (Comprehensive Perl Archive Network) contains 16,600 modules. PEAR (PHP Extension and Application Repository) contains 536 different packages with 1,255,213 lines of code. RubyForge hosts 8406 different projects. These established languages have a gigantic ecosystem of usable code.

  2. Learning curve - Do you know the intricacies of your chosen language? Did you spend two hours debugging a wily error and because of it have forever learned some dark corner of your language? Can you tell me in your sleep the difference between $foo and $$foo in php? Well none of that will help you in the new PowerShell.

  3. Brain drain - Come up with a really clever way to solve a problem in PowerShell, great, keep it to yourself. Where is the community? There is powershellcommunity.org. But there is yet to be an established authority for the community


Now these problems I outline are true of any emerging language. They are normally offset by some inherent positives in the language. I haven't examined PowerShell in-depth enough to find out its intrinsic value. On first blush and with my limited exposure, it seems to be a competent enough pseudo object oriented scripting language well suited for administrative tasks. Nothing ground breaking, nothing that knocked my socks off, in the words of Homer Simpson:



I saw you desperately trying to cram one more salty treat into America's already bloated snack hole. So I did what I could. I did what any loving husband would do! I reached out to some violent mobsters.

PowerShell is just one more salty treat that Microsoft is cramming into America's already bloated snack hole. It would be fine if they had a level playing field and allowed other scripting languages to be first class citizens, but they don't. After the mind numbing pain of batch scripting, PowerShell seems great. It really starts to lose its shine when you view it against the cornucopia of free mature open source scripting languages.


I want to end with a real world example (anonymized). There was a system that managed blerns. Blerns could be collected in collections called Bars, Bars could be collected in collections called Foos. These things were numbered and a system was built to manage them in COBOL. Because COBOL likes to make pictures, the original architects thought to themselves, we will pack the information into an 8 digit number like so FFBBbbbb, so that 01010001 would be the first blern, in the first bar, in the first foo, 01010002 would be the next and so on.


This worked great, the company was selling blerns left and right, and pretty soon foo:01 had 98 bars. Then things started to break down, 3 more bars, and the whole house of cards would come crashing down. What to do, what to do?! The engineers were assembled and solutions were offered.



We only have 8 foos, just assign the overflow into foo:10.

Seemed reasonable enough, but that would have resulted in weird code springing up all over the place like this


[ruby]
if foo == 1 or foo == 10
return "foo the first"
else
...
end
[/ruby]

Surely there was a better solution, what could it be? Well, suffice it to say I wasn't present for these meeting and I only saw the terror of the last solution being halfway implemented and this new solution coming in. The solution was a technical sounding concept called field widening. It amounted to storing the identifiers like so FFFBBBbbbb, 10 digits now capable of holding up to 1000 Foos, 1000 Bars per Foo, and 10000 Blerns per Bar. Surely this was better, but was it any good. I guess it might be, as long as we don't live in an exponential world.





Oh...