C/C++ and sizes of types

October 26th, 2007

Every so often, I get asked questions along the lines of one of these:

Question type #1:

I need a type that is exactly n bytes/bits long. How do I get this?

Question type #2:

On machine x, the size of some type(usually wchar_t) is wrong! How do I fix it?

I actually just got the second question, hence the reason for this post (although that guy won’t see the answer, because he was a dick). The short answer is this:

(Most) types in C and C++ are either only relatively sized or implementation defined.

Read the rest of this entry »

not a dichotomy

October 23rd, 2007

Sometimes I hear people debating the relationship between synchronous and asynchronous execution. Or maybe distributed vs client/server architectures.  The thing to remember, in both of these cases (and a few more), these things are not dichotomous – one is completely subsumed by the other.

Read the rest of this entry »

“value”

October 23rd, 2007

A few weeks ago, Ballmer was giving a talk somewhere and got a bit chewed out from a mother about her daughter (?) who had begged her to switch to Vista, only to switch back shortly thereafter.  He told her something along the lines of, “Your daughter saw a lot of value!”, to which the lady replied, “She’s thirteen.”

Read the rest of this entry »

Wag the Dog

October 6th, 2007

If you haven’t seen it, go out and rent the movie Wag the Dog. My favorite quote from this movie happens right after a few of the characters survive a plane crash. One character finds a small portable TV, on which less-than-agreeable news is playing. In anger, she tosses the TV to the ground, breaking it.

Robert DeNiro: Leave it alone, will ya? What did the TV ever do to you?

Lady: It destroyed the electoral process.

the problem of oversimplification

October 6th, 2007

Before you read, go watch: http://www.youtube.com/watch?v=zORv8wwiadQ.

Read the rest of this entry »

The car accident story

September 10th, 2007

Pictures: http://picasaweb.google.com/dakeyras/CarAccident

Read the rest of this entry »

it should be obvious how to use it

August 24th, 2007

I just thought of this, as I sat contemplating an issue I’m having at work. The issue, without getting too much into detail, is about the best practices for designing a certain pluggable component of a larger framework. As with much of the OO C-descendant world, the component is defined by an interface that someone implements, and the question has arisen, “How do we tell somebody to write one of these?”

Read the rest of this entry »

why languages matter (or: why that guy doesn’t understand the meaning of “syntactic sugar”)

August 17th, 2007

I’ve been thinking more about one of my coworker’s many (strong) opinions, that programming languages are nothing more than syntax. I worry that we get too far taken by this argument, that we start to think of languages as the brand of hammer we use to pound the nail instead of the tools we use to solve the problem. Then again, languages are even more than the tools we use to solve the problem, they are the problem.

Read the rest of this entry »

free prescription drugs! so what?

August 7th, 2007

If you haven’t seen it, Publix just announced that they will be giving away seven (7) common oral antibiotics (I admit, the first time I read this as oral contraceptives, since you don’t usually see “antibiotics” qualified with “oral”).  So why don’t I care?  I remember the last time I accompanied a friend to pick up a prescription for 2 weeks of one of the common antibiotics.  The sum total of her bill was…drum roll please…

$0.50.

That’s right.  Publix will now give you about 50 cents off your pharmacy bill.  Woo-fuckin-hoo.

LINQ’s query syntax was created to make me angry

July 31st, 2007

Before you big C# fellaters out there get all pissed off, let me start by saying how cool some of the new C# features are. For those of you who aren’t tuned in to the Microsoft Kool-Aid bandwagon, C# is becoming, well, more Lispy (by which I mean is getting language features that will let it sit at the Adult Table next Thanksgiving). Features that C#, along with some other languages (Java, I’m looking at you, you red-headed stepchild of programming languages), have been needing.

Read the rest of this entry »