Stack Overflow Thoughts

By Krishna, August 21, 2008

I received my beta invitation to stackoverflow.com, the discussion form launched by Jeff Atwood and Joel Spolsky, some days ago. It has been fun playing around with it. For a beta site, it is highly functional, very fast and noticeably free of bugs (I noticed just one formatting problem which disappeared after an hour or so – maybe a browser insanity issue). For the most part, it is very intuitive and easy to learn.

What do I like about the site? First of all, it has a very clean design – good use of colors, shading and white space. The up-down vote controls, the gravatars, and the judicious use of links under various elements are also well placed. It is very pleasant compared to the typical programmer sites which are poorly designed or have all kinds of ads spread all over the page. Of course, SOF will have ads at some point, an objective already stated by the founders.

The badges and reputation scores seem to have served their purpose well. There is a lot of activity going on even with just the beta users. The content seems to be free of unwanted comments. While the quality of the questions does not seem to be especially high, the comments are of superior grade. I tried a few questions (2008 programming books, software architecture blogs [You need to get an invite to see these pages], etc.) and got some good responses. As the community grows, this would only improve, because you would continue to get more knowledgeable users (the “average” level of users does not matter).

It opened up a line of thought for me with respect to this blog. Stack Overflow could be used for researching a software development topic before I post about it. I could link or refer to the different comments and viewpoints. I think this is a great resource for non-List-A bloggers who can now tap into the huge community of Stack Overflow to do research and gain feedback about their ideas.

Now for the obligatory “constructive criticism”.

Stack Overflow (SOF) needs to consolidate their FAQ in one place and have it linked from the “FAQ” link at the bottom. There apparently seems to be a question that acts as the central repository for all FAQ’s. This is problematic for the simple reason that other users can edit that page (I suppose), but only the SOF programmers know the right answers. And they have to be bothered to review edits to the question, not just whenever the rules change.

Another problem is that apparently, questions can be deleted even if they have answers and yes-votes. I don’t agree that it is the prerogative of the questioner to delete such questions, because the question obviously had some value to users who spent time answering them. Maybe it should be made visible to the answers and yes-voters. It does seem that questions are in fact “hidden”. So this could be achieved.

Editing is only available to people who have earned a certain amount of reputation. Theoretically, this is a good idea. Unfortunately, the reputation score for being able to edit posts is a little too high in my opinion. It would prevent contribution from many good users who do not have the time for earning that score. Or even worse, the enthusiasm for contributing may be highest during the initial use of the application, but they cannot do anything. It is unlikely that they would come to edit many posts that they may have seen when browsing at the beginning.

An objection to this would be that new users can add answers. But having listened to all the SOF podcasts, my understanding was that SOF questions would actually serve as the authoritative page for the question like Wikipedia. If you have a question having 10 answers with different levels of accuracy and information, it is not as useful as the question rewritten to encapsulate the right information from all the answers. It is not possible in many situations to accept a single answer. The correct answer will only be an amalgam of all the answers.

Overall, a great effort. I am amazed that this is version 1, because the developers have done a really great job and thinking through the functionality in quite some depth.

Decision Making

By Krishna, August 19, 2008

There is nothing more puzzling to me about political campaigns than the ever-fluctuating polls. After 18 month of political campaigning, one would think that people would have made up their minds by now. Both the major candidates have significantly differing political views. They have appeared umpteen times on debates on television. All newspapers and blogs do is cover them day after day. If that is not enough, people can go to the campaign web sites to read detailed information about the ideas and proposals of the candidates. So, who are these indecisive people and what are they waiting for?

Such vacillation not only exists in the political world, but also in your workplace and daily life. Some people can take forever to make decisions. This can be the cause of much frustration, especially when the decision makers have to make a judgment on important matters or changes relating to the organization.

Slow decision making can seem like thoughtful decision making and is often justified as such, in contrast with rash decision making. However, slow decision making is not about taking time to do due diligence and understand the pros and cons of the choices. It is about the inability to make a decision even after information about the choices is available.

Why does this happen? I believe that slow decision makers are held hostage by a variety of factors:

  1. The possibility that new information that dramatically contradicts the present information would emerge: The problem here is that the probability of such contradicting information appearing after you have already done your research is generally very low. The question to ask is, “Where, that has not already been researched, could such information realistically come from?” If there is no answer to that, then don’t worry about it. The key is “realistically” – don’t be paralyzed by too much analysis.
  2. The inability to assign necessary weights to the advantages and disadvantages of a particular approach: In every decision, some considerations are more important than others, and the latter can be ignored if required. For example, if the major considerations are functionality, price and size, determine what you value more and be ready to compromise on the rest. The question to ask is, “What is the most important thing to me?
  3. The inability to eliminate choices recursively: Given a choice of A, B and C, this person may be unable to eliminate any choice because they go in a loop where A > B, B > C and C > A. This happens because the comparisons are done based on different criteria. A is better than B on functionality. B > C on price. C > A on size. The better way is to evaluate all of them together on one single criteria (say, functionality) and eliminate the ones which do not meet the bar. If all of them meet your requirement, then evaluate them on the next important criteria (say price). The question to ask is, “Am I using the same criteria to evaluate and eliminate choices?
  4. The fear of making the wrong choice: Wrong decisions could mean embarrassment and loss of money or time. Unfortunately, the reality is that any decision could still lead to a failure because of factors beyond your control. And no one can see the future. So the question is, “What is the best possible decision I can make today based on the available information?” Don’t worry about having the “right judgment” and beat yourself up. If circumstances change, be ready to adapt.
  5. The lack of need in making a quick decision: If it is not urgent enough, people stall decisions. While a crisis can make priorities clearer and make decision making easier, normalcy can encourage procrastination. But such stalling only increases the costs of decision making through unnecessary analysis. Or through missing a good window to start the work and thus reduce the timelines for implementation. The question is not how long you can delay the decision, but rather, “How soon can I get this over and move onto other decisions?

I am not recommending to go to the other extreme and operate with your gut. You must try to gather enough information and have a good sense of your priorities and principles before making a decision. Ironically, the most important thing for making decisions is to accept that you are not infallible and can make bad decisions. If you think you “have to” make good decisions all the time, your ego can fall into the trap of justifying them when things go wrong, instead of trying the fix the situation.

The last thing I would say is learn to accept responsibility for your decisions. Except for instinctive reactions, all decisions are made after thought. Even if the decision was spectacularly stupid in hindsight, at the time, the decision made a lot of sense to you and did not, in fact, feel stupid. It is also very unlikely that you would have made a different decision without the benefit of future knowledge. Once you accept this truth, it is easier to confront the present situation and do something about it.

The One Answer Search Engine

By Krishna, August 15, 2008

With regard to my previous post on market entry barriers, one of my friends (who works in research at a large technology company) pointed out that it is incorrect to say that people are entirely satisfied with search results. Google (or other search engines, for that matter) does not provide a direct answer to many search queries, such as “biggest Hollywood movie hit in 2007″. Instead, it displays many possible sites (arranged by authority) that may contain the answer, and then the user has to visit those sites to get the information.

I agree with that concern. Like children who turn to their parents to get answers to their questions, we turn to Google for showing us the way in almost every activity. And increasingly, we expect Google to give the answer straight to us, instead of saying, “Maybe you should look at these sites most likely to contain your answer.” The growth of Google OneBox results is probably the result of this demand. I find myself regularly using the weather, calculator, definition and map features in OneBox. OneBox is definitely a better implementation than the “I’m Feeling Lucky” button which still leaves you with the task of finding the information in the site you navigate to.

Google and OneBox could be even better with the addition of more data sets that provide instant answers. However, this does present a business dilemma for Google. If Google is in the business of providing answers instead of search results, why should users click the results in the links? For example, if I could see the “Beijing Olympics medal tally” instantly by searching, why should I visit NBC or any sports site for the same information? (I may still visit them for sports articles or photos, but there is a different issue.)

On one hand, Google would lose revenue by providing that information. On the other hand, owners of such information may decide that their web properties would become less valuable as a result. However, it is possible to see a situation where the content is licensed to Google at a price that would balance such costs. The OneBox information could be limited in scope to encourage users to click through to the owner of the content. Or, one could have the entire content made available and Google and the content provider share revenue derived from ads displayed along with the content.

At some point, I suppose this “all-knowing” search engine could be coupled with futuristic devices so that you can talk to it and hear the results or have it displayed in some floating display in front of your eyes. That would be the ultimate nightmare for teachers who give test questions like “In what year did the Battle of Waterloo happen?”

Barriers to Market Entry

By Krishna, August 11, 2008

The big news a couple of weeks ago was the launch of the Cuil search engine. After receiving its 15 minutes of fame, it seems to have been forgotten by everyone. Every once in a while, a new search engine pops up, threatens to oust Google from its throne, and then fades into obscurity.

The mistake made by these companies is that they think they can do to Google what Google did to AltaVista and the other search engines, namely, by creating a better search engine with more relevant results. The problem is that nobody today is unhappy with their search results, and so these startups are trying to fulfil a need which no one has. In addition to that, Google has also created a ton of services around their search tool that the upcoming competitor has to displace.

Google was able to topple its market leader because the existing products in the search engine space did not posses enough quality for end users. By bringing out a better product, they were able to grab those users. But once an adequate quality was reached, Google was able to erect other barriers to market entry through AdWords, AdSense, API’s, Integrated search and so on. Not only does a new company have to provide better or equal search results, it also has to replicate Google’s services to advertisers, programmers, webmasters, content creators and so on.

Many competitors focus only on the products of the market leader and ignore its ecosystem and infrastructure. For example, let’s say, you create a better desktop office product than Microsoft Office. That is not enough. You would need to break the established years-long relationships between Microsoft and its sales partners, or between Microsoft and its corporate customers. You would have to find a way to retrain the thousands of software developers and consultants who make a living off Microsoft Office.

Low barriers to market entry are one reason why the first vendor in a market does not always become the market leader. In a new market, the differences between products are very low. It is easy to develop a competing product. So, the winner is one who can bring in the most partners and users and build relationships that are difficult to break. Everything (pricing, publicity, placement, etc.) should work towards that.

This is fundamentally opposed to build a niche product. Niche market sectors operate at the fringes of the primary influence of the market leader, which does not or cannot address the needs of those customers. By definition, the strengths of the market leader have little appeal in a niche sector. This offers an opening to create a product that has a different strength than the leading product (example: Google Docs vs. Microsoft Office). Such a product can thrive and even grow if the market sector expands for some reason, say changing social, economic or technological environment.

But competing head-on-head with a market leader on its primary strength in an established, matured market is simply foolish. And Cuil is another company on that suicide mission.

The Gospel of Scott Adams

By Krishna, August 8, 2008

Reading a Dilbert cartoon or a book by Scott Adams, one is often struck by how closer they are to real life in the business world than more “serious” business books. It is surprising on one level because business books are supposedly more researched. Yet, on a different level, it is not that surprising , because humor is more capable of portraying unsavory truths.

It is easy to recognize ourselves or our co-workers in a Dilbert cartoon. I sometimes wonder if Scott Adams should be made mandatory reading for all managers before their first assignment. But perhaps I am being too optimistic. It is not a lack of knowledge about stupid strategies and tactics that makes bad managers. It is the inability of bad managers to recognize when they are doing something stupid.

It is natural for most of us to only notice wrong or bad behavior on the part of others. We find it much easier to criticize and blame others. A good manager can rise above this by taking responsibility when he or she is at fault. A good organization can make it safe for people to admit mistakes and move on, thus making it a better place for good managers.

Having said that, I sometimes feel that the cynical viewpoint presented by Scott Adams can be counter-productive. Good and bad managers fall in a continuum. Most managers have weaknesses of some kind. They are not perfect and it is impractical to expect them to be so. Viewing your manager as a pointy-haired boss because of some stupid actions may prejudice you against the overall good work he is doing.

I am reminded of a Harvard case study of a meltdown between a securities company and their consultant group. One of the key failures was the kick-off meeting, where the company CEO presented a vision of the project, but the consultant assigned to the engagement interpreted the speech as a series of “corporate platitudes” and “banalities”. It is very easy for people to attribute wrong motives to figures of authority.

A fine balance has to be struck between sincerity and cynicism. It is true that everyone has their own agenda. But that doesn’t mean that everyone is acting selfishly all or even most of the time. Everyone also has their own failings and weaknesses, and you have to manage around them to get things done.

Being too cynical can hinder your own growth. For example, it is generally true that organizations do not (and perhaps cannot) reward high performing individuals in proportion to their contribution. But if you understood this truth and stopped putting less effort, you may be avoiding opportunities for learning and growth. Instead, by taking a short-term loss, you could do something to help you in your long-term career.

Be cynical if you have to, but do not mix it with emotion.

Procedural Programming in OO Languages

By Krishna, August 6, 2008

A common problem found in code reviews of inexperienced programmers is the use of a procedural paradigm of coding even though they are working with an object-oriented language. Typically, the code looks something like

class SomeClass
{
doAction1ToData(some data structure)
doAction2ToData(some data structure)

doActionnToData(some data structure)

}

Instead of writing objects that encapsulate and hide the data, the data is passed from method to method. This is hardly different from a procedural language such as C or FORTRAN. The data which flows through these methods essentially becomes a global variable. It is very difficult to isolate the changes that happen to the data.

I believe the blame for some of this lies in teaching computer programming as formulating algorithms. Do this. Do that. Break “that” into steps. Also, procedural programming is adequate for small coding tasks and so programmers are used to that style. When it comes to larger projects, they are unable to think in terms of objects and interactions between the objects. Unfortunately, because of this flaw, the code stops being maintainable due to the complexity introduced.

One way to do that is to start refactoring the pieces of data that are accessed by various methods. Create classes that combine data and methods. Reduce the visibility of data elements. Be unafraid to break up classes. Keep learning about more object-oriented refactoring techniques.

Programmer Test for Interviews

By Krishna, August 5, 2008

A few months ago, I had derided the use of riddles and quiz in interviews. My reasoning was that they measure the wrong things, not how the person would actually perform in day-to-day work. In my company, we have tried to implement what we think is a better way to evaluate candidates, namely, getting them to do a straightforward programming test. Candidates are provided the necessary tools such as Visual Studio. They can take their time to write the code. This method is not something unique to us: many other companies use it too.

There are a few aspects of this strategy:

  1. The problem is non-trivial: It requires the person to develop a well-structured application, failing which the person produces no or incorrect results. Thus, candidates who are not strong in planning how to write their code are easily eliminated.
  2. The problem does not have a clever solution: It does not require knowledge of obscure algorithms or data structures. It is not something that can be committed to memory. Instead, it requires use of existing experience.
  3. The inputs and outputs are well defined: The programmer knows what input to process and what would be the output format. One would expect a good programmer to work according to the specifications. So if someone provides the answer in a different format, it is a sign that they don’t read or understand written specifications well.
  4. The solution can explain the level of technical strength: If there is only one way to solve the problem, then you cannot classify the candidate as a weak, average or strong candidate. All you are doing is establishing a hurdle for the person to cross to get to the next stage. Instead, the problem should allow different solutions, by looking at which you can understand the strengths and weaknesses of the individual.

The solution provided by the candidate should provide insights into how the person organizes code, follows coding standards, uses system libraries and data structures and is aware of the latest improvements to the language. This would not be possible if you rely on problems that only require a few lines of code.

Using a tight time restriction is neither necessary nor useful. For a smaller problem, the time difference between candidates is insignificant. Good quality code may take more time to write, but there is a net time savings because of less maintenance. So allow your candidates to take enough time to plan and write the code. If any candidate seems to be taking too much time than the average person, you can talk to them and wind down the session.

It is surprising how many candidates who look good on paper perform poorly in these tests. It is not even about the quality of the code. Many programmers seem to ignore the instructions given and produce their own output. One person even hard-coded the final answer! At the same time, you also see a few gems who write very clear and elegant code, and your decision becomes a little easier.

This is not a perfect or complete method by any means. You must complement it with one or more interviews to learn additional details about the person.

Barriers to Receiving Information

By Krishna, August 4, 2008

In addition to skills and circumstances, success depends significantly on the information you possess. Without having accurate, up-to-date information, you are more likely to make decisions based on assumptions, or plain hope. Not a good situation to be in. Corporations spend fortunes trying to build good management information systems so that managers can have timely information about their projects.

However, the best resources for providing information are the people whom you manage or work with. Management systems, however great, are just second-hand means of collecting and disseminating information. So, the ideal situation is where you also have people informing you about events (good or bad), providing you with suggestions and questioning your decisions based on their experience and knowledge.

Getting to that stage is not easy and there are several reasons why people may not want to share information with you. Here are some:

  1. Your reaction to the information: People generally have no qualms in relaying good news. But when it comes to bad news, they worry about how you would react. An angry response, even if not directed at the messenger, is very unpleasant. If you become visibly nervous, upset or afraid, then you have failed in providing strength and comfort to the messenger. What is needed is to remain calm in the face of bad tidings. But that may be difficult if you are the emotional type. Be more pro-active in collecting information so that you can predict negative trends. Be mentally prepared for bad news when someone wants to meet with you.
  2. What happens to the messenger: Your messenger is doing you a favor by providing you the information. In return, he or she expects something good to happen or something bad to go away. But often, what happens is that people create problems for the messenger. They berate the messenger for not bringing the news earlier. They burden the messenger with additional tasks. This guarantees that the person will think twice before providing you any information, because it is all risk, no reward.
  3. What you do with the information: Ignoring the information is a good way to alienate the messenger. Another way is to betray the trust of any confidential message by publicizing it or the messenger. Or, instead of trying to fix the problem, you use the information as a weapon against people. It is important to seek and understand how the messenger wants you to handle the information. Maybe you may disagree with the messenger, but you must try to adhere to all ethical obligations and address all concerns.
  4. Your judgment: People expect you to take rational steps when they give suggestions or bad news. If you insist on continuing with your agenda regardless of the situation or results, people will get disillusioned and co-operate less. When people provide ideas, they expect acknowledgement and consideration of those ideas. They need to feel that their information has made an impact on you. Now, you may think that the information is really not worthy of action. But it is still necessary to explain to people that you valued their input, why you disagree with them and what additional information may, in fact, make you change your present course of action.

Each of these attributes defines you within the organization. If you have gained a reputation for not listening to people or for revealing your sources indiscreetly, you have not only lost those who brought you information, but also those who could have helped you in the future.

Themocracy WordPress Themes