Archive

Archive for August, 2006

Steroid programming

August 29th, 2006 Grant 1 comment

So today I was sitting in the lab watching some Solaris code compile when Jonathon Lepolt walked through complaining about the heat in the office. I guess the air conditioning was acting flaky, although I wouldn’t know since the lab felt fine and I’d been there for hours. We got to talking and he jokingly posed the question of whether or not there were performance enhancing drugs in programming.

That’s not the typical tech question I run into every day.

I don’t know if he had just been reading about Barry Bond’s trainer legal troubles or if he is secretly juicing in preparation for the annual Seapine golf tournament. (Which he happens to be organizing, hmmmm.)

Anyhow, I responded that we probably don’t have a whole lot of Cream or Clear or HGH in this industry as you don’t often see programmers go all berserker with ‘roid rage.

Now caffeine usage is something else entirely (curse the Seapine free soda refrigerators) but I doubt it really makes that big a difference when writing code. Besides, how could you clean out caffeine from the software industry? That would be like banning riders in order to run a clean Tour de France.

Translation: It’s impossible.

Categories: Juice Tags:

And who says Apple is always the one that has style?

August 23rd, 2006 Grant 1 comment

So I was debugging some code a while back on Linux using gdb from the command line.

Oh yeah, old school.

Anyhow, during one of my runs I accidentally attached gdb to its own process. It went something kinda like this:

lammig@linux-mbp:~> gdb
GNU gdb 6.4
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i586-suse-linux".
(gdb) shell ps
PID TTY TIME CMD
4630 pts/1 00:00:00 bash
4713 pts/1 00:00:00 gdb
4714 pts/1 00:00:00 ps
(gdb) attach 4713

I refuse to debug myself!

(gdb)
lammig@linux-mbp:~>

Now that is one cool error message. In fact, that is quite possibly the best error message I’ve ever seen. This got to me wondering, is it the same for gdb on different platforms? Let’s take a look on FreeBSD…

cerebro/lammi:~ (1) gdb
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".
(gdb) shell ps
PID TT STAT TIME COMMAND
66600 p4 Ss 0:00.04 -tcsh (tcsh)
66609 p4 S+ 0:00.01 gdb
66610 p4 S+ 0:00.01 tcsh -c ps
66611 p4 R+ 0:00.00 ps
(gdb) attach 66609

I refuse to debug myself!

(gdb)

Rock and roll, score two for the open source OS guys. Now this made me wonder, with all their crazy attention to detail, what would Apple do with something like this.

There’s only one way to find out…

lammi-mbp:~ lammig$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:10:58 GMT 2006)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".
(gdb) shell ps
PID TT STAT TIME COMMAND
261 p1 S 0:00.03 -bash
299 p1 S+ 0:00.03 /usr/libexec/gdb/gdb-i386-apple-darwin
(gdb) attach 299

unable to debug self

(gdb)

unable to debug self?

You’ve got to be kidding me. It’s not even a sentence. There’s not even capitialization or punctuation. Aye caramba.

Just for kicks let’s see how stodgy old Solaris talks to us…

bash-2.05$ /usr/local/bin/gdb
GNU gdb 6.0
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.9".
(gdb) shell ps
PID TTY TIME CMD
1579 pts/1 0:00 bash
1585 pts/1 0:00 gdb
1586 pts/1 0:00 ps
(gdb) attach 1585

Attaching GDB to itself is not a good idea…

(gdb)

Come on Apple, even Sun of all places has a fun error message. I wonder if I should submit a bug to see if they can fix it in Leopard?

Categories: Debugging Tags:

Writing design documents that can be read without reading

August 22nd, 2006 Grant No comments

When I was in college I had an excellent CS professor who had chosen as one of his research areas education in computer science. One could argue that it has worked out well for him since he is the department chair and a full professor today.

Going through his classes I learned, which I probably already knew but didn’t realize, that I’m a visual learner. While I read constantly and I understand what I read just fine, if given the option of reading text or looking at graph or diagram I’ll take the latter every single time. It could also mean that I’m lazy but for the sake of argument we’ll ignore that possibility for a moment. (Even if it might actually be true.)

You can see this preference today all over my desk. I have notebooks full of notes and little pictures, books with yellow post-it notes marking pages of diagrams, and a ton of graphic filled design documents that I’ve written sitting on my hard drive. It’s that last one that is really interesting to me because I’ve found that littering a design document with diagrams helps solve two huge problems:

1. Design documents are generally horrifically boring.
2. A lot of times people don’t actually read them.

Now, part of the solution for Item #1 I read about years ago and I think is summed up fantastically already. In short, writing well and being funny encourages people to read.

If, however, that isn’t enough to make reading the words happen then a picture can get the idea across despite the user’s best efforts to ignore it. Let’s take an example.

First using words:

“In order to log on to the Surround SCM GUI client the user will enter their username and password information and click the Connect button. Once the credentials are validated the main client screen will be displayed. If the credentials are invalid then an error message will be displayed that shouldn’t mock them for being forgetful.”

Now using a picture made with the fantasic OmniGraffle:

sampleflow.png

Both get the same idea across but which one has the lower barrier to cross for the attention of the user? Think of it as reading a book versus watching a movie made from the book. The movie (generally) gets the idea across the same but it accomplishes it in two hours while sitting in comfy chair with a box of popcorn. The book, while rewarding, won’t be done in two hours and you have to make the popcorn yourself.

This isn’t the greatest viewpoint to take for everyday life, picking a movie over a book, but I think it is a very good one when it comes to software design. If by making the design so easy to digest for the reader, especially those in areas like sales and support that have better things to be doing, you can get much better feedback much earlier in the process.

(And that’s a good thing.)

Categories: Design Tags:

First Post! (Score:-1, Offtopic)

August 17th, 2006 Grant No comments

So this RSS blog thingy is going live on Friday and they say I need to have a first post in it when things start rolling. I guess not having an initial post would be like, well, hmm, I don’t know exactly but I’m told it would be bad.

That being said, I’ll start things off with a list of all the neato things I learned at Apple’s WWDC this year.

1. *Item removed per non-disclosure agreement*
2. *Item removed per non-disclosure agreement*
3. *Item removed per non-disclosure agreement*
4. *Item removed per non-disclosure agreement*
5. *Item removed per non-disclosure agreement*
6. In Russian, the same word is used for “foot” and “leg” while in English there are two distinct words.

Since I can’t talk about items one through five we’ll skip directly to numbers six. Yan and I walked all over downtown San Francisco one afternoon shopping around for high priced tourist junk to bring back home. When we finally sat down he said something to the effect that his legs were killing him. Having just recruited him not too long ago for my indoor soccer team I was a little concerned that a leisurely stroll had caused such a condition, namely I was concerned what condition he’d be in when we have our first doubleheader.

I replied that my legs felt fine, but that my feet were tired. He then corrected himself explaining that he really meant feet but that in Russian (his first language) that “feet” and “legs” share the same word and that he still applies that line thinking sometimes when speaking in English.

I of course then asked how one could tell the difference, say if you were trying to tell the doctor that your foot hurt. He claims that in context it all makes sense. I decided not to press the issue but I still wonder if that means:

soccer == futbol == football == legball

Something to ponder I suppose.

Categories: Uncategorized Tags: