code complete redux + RAII

July 18th, 2007

As I looked back over past posts, I realized that I’ve never (at least to my memory) written an article explaining RAII.  I’ve done it in person quite a few times, to the various classes that I have TAed or graded, but I haven’t written it down.  So, here’s an attempt at it.

Read the rest of this entry »

Protected: selling culture vs. selling crap

July 14th, 2007

This post is password protected. To view it please enter your password below:


steve mcconnell made us all dumber

July 9th, 2007

I was randomly flipping through Code Complete today (on a slight whim of masochism), and read a whopping 2 pages before I came upon YASI (Yet Another Stupid Idea), for which this book is famous for (famous among people who prefer to think when they code, rather than crapping code out their, well, you know.)

Read the rest of this entry »

common sense will be the end of us all

July 9th, 2007

I stayed home sick today (seems I caught a bit of a stomach bug), so I decided to pass some of the time watching silly Google/YouTube videos. One of the videos I came upon (while looking for videos of any of the bridges in Seattle that have sunk over the years), was this video. The title of the video is “Creationist Kent Hovind Reveals The Truth About Dinosaurs And Evolution!”

Read the rest of this entry »

stop crapping on C++

June 28th, 2007

I happened upon this article, about the double-casting anti-pattern in C#, and I couldn’t help but notice the little pot-shots taken at C++ (and Delphi), to the point that people who exhibit use of this anti-pattern probably came from those weakly-typed languages.

Read the rest of this entry »

tired

June 15th, 2007

Sorry I haven’t written in a few score. The general news is that I’ve moved out to Sammamish, Washington, got a new car (Mazda6 i Sports Value Edition), got a new apartment at a community called Boulder creek, and start my job this coming Monday.  Any interested peoples can check out any pictures I’ve taken thus far at http://noahsmark.com/pictures, which gets updated rather frequently. I have the internets now (all of them), so you can find me on AIM (well, pidgin) with the screenname silentdakeyras.

Speaking of “pidgin”, go look it up. After I downloaded v2.0 of pidgin (formerly gaim), I thought it was just a cute misspelling. A few hours later, I read it in Maxine Hong Kingston’s Fifth Book of Peace, and figured that, barring any kind of Truman Show style conspiracy, it was a real word. Seriously, go look it up. Good stuff.

net neutrality (and others)

June 15th, 2007

Just a few minutes ago, I sent in a comment to the FCC about the whole net neutrality thing going on. The deadline for sending in comments is approaching, so if you want to give feedback, go do so. After you do (so as I don’t influence your feedback), continue reading.

Read the rest of this entry »

Swing has it backwards

April 2nd, 2007

One of the questions that I have been asked (and have asked myself) is why I’m even doing this project when Swing seems to give you a viable alternative. For example, for a JList, you can grab the ListModel and use it to register for event changes on the JList. At first, this all seems well and good, except for a really important issue: this is backwards.

Read the rest of this entry »

be careful of the hashCode()

April 1st, 2007

Update:

As it turns out, I was (mostly) being a horse’s ass.  It was a bit difficult to find, but Java does provide a mechanism for getting the equivalent of Object.hashCode() on any given object (not in a general way, i.e. get the un-overridden behavior, but for this case specifically).  That method is System.identityHashCode(). Java also provides a hash data structure that uses == instead of .equals(), IdentityHashMap. I’ll leave the rest of the article around, though, just so I can use it as a reminder of how silly I look with my foot in my mouth.


One of the side-effects of the way Java is designed is that it is hard to identify an object. By this, I don’t mean identifying it by its apparent value, as in a List is the same as another list with the same stuff in the same order. What I mean is identifying an object as this object, not by its value, but by its physical existence in the whole program world thingamabobber. This usually isn’t too big of a problem, until you really start working with the collection framework’s HashMap.

Read the rest of this entry »

multiple inheritance or something like it

March 25th, 2007

I’ve always felt slightly offended by the people who write off multiple inheritance in one fell swoop as being something akin to the fight against guns – it’s always misused, and there is no real useful purpose, so we might as well get rid of it in its entirety. There is a slight truth to the statement, as it applies to both guns and MI (the misuse, for example), but the conclusion is oh. so. wrong.

Read the rest of this entry »