Showing posts with label Rant. Show all posts
Showing posts with label Rant. Show all posts

Friday, February 3, 2012

Careful with Abstractions

Browsing around MSDN the other day, I bump into the following paragraph:

"The order and types of binding elements in Bindings are significant: The collection of binding elements is used to build a communications stack ordered according to the order of binding elements in the binding elements collection. The last binding element to be added to the collection corresponds to the bottom component of the communications stack, while the first one corresponds to the top component. Incoming messages flow through the stack from the bottom upwards, while outgoing messages flow from the top downwards. Therefore the order of binding elements in the collection directly affects the order in which communications stack components process messages. Note that WCF provides a set of pre-defined bindings that can be used in the majority of scenarios instead of defining custom bindings."

Most programmers understand the concept of a stack. It's a abstraction for a data structure which allows new data items to be removed in the exact opposite order which they were inserted, that is, the first element to be inserted is the last to be removed (FILO).

And most people knows what a stack is: a pile of stuff.

And the deal with it is that you can only add /remove stuff to/from the top. The text on MSDN, however, goes through great length to tells us to imagine a stack that adds to the bottom, and that the message goes from bottom to top. A upside-down stack, in other words. Whoever wrote that was so deep into abstracting his communication stack is a certain way that he forces us to think in a counter-intuitive way. It would be easier for the author to change the way he thought about it.

I used to say that some people, sometimes, are so fixed onto a solution that when the solution doesn't works, they adapt the problem. 


Whenever you are writing a technical article like this, be careful with your abstractions; They should help people understand the problem better, so if you have to explain your abstraction (instead of explaining how it relates to the concrete problem itself), something is wrong. Like code smells, if you see a upside-down stack or any other abnormality appearing in one of your texts, take the time to review it.

Wednesday, August 19, 2009

ThinkPad T400

Today I got my "new" Lenovo ThinkPad T400 as part of a hardware upgrade program from Accenture. Every 3 years (in my case, 2,5) Accenture upgrades our notebooks, since, of course, they get aged somewhat fast after intense use. And, in my case, they also get outdated because customers like cutting-edge technology, and cutting-edge technology needs cutting edge hardware to be developed upon.

So, I got this business oriented Lenovo ThinkPad T400. And I've decided to blog about it, because I'm tired of complaining to the walls (or to my girlfriend). Considering just the hardware, this notebook is top value. Good HD (160GB 7400RPM), nice RAM (3GB), the case seems sturdy, and the battery life is amazing. Besides that, the screen has a cool lamp that lights the keyboard, in case you have to type in complete darkness and can't find the keys. Cool, but not sure if it's useful.

Now, for the rant. The keyboard plainly sucks. I have no better term so, sorry purists, but this is it: the keyboard sucks. Every key that isn't the default QWERTY has a terrible placement. Lenovo has put a lot of work into making this notebook very small, and reducing keyboard's size occupation was probably #1 concern. to achieve this, some keys are way smaller than the others, like, for example, the Windows Key, which is narrower than the rest, may escape your fingers (if you type on such a hurry as I do).

The worse, however, remains for the "Fn" and ESC key. Fn, for those who are new to the notebook world, is a special function key that works similarly to CTRL or ALT -- you need to hold it and press a certain key to access special notebook functions. The Fn key was placed just below the left-shift key, just where the CTRL should be. Now for those who, like myself, use the side of the small finger to hold the CTRL, this is a nightmare. Fn has much less function than CTRL, but the key is in a more reachable place.

In my case, the worse part is that I use a lot of CTRL+Right and CTRL+Left to skip words when typing, but on the Lenovo, Fn+Right and Fn+Left skips a track on whatever multimedia player is running (it's a Windows' multimedia key). I still haven't learned how to disable this function.

Also, the ESC key is sitting on the top of the board, above the F1 key. I find myself reaching for ESC and hitting F1 instead, which usually means opening Help. It's annoying. Since ESC is a big part of Windows, this is almost worse than control. Luckily, I use it less than I thought and it's easier to get used to it.

Finally there is the Track Point in the middle of the keyboard. This one is hard to decide -- there are people who loves it, but on my opinion, I have the touch pad, thank you very much. My complain is that I end up touching it when travelling over the keyboard. This is annoying, but if it was the only problem, I wouldn't care about it.

For those of you using a Desktop, think how awful would it be if you couldn't change the keyboard, if you were stuck with a ESC in a wrong position. Now, think about it, but without a mouse. Sounds like hell, doesn't it?