This morning I went for a little paddle at Bay Creek in my Thunderbolt. Last week I went for a paddle at Dan’s in my surf ski, but it was too early – I had to stop paddling because my shoulder was sore. This time, I had to stop paddling because I’m a fat out of shape lump. I made about a mile, in about 15 minutes (so it took me nearly twice as long as it would have taken me when I was in shape). I didn’t actually feel any soreness except one little catch when I picked up my boat. And I’m still feeling ok now, 12 hours later. Fingers crossed that it stays that way. If I don’t have any contra-indications, I would like to try another paddle next weekend. (Yeah, I’d like to go earlier, but I’ve got to do this slowly and carefully.)
Category: Revelation
StackOverflow
StackOverflow (aka “SO”) is the best site on the net for asking and answering questions about programming. Not about the job of programming (there is another site in the same family) but specific problems in “how do I do this” in programming. One of the ways it became good and stays good is that when you ask or answer a question, other people can vote your question or answer up (or down) and you gain (or lose) “reputation” points. (In the early days of the site, I tried to get people to call them “XP” as we called experience points back when I played Dungeons and Dragons, but to no avail.) The points aren’t good for anything in the real world (except they’ve sent me a couple of free t-shirts because of my work there), but we geeks prize being ranked, and so getting more reputation is a desirable thing. Plus you get some more rights and privileges at certain XP levels.
Because I was active in the beta of SO, and it was in beta at a time when I was bored out of my mind at work, I have pretty high reputation. In the first year of the site, I was in the top 15 users, and I think I’m still in the top 150 or so. But when I look over my past contributions, I see a bit of a pattern – most of my points come from one of two types of responses: “Fastest Gun In the West” (FGITW), where I was the first person to answer a fairly trivial problem like “how do I count how many items in an array in perl” and “Crusty Old Guy Imparting His Wisdom To the Newbies” where I try to impart some of what I’ve learned in over 25 years of working in good places and bad places and places that leave you so bored you spend all your time on SO. There aren’t enough of my answers where I actually took some time and effort to research something, write some example code and test it, or generally did something that somebody else couldn’t have done just as well. And in a way, I feel like it’s almost too late to change that – there are so many people on SO answering questions that unless you have something really specific where you just solved a very difficult problem you were having on something very obscure, somebody else is going to have the same answer as you.
So these days I try to resist the urge to answer the FGITW type questions. Instead I’ll put a comment after the question, and I’ll wait for the first couple of answers and see if I have anything to add, either in comments on the answers or by directly editing them (one of the privileges of high XP I mentioned earlier). I don’t care if I get points for them any more, I don’t want points for those sorts of answers. The other thing I do a lot of on the site these days is “patrolling” – looking for spam, stupid questions, joke answers, and the like, and voting to close them, voting them down or flagging them as spam or abuse, etc. I have considered running for the position of community moderator a few times, but in the last couple of elections they’ve demanded that you have done certain things on the Meta site, and I hate that place.
But of course, now that I’m trying to resist the urge to get meaningless XP for FGITW, I feel like everybody should have had the same revelation at the same time as me, so I have to resist the urge to tell people off for doing the same thing. I was actually prompted to make this blog post because I looked at a question a few hours ago, recognized it as a FGITW type question, and when I waited for answers, discovered that the first two were people like me, with +50K in XP. Hey, idiots, we know you’re smart, how about letting somebody who needs some XP have those points and do something to improve the site! It seems so obvious now that I’ve had the epiphany.
Stupid Perl Tricks
I’m certainly delving into some depths of Perl I’ve never touched before.
I need to lookup a record in one table using a subclass of DBIx::SearchBuilder::Record, and depending on what it says in the “table_name” column, look up a record in one of several other tables, each one of which has its own subclass of DBIx::SearchBuilder::Record. And after some delving on the internet, I was amazed to find out you could put the class name in a variable when you “new” it. Unfortunately you still need to “eval” the require statement.
my $mainRec =
RTx::FooProject::Record::MainTable->new($cfHandle);
$mainRec->LoadById($main_id);
# Ok, here comes the tricky part. Try to get figure out the class name
# from the table name
my $table_name = $mainRec->table_name;
$table_name =~ s/^dsu/DSU/i;
$table_name = ucfirst($table_name);
$table_name =~ s/_([a-z])/uc($1)/eg;
$table_name =~ s/s$//;
my $subRec;
{
no strict 'refs';
my $fullClass = "RTx::FooProject::Record::$table_name";
eval "require $fullClass";
$subRec = $fullClass->new($cfHandle);
$subRec->LoadByCol("main_id", $mainRec->id);
$self->SubTableRec($subRec);
}
I literally threw my hands in the air in exultation when it worked. And then was rather painfully reminded of my recent shoulder surgery.
Perl and IDEs
From about 1987 to about 4 or 5 years ago, I did all my software development using vi (and later gvim), ctags, and all the Unix command line tools. But towards the end of my time at Kodak, I got the Eclipse religion, at least as far as doing Java. Sure, I dislike having to move my hands away from the keys to move the cursor around all the time, but the code completion, integrated debugging and all that other good stuff won me over. The ability to click on an existing method call and see the javadoc for the method and to hit F3 and be taken to the actual code was a game changer for me. So much better than ctags. But for non-Java, whether shell scripts at work or perl at home, I still relied on gvim and the other command line tools.
But I’m about to start a huge and long term perl project, a large part of which is trying to learn all I can about an existing open source code base. So I wanted to see if an IDE would give me an advantage in terms of moving around the code I’m trying to learn. I installed the EPIC plugin for Eclipse, and also a dedicated perl IDE called “Padre”, and noodled around on both, and so far I’m forced to conclude that neither of them are as useful in perl as Eclipse is in Java. The biggest missing feature seems to be that F3 gets me the wrong function or method declaration most of the time. I don’t know why, possibly the typing system in perl is too weak for the sort of analysis and introspection that Eclipse does in Java.
So I think I’m going to be back to doing gvim and ctags and find and grep and perldoc and all the other fun stuff.
Moving on, moving up…
I was a little bit annoyed at work this week – they had me rush rush rush to finish something, and when I did they didn’t seem to have anything more for me to do. Ok, if I’m honest with myself, this new subproject they put me on has annoyed me because nobody seemed to want to communicate, and so maybe I wasn’t making the effort I should have to go find something to work on when they didn’t give me something. But still, I was mildly annoyed.
And then out of the blue, an on-line friend popped up on Facebook and said “hey, do you know any perl programmers looking for a job?” Well, I’ve done a fair amount of perl coding for my navaid.com site as well as scripts here and there at Global Crossing and Kodak, although I’m not one what you’d call a “perlmonger” or “perl monk”. As a matter of fact, I’ve been seriously telling people on StackOverflow that if I weren’t so proficient in perl already and didn’t have so much working code written in perl, I would seriously be trying to forget everything I knew about it and learning python instead. So I asked him for more details. But he quoted me an hourly rate that was more than double what I’m currently making. I suddenly remembered that I’m a perl God.
The contract involves learning all there is to know about their business process, and all there is to know about an open source project called “Request Tracker” (aka RT), and seeing how much of their business process I can shoe-horn into RT (using its built in customization hooks and APIs) and how much would require custom coding of separate apps that maybe talk to RT for some parts, and doing the customizing of RT and the custom app coding.
In some ways this job looks like enormous fun and quite a growth experience, but “growth experience” also means “opportunity to fail” so I’m also somewhat scared of this. Not only do I have to become proficient in RT and in corners of the perl world that I’ve never touched before (Mason, anybody), but I’ve got to do my own requirements gathering, project plan, and every other aspect. I’ve got nobody else to blame if things don’t go right. But looking at the sunny side, if I do this right, I’ve got a major successful project on my resume and a happy customer to vouch for me for the next thing that comes along. It’s going to be great!
Anyway, long story short, I just turned in my notice at my current job. No more 3.5 hour return drives to Ithaca every week or two. (I just spent over $1000 on flights, hotels and rental car for a week down at their site for the project kick-off one week info dump, though.)