Thoughts on Stack Overflow podcast 33

I submitted a question to the Stack Overflow podcast, hosted by Jeff Atwood and Joel Spolsky, and it’s answered! Hear about it at podcast 33. I’m at around the 49m50s mark. I sound only marginally better than the Tech65 podcast I was in… So some thoughts about the discussion in the podcast…

24 by 7 on call

For a period of time in my programming career, I was to be available, 24 by 7, to attend to some rare disaster in the unlikely event that critical programs failed spectacularly. Usually it’s a program malfunction or data problem. When I first received my pager (yes, it’s a long time ago…), I was apprehensive. I placed it on a stool and moved the stool beside my bed, just in case I couldn’t hear the beeps when I was asleep.

After a while though, it turned out that the crises were critical, but not that critical. I could still attend to them the next day. The staff on shift duty would page me, and all they really needed was for me to tell them that the error was duly noted, and that I’ll attend to it the next day.

And being the dedicated fella that I am (was?), during one such fine day, when it was a public holiday, when my home country was celebrating her birthday, I returned to the office to attend to one such error after receiving such a page. *bows floridly*

Killer triggers

I agree with Joel Spolsky on this. Triggers should never have been invented. I’m maintaining an application that relied heavily on triggers to do business logic. I’d be firing some innocuous insert statement, and many other tables get updated.

This gets very irritating when you’re testing out code, and you need some data in that first table. It gets worse when you factor in foreign keys and so on… It’s a nightmare…

The only reasonable use for triggers is for logging an audit trail. Even then, I believe SQL Server has in-built capabilities to do that, so you don’t need to create an actual table to store the audit logs. Too bad I’m using Sybase…

That favourite word

It’s just an observation. Alright, I get a little irritated about it. I find it pathological that Jeff Atwood has a pathological fondness for the word “pathological”. There. Although, in his defense, he didn’t use the word in the last couple of podcasts. Some of his blog posts on the other hand…

There was a period of time, when the programming sites I visited had a fad of using the word “egregious”. It means bad, like what-in-tarnation-were-you-thinking bad. Usually used in the context of WTF-like code. Perhaps the programmers felt a need to exert their linguistic capabilities…

If you watch travel documentaries, you might have come across Samantha Brown. I love her Passport to Europe series. She too, has her favourite word. It’s “quintessential”. As in “This is the quintessential town”. I started watching out for when she uses the word.

I’m starting to do that for Jeff and “pathological” too. You know, that’s pathological of me… let me go find something better to do. At least I listen to the podcasts in a safe environment. Jeff nearly killed someone who was driving.

Stack Overflow is hard

I tried. Not with as much effort as I could muster, but I really tried. I can’t answer a single question at Stack Overflow!

There was this one where I could answer, and someone already gave the answer I’d give (if I did write a reply). So I decided to vote that answer up instead. Not enough reputation to do it.

To earn reputation at the beginning, I’m practically left with two options: ask a question or answer a question. We’ve already established that I’m incapable of answering any of them. I looked at the questions tagged with C# and sql. Maybe I didn’t look hard enough…

Anyway, I didn’t want to ask a question for the sake of getting reputation. If I’m asking one, it better be because it’s bugging me. And I eventually asked one.

It’s something to do with the Month function in Visual Basic. The code I’m maintaining mixes traditional Visual Basic code with VB.NET code in an ASP.NET web application. On the web server, Month("10/01/2008") returns 10 (October). On developers’ machines, it returns 1 (January). Note that a string is passed as a parameter instead of a date.

I created a test web application with a similar setup and deployed it on that server and … I got 1. Aarrgghh! For some reason, I’m unable to replicate that behaviour.

My best guess is that some setting on the server specific to that web application is set, and I don’t know where. The machine.config? The web.config? Some IIS setting?

If I added this to the globalization tag in the web.config file on my machine:
culture="en-US" uiCulture="en-US"
I am able to replicate the return of 10. But the server’s web.config doesn’t have those attributes in its globalization tag.

I can solve the problem by forcibly using DateTime.ParseExact() with “dd/MM/yyyy” format all over the place. I just want to know why the Month() function is inconsistent. If you know, please tell me your answer. I’d appreciate it very much. Send your answer in a comment, or visit the Stack Overflow’s question page for it. Thank you.

Response to Stack Overflow podcast 15

The recent Stack Overflow podcast is fantastic! Check it out here. Their fantasticness might have to do with Jeff and Joel answering listener questions more than directionless rambling. Some of the questions were interesting, and I want to add to their answers.

The one on time management

Like Jeff, I don’t really have a system. Like Joel, I got halfway through Getting Things Done and I decided the whole system is still too complex and I could have actually done something already. The concept of transferring tasks from your brain onto something, like paper (have a look at Todoodlist) or a PDA or a computer, is great though. I use my mobile phone to keep track of personal tasks, and the Outlook calendars and tasks to keep track of office work.

That said, my “system” if you want to call it that, is to keep people from annoying me.

Given similar levels of urgency, first do that task which has the most number of people irritating you.

It’s served me well so far.

The one on code review

I’ve never had a code review of my code. It’s not that I’m that good (it helped though), or I’m a pompous buffoon (I’m not). It’s that the people I’ve worked with, don’t care about code quality but more about whether the software worked. When the software failed, or was slow, then the code was checked.

The other reason is the small team I’m currently working in. There’s no one else available to check my code. My team leader trusts that I do my job and I’m grateful for that. The downside is, I don’t have anyone to talk to in my team. I’m the .NET guy! Or the front-end guy.

This is getting depressing. Moving on…

The one on interviews

I don’t know what it’s like in America, where the geographical context of Jeff and Joel’s conversation is. What I do know is, there was only one interview where I had to read and explain some code. It was something to do with string concatenation optimisation in Java. I believe it was an actual production issue, and the interviewers wanted to get a free answer from the interviewees.

Just go prepared. Read up on the company, prepare some questions of your own and revise some of the basic programming stuff. It might look bad if you asked for access to Google so you can find out the parameter signature of a basic function.

[Update] Joel also mentioned something about suits. If you’re not used to wearing office wear, and the company you’re interviewing for requires you to wear suits, well guess what? Practise wearing suits. My current job only required me to wear a long sleeved shirt, pants and (leather) shoes. And belts help too. Don’t you read fashion magazines? *smile* I remember squirming in that alien outfit for my first few interviews because I’m not used to wearing them… Don’t be like me.

I’ve heard of the puzzle questions in Microsoft and Google interviews. I’ve actually had one too. The puzzle had something to do with a cube.

The ones on managerial role and outsourcing

I’m linking them together because my answer is related to both: Offshoring. Occasionally, I’m in charge of a developer stationed in China. I had to write out instructions, program specifications, design layout and database table structures.

The only code reviews ever done was on the code of our Chinese colleagues. We’re (as in the Singapore team) supposed to be training them.

As I understand it, outsourcing means you delegate tasks to another company, usually in another country. Offshoring means you delegate tasks to another part of the mother company in another country.

Oh, you might want to read about my first outsourcing episode.

And that’s all from me. If you hadn’t done so, go listen to the podcast.