Friday, March 25, 2005

My love hate relationship...

Today I hate Microsoft. Some days I'm indifferent. Some days I love the company. Today I hate Microsoft.

It has absolutely nothing to do with any Slashdot or Register or other news article. Both of those sites loathe and are hostile toward any company and/or person that makes more than 1 million USD per year.

Nope. None of that. It has everything to do with DestroyWindow(). I hate Microsoft's DestroyWindow() function. MSDN Library has this one little innocent comment that caused me to waste an inordinate (and highly frustrating) amount of time today:

"A thread cannot use DestroyWindow to destroy a window created by a different thread."

WHAT THE...!?! I have words for that that are inappropriate for this blog. I need a good chunk of lye for cleaning of the mouth.

Let's think about this. I understand perfectly that people wouldn't want other processes calling DestroyWindow. That's uncouth. However, within the same process, Windows should never give a hoot as to what thread calls DestroyWindow. From an application developer perspective, I despise restrictions like this that seem so utterly silly and trivial, it begs the question. I'm sure there is some completely, totally, sane, and utterly sensible (er, retarded) reason for the restriction that someone in the marketing department would send in reply to this. If a programmer wrote actual code for that restriction, he or she needs to be shot...by firing squad. If it was implicit, then someone needed to fix that problem behind the scenes 10 years ago. To me, this is a major bug in the OS, but it is too late to fix it.

The obvious workaround to this bug is to notify the thread that actually owns the window that another thread wants it destroyed. Unfortunately for the clueless developers at Microsoft who think this is "normal", this is what is called a "hack" - a workaround for a major limitation. No one should ever have to write hacks. Ever.

I'm beginning to notice a trend with the way MSDN Library works - basically, a programmer will write a function he/she is told to write, but whenever I look at the new stuff being added (function-wise), it seems to me that all they do is document the laziness of the developer. In fact, the newest documentation seems to be somewhat "whiny" in the approach...like "why are you reading this? .NET solves all your problems". No, .NET will never do that. Now if you gave me 4 billion USD, that would solve the majority of my problems. .NET = no. 4 billion in cash = yes.

Tuesday, March 22, 2005

Completely Random Thought of the Day...

Someone was having a conversation with me recently and brought up temperatures at which stuff is frozen. Of course, the conversation went downhill from there. However, I did get to thinking about zero kelvin...the point at which all molecules completely freeze. Unfortunately, my idea is impossible because no one has ever attained zero kelvin yet (we've come close, but not close enough for this idea to work).

Here's the rhetorical idea of the day: Take a person or animal or other living thing. What would happen if every molecule of that entity were instantly frozen to zero kelvin, left alone for two years, and then every molecule instantly restored to the temperature it was at before being frozen? In order for such an experiment to work, we would need zero kelvin cold storage AND the ability to immediately alter molecules on an immediate basis AND a couple volunteers.

This, of course, would have huge implications if it worked - this freezing/restoring process could perfectly preserve humans for, say, NASA who might want to send a manned shuttle to really far away places like Pluto. I dunno, just an idea that popped into my head. More than likely the people would die shortly after the flash thaw since the soul would have left the body. We could send monkeys. Or goats. Goats are cute.

Friday, March 04, 2005

The definitive guide to dinner.

There have been so many debates as to what dinner is and when it is and all that, I finally got fed up tonight and decided to settle the matter once-and-for-all. What follows is the Hitchhiker's Guide to Dinner...or something like that anyway.

First off, if you have 42 of anything in your food, whether it be molecules or atoms or subatomic particles, you can sell it on eBay for a few million dollars.

The basic definition of dinner is the "chief meal of the day" according to all sorts of dictionaries out there. Therefore, this means that whenever a person feels fullest, they have had dinner. So, if, at the time most people have breakfast, a person feels fullest after, they have had dinner. Universally accepted are the definitions of breakfast, lunch, and dinner.

However, if dinner is had at the time of breakfast, this probably means the person stayed up until 5 and missed breakfast and lunch. That's 5 a.m., not 5 p.m. - just in case anyone needed clarification on that. Remember - this is a software developer blog...developers are kind of crazy like that.

Of course, it is perfectly conceivable that dinner is the largest meal that someone would eat in the morning. This makes the other two meals lunch and supper respectively. Someone on a diet who only eats in the morning is eating dinner AND has a dehydration problem (almost all diets directly/indirectly call for a drastic reduction in fluid intake - causing huge health issues later on).

For people who eat constantly (e.g. snacks), they never have a definitive time for dinner - the whole day is dinner. Such people will eventually have enough cushioning, others could sit on them thinking it was not a living object. (The secret to losing weight is to stop eating all snack foods and eat two good-sized helpings of vegetables at lunch and supper - oh, and corn kernels and peas are not vegetables - corn husk and pea pods are, but most people don't eat those).

For normal people, dinner is either at noon or in the evening at roughly 5 or 6 p.m. Developers are not normal. Developers tend to eat whenever it is "a good spot" to stop coding or their stomachs are growling so loud it can be heard 50 feet away. That "good spot" tends to show up around 2 a.m.

Of course, now given the weird nature of developers, it is quite conceivable that some developers have dinner when people have breakfast, lunch at noon, and breakfast when others have dinner in the evening. A completely inverse order from the norm, and completely normal at the same time.

Sometimes even I eat meals in strange orders. It was not too long ago when I ate lunch first, then breakfast, and then dinner for a change of paste...uh, pace. Of course, I'm strange to begin with, so this is perfectly normal.

In conclusion, whenever you are thinking about dinner, it should be eaten because it provides quality time to puzzle over that problem or talk with people or whatever.