Saturday, May 02, 2009

Yearly Cost of a Minute per Day

Do people at your job ever complain about waiting for slow computers? Have you ever considered the cost? It might be more expensive than you thought.

Due to overhead, companies charge employees at a higher rate than that employees salary. Consider a case where a company charges salaried employees at $960/day or $120/hour. At 8 hours/day and 60 minutes/hour, that comes to an even $2/minute.
$960/day * 1 day/8 hours * 1 hours/60 minutes = $2/min

Now consider that rate of $2/min for 1 minute each day over the course of a year. It turns out to cost $500
1 min/1 day * 1 year * 250 day/1 year * $2/min = $500

At $500 minute per day per year, if old hardware and software is costing employees 10 minutes per day, that's $5000 per year, for each employee.

Yearly Cost per Minute per Day = $250*DR/480
where DR is daily rate. What's your yearly cost per minute per day?

What else wastes time at work? How much time do people spend walking back and forth to distant water coolers?

Sunday, November 30, 2008

stop refactoring

The term "refactoring" was made trendy a while ago by Martin Fowler, et al. Given that programmers are not generally fans of marketing, it surprises me that what is effectively a marketing euphemism for "rewriting" has become so popular. I think it's time to go back to the olden days, when people called refactoring what it is: rewriting.

Wednesday, November 26, 2008

refactor later

There's a saying in chess, "When you see a good move, look for a better one."

I've found this applies to programming too. Too many times, I've seen something I didn't like in code and rushed to rewrite it. The outcome, very much like when I rush a move in chess, rarely comes out as well as I'd hoped.

So, when you see something that could be refactored, refactor it later. By then, you're certain to have improved in several ways your plans to rewrite.

Sunday, October 26, 2008

testpp c++ testing framework

testpp is a new c++ testing framework I've developed. It's meant to be:
* Easy to use
* Simple enough to be used without macros if desired
* Can run individual tests, files or suites from the command line
* Various output formats, user-definable
* Clear, operator-based assertion syntax

http://github.com/mdg/testpp

Monday, September 22, 2008

computer dreams

I was having a lame dream last night when I woke up. In my dream, the huge software project I've been working on had achieved self awareness (it's just a big web site, we're not trying to build artificial intelligence). And in the dream, we had given the project a female personality. And it started hitting on me. Not in a nice way either. It was in a scary, fatal attraction way.

I gotta get off this project already.

Tuesday, September 09, 2008

2008 git survey

Try taking the git survey. It's a little long, but you can just skip over anything that looks too long or you don't want to answer.

Friday, September 05, 2008

how is subversion still alive?

I first looked into Subversion (SVN) many years ago, after hearing its slogan: "CVS done right". This sounded good to me at the time, and I'll allow that at some point, maybe it made sense. I wasn't using it seriously at the time and only gave it a superficial lookover. It seemed pretty good.

The other day I was just looking into it more seriously because I'm now using it at work. Wow. What a pos. If you're a Subversion user, please excuse me. To those of us who have seen the light of distributed SCMs, Subversion might as well be Visual SourceSafe. By that I mean that Subversion is more similar to Visual SourceSafe than it is to modern distributed SCMs like git or mercurial.

The most amazing thing about Subversion is that it has no branch or tag commands. Instead, it has a bizarre "copy" command that does utterly different things depending on whether the arguments you pass refer to the working copy or a URL. One permutation copies a file and schedules it to be committed. Another permutation immediately commits the working copy to a URL. What does that even mean and why do I want to risk doing it accidentally when I really meant to do "cp file new_file; svn commit new_file;"?

A third permutation branches or "tags" the repository. First, to actually branch, you need to know the repository layout. Repositories are so simple that this online book devotes an entire chapter about how to choose one. Why should I have to care about a repository layout? Even CVS has the good sense to just give me a simple, straight-forward branch or tag command.

The other insane thing about SVN is that tags aren't fixed. They're exactly the same as branches and can be committed to. Seriously? Wtf is the point of that? To make them fixed, you have to read another chapter about access control scripts. And people say git is hard to learn...

Apparently Subversion's developers are continuing to work on it, trying to catch up by adding features like offline commits and merge tracking that are inherently part of a true distributed SCM. Subversion, please give up and start using git or hg, they already do all the things you wish SVN could do one day. It's time for Subversion to retire.

Monday, September 01, 2008

Even on IMAX, The Dark Knight wasn't that great

I went to see the Dark Knight in IMAX at 8:45pm Friday night. Even though we got there early, it was still sold out. So we got tickets for the 12:30am showing and went to dinner to kill time. It's hard to kill 4 hours though so we still had to wait a while. And by 12:30 I was quite tired already and kind of wished I was home in bed.

Maybe I just had the wrong attitude going in, but even on IMAX I found it underwhelming. I did see why people are so impressed by Heath Ledger, but the rest just left me feeling like I endured it, rather than enjoyed it. Maybe it would be better earlier in the day and without having to wait 4 hours.

Sunday, August 24, 2008

rake for c++

In the c++ program I've been working on, shessiond, I had been using GNU make. Unfortunately make blows. I got it to build, but it wasn't doing incremental builds, it was rebuilding everything everytime. This worked for a while because it was small. Now it's growing larger and I finally got sick of full rebuilds everytime.

I considered mucking with the Makefile to get it to work. I even have the GNU Make book. But, it isn't much different than a longer version of the make man page.

I also looked at scons. At first it looked like it had good documentation, but it's not as much or as helpful as it first appears. There was no obvious, simple example of compiling source objects _and then_ compiling those objects into an executable. Also, they seemed to have an odd build system that they almost threaten you with on the developer page.

So Rake seemed good. I decided this because it's also hosted on github. Most Rake documentation is for using it with Ruby. The few C++ examples I could find were pretty realistic.
* http://rake.rubyforge.org/files/doc/rakefile_rdoc.html
* http://www.ruby-forum.com/topic/58444

After a while of messing around, I finally got it working. Most of my confusion here came from the Ruby syntax, which I think I'll adjust to. And, as opposed to the Makefile, when I got the Rakefile working, I actually understood the important parts of how it works.

The one thing I'm still trying to resolve is an issue with the build paths. I tried to configure it to build my source files into a separate obj directory. This works for my files in the src/ directory, but breaks when I try to compile test code in the test/ directory. It seems a solvable problem though, and far less intimidating than trying to figure it out with make.

The other remaining issue is dependencies on headers. This is covered in the link above though, so I expect to get it working once I actually try to do it.

shessiond

I started working recently on a new software application. It's purpose is to allow web applications to share sessions across multiple servers. It's called shessiond and is hosted publicly at github. It's not ready for production yet, but it does work and I think it's far enough along that it's interesting to look at.