Archive for programming

Defactoring

You’ve read Refactoring. You’ve seen Prefactoring on the bookstore’s shelf. Well, after you’ve fact’d it all up, it’s time for Defactoring.

My new book, which introduces such techniques as overriding your framework’s core eventloop and running dynamic_cast<> on each widget that passes through to see if it’s the widget you’re looking for.

Comments (1)

The Forgotten Delicious

Comments

gpl craziness

Sometimes, late at night when the moon is full and no one is around, I’ll download the Emacs source. Then, I’ll make a single change. Maybe rename a variable or a function, or comment something out. Then, I’ll recompile it and put the binary on my website for people to download. But I won’t provide the source of my changes! Muahahahaha.

Comments

whoa guys

In Vacuous Virtuoso’s CTGradient code bloat article, he showed how easy it was to trim a 1300 line 3rd party piece of code down to 30 lines by trimming the unneeded code.

Super. We should all look at what code we use and whether it is inefficient or not.

The problem is he didn’t include any numbers beyond the LOCs. It would have been nice to have had some before and after numbers on execution speed, binary size, and memory usage.

No big deal though. It’s still a decent article.

It’s turned into a bit of a flame war though, or as close to a flame war as the usually polite Mac developer community gets.

I started it with what I like to think of was an innocuous comment.

It went back and forth a little bit with Daniel Jalkut joining in too.

Then this guy, Rick, joined in and immediately went personal.

Rick also posted a fun little timecube style rant on his blog where he referred to developers as the Landed Gentry of Mac Development and as snakes. He also put the word “people” in scare quotes.

It’s also amazing how far these ‘people’ will go to defend what essentially is a defenceless position.

Not quite sure what he thinks we are instead.

Sean was totally unnecessary with his

Do us a favor, think of this as being a thanksgiving dinner. The adults are busy discussing things at the dinner table. Take your slice of turkey, and go back to the childr- Oops, I mean, “indy” developer table.

style comments.

I just think that the personal attacks are pretty lame in a discussion by a bunch of developers about the relative merits of a code cleanup.

Comments (2)

Rails vs Seaside

I came across an interesting post about SmallTalk’s Seaside versus Ruby’s Rails.

The meat is in the comments which are very polite and informative. I’ve only played with Squeak once back in college so I didn’t really grasp the whole editing-live-objects-which-don’t-live-in-files thing.

It sounds pretty neat and pretty powerful.

Comments

The Power of Binary Searching

I always knew that binary searching was fast, O(log2) and all that. But when you have to run it by hand over 3000 subversion revisions, looking for the place where you introduced a memory leak, and after four steps you’ve eliminated 93% of the search space, you get a new appreciation for it.

There are some tools out there for automating these searches through subversion. They didn’t fit our problem though because determining whether we were showing a memory leak was fuzzy.

Turned out to be 4 memory leaks. Two very minor ones, and two major ones in third party libraries, one of which only showed up on the Mac platform.

Thanks to binary searching, we could quickly identify the exact spots where these leaks were introduced.

Comments

Bjorne Stroustrup lecture

I saw Bjorne Stroustrup give a lecture as part of the New York City Google TechTalks. Pretty interesting stuff. More updates to the language that I was expecting. Some much desired features too.

Two downsides:

  1. the language is going to be that much more complicated. I’m looking at you, seperate meta-type system for controlling templates
  2. it took so long for the STL and templates to get good enough support, I doubt I’ll see any of this until 2015

Comments

AppleEvents: Apple’s worst documented API?

If you are trying to register a callback on getting a URL passed to your program through AppleEvents, don’t use the documented kAEInternetSuite and kAEISGetURL enums. They are defined as ‘gurl’, but the actual value passed to your program is ‘GURL’. From what I can tell, everyone defines their own enums because this is well known.

Apple can’t fix it though, because it would break everyone’s software. So they keep documenting it as ‘gurl’, and we keep redefining it to the actual value.

Awesome.

Comments

Python 3000 Status Update

Guido van Rossum’s Python 3000 Status Update. Nothing new if you’ve watched his tech talk, but still an interesting read.

Comments

perks and perils of caffine

At my job, we have one of those new espresso pod machines in the kitchen. Usually after lunch, I’ll start to get a little drowsy and need a caffine kick.

Today, I chose the heavy duty espresso forte pod and made myself a double espresso.

After finishing it, I immediately found the puzzling bug that the lead dev and I had been staring at. Super. I then misread the spec and dove deep into Qt4’s QTableView MVC architecture before coming up for air.

There are twothreefour1 things wrong with caffine.

  1. Too much and I get anxious and my heart starts jumping
  2. I start thinking too fast and making mistakes
  3. I hear you can build up a tolerence, so I’d need more and more to have the same effect
  4. The inevitable crash

I try to not have it every day, so I can preserve the wonderful, creative effect it has.2

  1. No one expects the Spanish Inquisition! []
  2. This post was a result of caffine []

Comments

« Previous entries