Tuesday, September 27, 2005

As I've made my way from being a greenhorn programmer (It's now around 8 years since I wrote my first C program, and more than 12 since my first BASIC program) to being reasonably competent, I find reading technology-specific programming books less useful. Unless I am doing work with some newfangled technology (or some oldfangled technology that's new to me), I've stopped reading books related to the latest C# fu, or .NET remoting, or managed sockets, or whatever is the newest buzzword in network programming. Books more generally related to programming per se, with insight into general, non-language-specific concepts seem more useful to me. Language and platform-specific books serve as great references, to be picked up when a task is to be accomplished at work(or elsewhere - but I am a mercenary coder right now :-))

I just started reading "The Practice of Programming" by Bob Kernighan and Rob Pike. So far, I've liked concepts put forth in the book related to the real-world practice of writing efficient yet readable and maintainable code. It talks about things like how much commenting in a program is important (my answer: go with what feels right - is fairly close to theirs). Another gem is how using funky operator combinations to do ten things in a single line of code is a bad idea. It will take the reader two hours to understand it, and a day to decode issues with it. The "if A ? A:B" format for a condition in C is as complex as a line of code should get.

I'm still reading the book, and it's been a fascinating one and a quarter chapters so far. Most of these things I've picked up over the course of time, with experience. Some are probably situations I haven't encountered, so knowing the scenario a priori isn't too bad.

Also on the list: The much-revered Art of Computer Programming by Donald Knuth.

While I'm at it, "Code Complete" and "Writing Secure Code" too. It shall all be done. One insight at a time.

Another area that I would like to explore is languages. Being an Electronics student in my undergraduate years and a networking/systems major in grad school, languages/compilers and the evolution of these concepts is an area I've never really explored. I've heard good things about The Design and Evolution of C++ which may be a reasonable place to start.

Monday, September 26, 2005

Good Will Quotes

Cleverly written films are always a pleasure. One of my favorites in this category is "Good Will Hunting." An eerily prescient monologue from the movie which came out in 1997.

Will, in an interview with the NSA:

Why shouldn't I work for the N.S.A.? That's a tough one, but I'll give it a shot. Say I'm working at N.S.A. Somebody puts a code on my desk, something nobody else can break. So I take a shot at it and maybe I break it. And I'm real happy with myself, 'cause I did my job well. But maybe that code was the location of some rebel army in North Africa or the Middle East. Once they have that location, they bomb the village where the rebels were hiding and fifteen hundred people I never had a problem with get killed. Now the politicians are sayin', "Send in the marines to secure the area" 'cause they don't give a shit. It won't be their kid over there, gettin' shot. Just like it wasn't them when their number was called, 'cause they were pullin' a tour in the National Guard. It'll be some guy from Southie takin' shrapnel in the ass. And he comes home to find that the plant he used to work at got exported to the country he just got back from. And the guy who put the shrapnel in his ass got his old job, 'cause he'll work for fifteen cents a day and no bathroom breaks. Meanwhile my buddy from Southie realizes the only reason he was over there was so we could install a government that would sell us oil at a good price. And of course the oil companies used the skirmish to scare up oil prices so they could turn a quick buck. A cute little ancillary benefit for them but it ain't helping my buddy at two-fifty a gallon. And naturally they're takin' their sweet time bringin' the oil back, and maybe even took the liberty of hiring an alcoholic skipper who likes to drink martinis and play slalom with the icebergs, and it ain't too long 'til he hits one, spills the oil and kills all the sea life in the North Atlantic. So my buddy's out of work and he can't afford to drive, so he's got to walk to the job interviews, which sucks 'cause the shrapnel in his ass is givin' him chronic hemorrhoids. And meanwhile he's starvin' 'cause every time he tries to get a bite to eat the only blue plate special they're servin' is North Atlantic scrod with Quaker State. So what do I think? I'm holdin' out for somethin' better. Why not just shoot my buddy, take his job and give it to his sworn enemy, hike up gas prices, bomb a village, club a baby seal, hit the hash pipe and join the National Guard? I could be elected president.

Thursday, September 22, 2005

The secret life of the clergy

Ed Norton, as always, a prime pick. I tend to choose films by directors and not actors - Chris Nolan and Baz Luhrmann being directors whose complete (full-length film) works have been consumed, with Steven Spielberg and Cameron Crowe high on the list too. Ed Norton's an exception. Primal Fear, Fight Club and The 25th Hour later, Ed Norton's a guy whose films you watch, simply because he's chosen them.

Keeping the Faith was similarly recommended. Picking up the DVD, I realized that he's directed the movie as well. This gets better.

The premise is simple. Two guys. One girl. They've been friends forever. She left when they were in eighth grade and went to the other coast. Now she's back. She's beautiful, smart, the kind they both fall for.So, a love triangle, right?

Not completely. He's a priest. Catholic at that. His best friend's a Rabbi. She's not Jewish - complications all around. He wants to tell her. His friend already has. She likes him (the Rabbi, that is) as well. Problem: He cannot see her and continue his relationship with his mother or the Synagogue. Ah, the tangled webs we weave.

For me, the film was a revelation in some ways. It showed a couple of clergymen of two of America's most prominent religions as regular guys. They wear shades, play basketball, and yes, occasionally swear too. Seeing them out of their robes was a surprise by itself. (I don't know, imagining our batt-ru in a leather jacket doesn't quite gel).

They falter, as all humans do, and find the faith (in themselves and those around them) to carry on. The film is reasonably well written, offering all three - Ed Norton (the priest), Ben Stiller (the Rabbi) and Jenna Elfman enough to do. Ed Norton as always lives the role, something he did frighteningly well in Primal Fear. Ben Stiller is subtler than some of his more recent roles, showing he's capable of better, and Dharma fits the role to a T.

The whole love triangle thing gets a tad awkward at times, but nothing to kill the movie completely. Some laughs, some tears, a drunk scene, a showdown, a punch and all's well with the world again. I admit, I probably liked the film more than I should have and I'm rating it better than it deserves to be rated.

Everyone thinks his story is the one with a twist.

Edit: Fixed a typo

Friday, September 16, 2005

Binary Politics

This two-party thingy that the US has going is so boring. "You're with us, or you're against us" bumbles our dear Prez. The only problem is, for a mind more nuanced than W, there are more options in life, though not on the ballot paper.

Social dinner conversation:

Me: " If not for some things, there is a high likelihood of me being Republican."
(That I cannot vote is immaterial here. An Indian holding forth on politics/cricket is extremely common.)
A couple of wide-eyed looks around. These expressions are in jest, as I've committed the sin of actually coming out for this government, although I've done nothing of the sort.

Me, a few minutes later in the conversation:" Well, a better way to put it is that I'm socially liberal and fiscally conservative"

Someone: "Then you're libertarian".

Me: Um...

I hate tags of all sorts. My opinions on each issue are formed by the issue at hand and my dogmas (which I have very few of). Over the course of time, I've seen that my beliefs align with being libertarian, but I'd like to resist that tag, solely because I dislike it. There are people online calling themselves libertarian whose tone of writing I find condescending and superior. If being libertarian means being like them, I think I'll pass.

However, what is it with this binary mode of thinking? Why does everything have to come down to whether you like this head of state and his cohorts or not? Maybe you don't like some of what's going on. There are other things that they may be doing right(OK, I don't see anything myself). I thought politicians taking cheap shots during national crises was a bad thing. Seeing all the Democrats taking shots at this (admittedly bumbling) President makes me cringe. I mean, we know Global Warming's happening, but America responsible for the hurricane? Get a life.

Of course, the conservatives have done themselves a world of good by aligning with the evangelicals. God hath wrought this fury upon the devil worshippers indulging in the revelry of Mardi Gras in New Orleans. But, but, but, don't the Mardi Gras revelers leave on the next flight out, leaving the residents to their jazz and blues? Is spring break in Florida not equally wanton? And I'm sure Halloween in Boston isn't exactly kosher.

I'll make up my mind based on the facts. The problem is, biased media all around refuses to give me the facts to make up my mind. No wonder no one in the US trusts the press any more. Fair And Balanced indeed.

Thursday, September 15, 2005

Web News Roundup

First impressions of Google Blog Search? *Yawn*. Wake me up when you remove the number of times I link to my own page, and give me some sort of authority/PageRank a la Technorati. Of course, it is 'Beta'. Like Peter Pan, Google software never seems to want to grow up. Of course, the software is normally top-notch, but the hiding behind the beta tag is something I find irritating. It's not like other companies stop adding features or working on their software after it goes out.

In other news, both Yahoo! and Hotmail have new spiffy interfaces coming out soon. The Yahoo! one is beta for the public now, and the Hotmail one seems to be in invite-only beta. All the DHTML and AJAX goodness is taking over the web - makes websurfing that much more interactive and fun now.

There are screenshots for Yahoo! email available. Looks suspiciously like Outlook/ Thunderbird and any other three-pane mail client interface. The GMail interface with conversations and labels is a major paradigm shift, though how many people are ready for the labels idea is an interesting question. I love it.

Wednesday, September 14, 2005

Lost love Haiku

Bright eyes and big lashes
Liquid pools alive with a sparkle
A forlorn hopelessness.

- A vain attempt at Haiku

Where's your loyalty, traitor?

The Tribbet test ? I am so failing it right now. Guess whom I am going ga-ga over, and whose fate I really don't seem to care about?
Mr. Blair, could I get a honorary (it'd be a honour for me, sir! Note the spelling as well) membership of your land? I'd like to take a break from being heartbroken all the time. At least for a while. Then I'll go back to griping about the Indian team.

I am kind of happy that I had some inkling of what a humdinger this series would turn out to be. Though I didn't guess outright that England would win, I was hoping for something like that. In fact, I actually thought Australia would win 2-1, especially after that last-gasp draw at Old Trafford. I was expecting the Aussies to reach into their bag of tricks and blow England out of the water by the fifth test.

An interesting thing would be a look at the stats. Harmison is probably among the underperformers this series, while Trescothick didn't really convert any of his starts into a well-deserved big score. It was Flintoff's series for sure. And Warne's. And, dare I say it, Ashley Giles'?

I'll just get done with singing "Jerusalem" (anyone have the words to that?). Then I'll return to "jeetega bhai jeetega".

Comment Spam

I was mildly surprised that Blogger didn't seem to have captchas for comments like they do for account creation. Luckily I realized today that they do and I enabled it. Weirder is the fact that they hadn't enabled it by default.

Here's how to do it.

If you haven't done it yet, do so ASAP. Almost everyone I know who uses Blogger seems to have been spammed at least once in the past fortnight.

Saturday, September 10, 2005

End of An Era?

Nice article by Harsha Bhogle on where Indian cricket stands right now. I was a supporter of keeping Ganguly as captain till as recently as the Pakistan series. The past two series show him as having serious issues in the head. If after so long in the game, he cannot counter the short ball on his body, his hard work(?) on his technique leaves a lot to be desired. The (lack of) improvement in his running between the wickets and fielding mean that there is an 'attitude problem' somewhere that needs fixing.

Further, the series in SL showed that Dravid has the chops to be captain. He showed a lot of aggression as captain, and did a great job of marshalling his resources. His batting didn't suffer all that much, and but for that ill-timed rush of blood by him in the final, we might well have held the trophy in our hands there.

It's time to move on. Ganguly's been a great captain, and he showed us some of our best times ( A world cup final, that magical pair of series against Australia and the win in Pakistan). But as he has suffered in form, the team has suffered due to his diffidence at the top of the order, and as captain.

Let him earn his way back into the team the hard way - by performing. Appoint Dravid as captain and get on with it. Our greatest player ever deserves a World Cup. It's the best gift this team can give the man who carried it for the better part of a decade.


Wednesday, September 07, 2005

On HTML email

There is a whole set of people I have seen online and elsewhere who have this vague issue with HTML mail. They prefer sending plaintext mail to everyone.

For hardcore techies who still ssh into their boxen to check their email, this may be understandable. But for people using regular mail clients on GUI-based systems, this is nothing short of "ideological-bordering-on- stupid". There is a reason for email - communication. At the office, it is meant for getting work done.

So, if you use HTML mail for putting some highlight or emphasis in your email that will make your recipients' job of sifting through all their email easier, go ahead and do it.

I personally receive all my work email in plaintext (there is an option in MS Outlook which allows you to do that). A nifty option appears on top of my message window, which allows me to see the email as HTML. For most emails, where formatting is just eyecandy, I get by with plaintext. But for inline answers to emails, color contrasts are extremely useful. Then of course, there's tables, which are great for some of the work we do.

Being ideological about tech issues is good. Being an ass about them for the sole reason of ideology is not. Standards were meant for making things easier for us. Not the other way around.