Will stackoverflow.com make you lazy?

•September 30, 2008 • No Comments

Don’t get me wrong. I LOVE stackoverflow.com. I have my beta badge. The very first question I posted was answered in under 40 seconds. You cannot beat that! stackoverflow is a GREAT tool that will help you learn and work better. I wish we had something like this a long time ago. And I am EVER grateful to Jeff Atwood for granting me permission to use his excellent blog posts in my podcast.

My question stems from my interest in the workings of the human brain and human nature. Early in my career, often times when I ran into a programming roadblock, I would run to the senior developers and they would help me resolve the issue. On one such run-to-senior occasion, none of the seniors devs was available. Came back to my desk and 10 minutes later I resolved the issue. That lack of easy access to a ready solution forced me to “think-out-of-the-box” and solve the problem.

Will easy access to stackoverflow.com which has no barrier to entry (no logins to create, no registration, just ask away) make you lazy? Instead of spending that extra 10 minutes, will you just post a question and wait for answers? Granted you have to know when to stop endlessly spinning the wheel and ask for help, but you also have to realize that it is better to learn to fish than just go get the fish. But then, you also use google to search for a solution to a problem. Often I have pasted the error message in the search box and gotten a good solution. Does that make you lazy? Not really. But stackoverflow is different. There are these answer trolls sitting around answering questions. At least that’s what it looks like. The number of unanswered questions, whenever I have looked, has stayed below 100. The goal of stackoverflow is to eventually have the answers popup via a google search for the question.

Good developers will always know when to stop and ask for help. I think the voting feature built into stackoverflow, especially the ability to down vote a question, will eventually weed out silly questions. And, as developers wishing to move beyond 5:01 one should resist the urge to post every question on stackoverflow. You may argue that you are learning from others’ answers but answering a question is a better way to learn and will help you build your reputation.

To answer my own question, No stackoverflow will not make you lazy. The lazy, average 5:01 devs will always be lazy. Let’s make stackoverflow a great resource.

Now, go answer those few unanswered questions.

kick it on DotNetKicks.com

Collections in .Net

•September 27, 2008 • 2 Comments

Recently, I was asked “What are the various kinds of collections in .Net. And when do you use them?”

From the top my head I could recount Arrays, Lists, Linked Lists, Queues, Stacks and, completely forgot about dictionaries. All of these are collections of items of some kind. You can loop over the items and do something with each of them. But then why do you need so many kinds of collections? When is it appropriate to use a type and, more importantly, when is it not? These two are very important questions that determine the appropriateness of a collections types use.

Like most, well I would say everything, in software engineering - IT DEPENDS. Depends on what? Depends on what the purpose is. What is that you are trying to do? What is the problem you are trying to solve?

Arrays, for example, are allocated from a contiguous chunk of memory. If the process cannot find the required amount of contiguous space, a garbage collection might be triggered. And this will suspend the current tasks. I will not go into the details of garbage collector and the process of garbage collection here. Just pick up Jeffrey Richter’s CLR via C# for a very thorough treatment of the subject.

Items for lists, say for example linked lists, may be allocated on the heap and the appripriate pointers adjusted. This probably is a fast process but the entire list may be fragmented and when looping over the list items may present a performance degradation. I haven’t done any tests but this is my conjecture from reading up on the types.

So, you need to be cognizant of what exactly happens when you use a certain collection type and what your requirement is. If your solution involves copying lists t(I don’t mean the list item, but a list of items) to another and doing something with it, an array may not be an appropriate type to use because, chunks of memory are allocated, chunks that may need to be garbage collected if Gen0 is full.

The collection type you use is also determined by -

1. Do you want index based access?

2. Do you want to store the same type in your list type or are you going to store different types?

3. Does looping over items in your list result in boxing and unboxing of types in the list?

4. Do you want name/value pairs?

5. Do you want a First In First Out or Last In Last Out type of access?

So there you have it. I have attempted to provide a very high level view of some the collection types in .Net and when is it appropriate to use a given type.

Feedback welcome.

kick it on DotNetKicks.com

SQL Server 2005 SP2 KB948108 - Failed install

•September 4, 2008 • No Comments

For the past few days this Security Update for SQL Server 2005 with SP2 kept nagging me via Windows update on my windows XP SP2 machine at work. Couple of times, I did try installing it and the installation completed without any apparent errors. But a few minutes later the Windows update nag would show up again. I downloaded the KB from Microsoft and tried a manual installation. After 5 minutes the message “No qualifying product installed on this machine” popped up. 5 minutes later the nag message popped up. I had disabled couple of ununsed services like Analysis and reporting, enabled those. Still no luck.

I had resisted upgrading to Windows XP SP3. Finally I relented and installed SP3 and then the KB and that took care of the nag. The KB installed without any errors although it did take a while (more than 20 minutes) to complete.

Hope this helps someone.

A Post from iPhone

•July 28, 2008 • No Comments

A mandatory test post from a new toy

Announcing pixels2soundBytes

•July 22, 2008 • No Comments

Ok, I now have a podcast. Although the content is repurposed from popular blogs, I believe it will help you save time by listening to interesting posts while you multi-task.

pixels2soundBytes is a podcast of audio renderings of blog posts and articles written by prominent software development community leaders. So far I have permissions from Jeff Atwood, Phil Haack and Gunnar Peipman to use their blog posts in my podcast. Typically each episode will have 2 blog post renderings with music from the Podsafe Music Network.

Check out the first show here and subscribe to the feed here.

I hope you will enjoy the show and continue your support. All feedback welcome.

If you would like me to use your blog posts in the show please let me know by emailing your permission to pixels2soundBytes_AT_gmail_DOT_com. Please replace AT with @ and DOT with .

Windows 2000 cannot connect to Internet after installing Security Update KB951748

•July 10, 2008 • 5 Comments

Wednesday morning I was greeted by the familiar login screen on our Windows 2000 home computer because of a scheduled windows update the previous day. Unfortunately after security update KB951748 was installed my computer could no longer connect to the internet. Uninstalling KB951748 restored connectivity. If you know how to fix the issue without uninstalling KB951748 please let me know.

Update:

ZoneAlarm has been updated to address the issue. I haven’t tried it yet.

Check CNet’s story here and download ZoneAlarm fix from here

501Developer.net - An idea

•July 1, 2008 • No Comments

I have been mulling over this and would like to elicit feedback before I go about setting up a website. There are two classes of 5:01 Developers. The first is a set of people who do not care about the craft and just bide their time and bolt out the door at the stroke of 5:01. This is NOT about them. The second is a class of software developers who really care about the craft but need to bolt out the door due to other commitments. If they had time, they would spend all their waking hours in bettering themselves.

And here is the idea. Setup a website on the lines of dotnetkicks (use kigg because it is an open source digg clone in C# - something I can enhance easily if need be). This new website (501Developer.net) will contain user submitted articles on how one can move beyond 5:01. How to make the max use of available time and better oneself and stay relevant. How to balance personal commitments and technical improvements and advance one’s career.

Finding time to read articles is hard for us 501Devs. But I am sure, like I have, you can find atleast 30 minutes to listen to podcasts. 501Developer.net will have audio of the top articles read by me. You can put up with my Indian accent and have fun. You can submit a reading of any article that may be of interest to a 501Dev.

Do we need yet another website? Do we need one more podcast? Well, that’s where you come in. Shoot down the idea for what it’s worth. Save me from going off and blowing $$$s setting up this website which nobody care about.

Feedback please! and TIA.

Thank you BAE Systems

•April 8, 2008 • No Comments

Logon to BAE Systems’ India website. Check out the picture of RG-31 Mine Protected Vehicle on the right. Notice anything? Most foreign websites, book or for that matter, any literature shows the Indian map with the head (Jammu and Kashmir) almost cut off or as disputed territory. However BAE systems chose to camouflage the vehicle with the map we all have grown up with. With the head intact. Thank you, BAE systems, for being bold enough to put the beloved Indian map on the vehicle.

Spare a moment and send a thank you note to BAE Systems (baes@baesindia.com or guy.douglas@baesystems.com)

The best Hanselminutes, so far

•March 20, 2008 • No Comments

I listened to episode 98 of Hanselminutes on my flight from Frankfurt to Bangalore. My colleague Greg had been urging me to listen to it but I had not found time. I was following Ender on his war games. In episode 98, Scott Hanselman interviews Hanselman Senior, his dad. I read the synopsis of the show and thought, ah Scott is trying to show us all how cool his dad is.

I am not a fan of Malcolm Gladwell’s book Blink. Jumping to conclusions in the blink leads most people to judge incorrectly. There may be a few for whom Blink works but, for most people IT DOES NOT. Let’s say you are introduced to a not very good looking person. Your blink judgement will not be fair and often clouds your judgement about the person. Only after you talk to the person or interact with them for sometime do you begin to get some sense of who they may be. Even then the person may be clever enough to mask their serial killer nature. Blink does not work in most cases. And it did not in my judgement of this episode of Hanselminutes.

In my opinion this episode of Hanselminutes is THE BEST. All episodes of Hanselminutes are good. You always walk away learning something useful. But technology changes and with the pace it is changing, most things technical will be obsolete. But there are a few life lessons to be learnt from episode 98 that are timeless.

The most important lesson that reinforced my belief, is that nurture matters more than nature. I agree that nature is important. If you are born with certain faculties non-existent you may have a difficult time, although many have surmounted theirs. David Hanselman’s encouragement and sacrifices have made Scott who he is today. Had Scott’s dad not given up his favorite vehicle and bought the computer, Scott’s genius may have found other outlets resulting in God knows what. Proper nurture is very important in the upbringing of a child and it takes patience and sacrifice.

The second lesson is of trust. Trust that your child will do the right thing because you show them how. Scott was trusted enough to have his own “den”. He could have been building something dangerous but because his interest was encouraged he did the right thing.

The third lesson is - Teachers are a vital piece of the nurture puzzle. Both Scott and his dad fondly remember the teachers who had the greatest impact on Scott’s life. I had a few teachers like that. Next to parents, teachers at school, especially in lower grades, are the most important people in a child’s life. Sometimes teachers have greater influence over the child. We need more teachers like that. Teachers who can create more Scott Hanselmans.

So, I was wrong in my blink judgement of this episode of Hanselminutes and I thank Scott for interviewing his dad and putting together the podcast. Thanks are also due to Mr.David Hanselman and Scott’s teachers for giving us all a superdev.

Let there be more Scotts and teachers and parents who can create them.

Off to Bangalore

•March 8, 2008 • No Comments

We leave for Bangalore tomorrow. Should be an exciting trip especially because our daughter is almost 4 and can comprehend better. She was 2 when we last visited in 2006. Looking forward to it.