Disclaimer

The content of this blog is my personal opinion only. Although I am an employee - currently of Nvidia, in the past of other companies such as Iagination Technologies, MIPS, Intellectual Ventures, Intel, AMD, Motorola, and Gould - I reveal this only so that the reader may account for any possible bias I may have towards my employer's products. The statements I make here in no way represent my employer's position, nor am I authorized to speak on behalf of my employer. In fact, this posting may not even represent my personal opinion, since occasionally I play devil's advocate.

See http://docs.google.com/View?id=dcxddbtr_23cg5thdfj for photo credits.

Saturday, December 13, 2008

I want an apprentice

I want an apprentice.

I want a junior program who can work with me. Not necessarily pair programming.

An apprentice at my beck and call, who I can call over to my screen when I realize "Here is a little bit of automation that needs to be doing" - who I can explain, verbally, what needs to be done, and whose job it is to make enough notes, and then just do it.

There are always a lot of little programming tasks that need to be done, but which I deliberately neglect in the rush to get urgent, quick and dirty, results. Darn! That may be a career limiting admission: sometimes I do not go and clean up the code or write utility functions when I see the need. Most people would accuse me of not being quick and dirty enough.

It's hard to balance "Getting to the answer as quickly as possible" and "programming well".

part of the problem is that, as a computer architect, my output is not really the simulator. My output is the hardware recommendation, the perf data, the simulation results. The simulator is just a tool, and if it were throw-away, that would be great. But, the simulator is not thrown away, except maybe once a decade. It is an asset that is constaly built upon.

And it is hard to balance getting the answers vers keeping the simulator clean.

Many programmers don't have this problem.

Usually because they simply just aren't as good programmers as me. They don't know how to do things right.

But sometimes because they don't know some of the really fancy quick and dirty programming tricks that I know.

I.e. because I am a pretty good programmer, better than most, I can write really good code -or really quick and dirty code.

The balance is hard. Sometimes I am rushed.

Hence the apprentice. If I had two apprentices, one could be devoted to pair programming, and the other to "doing the right thing". Basically dedicating 50% of apprentice resources to making the code better.

Plus, the apprentice making the code better does not have to thrash. His job is to make it better. Period.

Why RAII is convenient

RAII is convenient in C++.

Essentially, it is the trick of using the destructor to do something like arrange flr printing of a data structure.

Essentially, it is a trivial form of introspection.Practically the only way in C++ than you can automatically traverse a type, and al of its members.

Today, I would like to automatically create a print function. I am tempted to use RAII, so that it gets printed at destruction. That seems silly, however; but it is the only way I know to autromatically call a method on all members.

Change

I fear this is the start of one of those days.

I'm working on Saturday, instead of getting a Christmas tree, putting up Christmas lights, etc. Big review meeting on the 22nd or 23rd.

Walk the dogs at 5am. That was okay.

Can't find hummus in the only grocery store open at 6am.

The UsualPC Startup Hassles:

At work at 6:30. The usual PC startup hassles, which I am sure that anyone who has ever read my blog is bored with, but which venting about keeps me sane. Bottom line: I'm just starting to work at 7:35.

Laptop PC comes out of standby. The usual circa 5-10 minutes of inability to type. I go and get tabouli from the fridge.

Laptop responsive, but slow. The Connected DataProtector backup is running. This backupprogram has a dialog box with a cancel button, but experience has shown that it doesn't respond quickly to the cancel button - 10 minutes being not unusual. Experience has shown that the fastest way to cancel Connected DataProtector is to restart the PC. (Killing the process damages some database that the backup program uses.) So, I hit the cancel button, and also try to go Start/Shutdown/Restart, which takes about 6 minutes because the machine is so slow. But, as usual, restart happens before Connected DataProtector has noticed that I wanted to cancel.

(My laptop was plugged in at home all night - but the backup program was apparently unable to detect idleness and thus did not start until after aI reopened my PC at work.)

Along the way, noticed a new IT patch, probably a security patch, is also slowing things down.

Restart eventually happens. I log in, and then walk away - I am learning that I might as well go and get a tea while waiting for all of the startup and login stuff to settle down.

Company now has free drinks (coffee, tea, and soda) as well as free fruit. One of the nice things that happened since the new guy became CEO. But, no free drinks on the weekend, only when the cafeteria is open.

Disincentives to Working Extra Hours:

As I walk off to get my tea, I think to myself "Why should I bother coming in on the weekend?"

a) My computer is so slow - I will have wasted half an hour (that was before I realized it was turning into a full hour wasted) just waiting for my PC to become usable.

During the work week, say, if I come in at 9am, I can usually find somebody to talk to while waiting for my computer. In fact, such informal, drop-by-their-cubicle, conversations are one of the best ways of staying in touch. Not just socialization, but work related conversations, asking for help, advice. But, if you come in on the weekend, or even early on a workday (say, 6am, or even 8am), this way of overlapping the time wasting of PC startup is lost.

b) I can't even get free tea when the cafeteria isn't open.

Two disincentives for working extra hours on the weekend.

Change:

But, more: I find a vending machine to buy a back of almonds and tea.

The almonds cost 1.10$. I use a 20$ bill. Usually the vending machine provides change mainly in Sacagawea dollar coins, but today:

20$ - 1.10$ = 18.90$
= 4.25$ in quarters + 10$ in dimes + 2.65$ in nickels
= 16.90$ => I was shortchanged 2$

Yes: I sat on the floor and counted all 170 coins. Do you know how hard it is to make 20 nickels into a stack?

When I was young, I used to obsessively count my change. I do so less often now, in part because I use credit card so often. I wonder how often I have been short-changed or long-totalled?

...

But even after all of this, my PC is not quite usable.

Are Slow PCs good for the Environment?:

I probably should just not get stressed about my PC startup times. I probably should just plan on starting my PC, and going and getting tea first thing in the morning.

Currently, I try to save time by parking such that I walk by the cafeteria to get tea on the way between my car and my desk. Unfortunately, I do not carry a reusable mug with me,so I end up usimng a disposable paper mug. I.e. just adapting to my slow laptop might be good for the environment: park, go to my desk, start my PC, pick up my mug, walk to the cafeteria, get tea, walk back to my desk, and, one might hope, find that my PC is up and ready. Although probably it is asking for me to click on some dialog box.

Getting off to a Quick Start

Why does slowness in PC startup bother me so much?

I am a morning person. I wake up raring to go, wanting to start work RIGHT NOW!

I have often thought about a solution to a problem overnight - often while drowsing in bed. Should I admit that I often dream about work problems, computer designs?

When I get up, I want to start work right away. If I don't, sometimes the solution drifts away.

I resent something so basic as having to feed and walk my dogs in the morning. I resent wasting time driving to work. Actually, I more resent time spent in busy work such as feeding the dogs; I can think about work in activities such as walking the dogs that I can do fairly automatically, although there is always a risk of forgetting.

I used to wake up regularly early in the morning or in the middle of the night and hope ontomy computer. Now, since it takes a randomly long time to start up, I no longer do so.

I resent the fact that I get so frustrated by my PC's slowness that I am impelled to blog about this. Writing this blog has taken 45 minutes. I would rather not have this to bitch about.

I would rather that I had speech recognition, so that I could speak this blog instead of typing it. I speak much faster than I type.

Resuable Mugs:

Recently, a few months after my company started the free drinks policy, signs started appearing saying "Please use your reusable mug instead of paper."

That's fair enough - although, as I mentioned above, one does not always carry the mug around. I already carry enough crap around that I roll my bag.

Methinks it would be better for the cafeteria just to provide washable mugs: I go to the cafeteria, pick up a mug. Probably with a lid. Drink it. Eventually, leave it in the vending area along with the food trays. Eventually it gets taken back to the cafeteria and gets washed.

Downside: more cafeteria staff effort required to pick up the mugs. Some possibility of theft, lossage, breakage. I suppose that giving people their own mugs moves responsibility to the end user.

But then don't bitch if you don't get as much reuse as you might like.

Change people's habits, or adapt to them. I am people centered: I prefer to adapt the system to the people, rather than vice versa.