Interesting syntax usage I just discovered:

#include <iostream>

void fn(int x) {
    switch(x) {
        case 0:
            std::cout << "execute only if x == 0" << std::endl;
        case 1:
                std::cout << "execute only if x == 1" << std::endl;
            std::cout << "execute if x == 0 or x == 1" << std::endl;
        case 2:
            std::cout << "execute only if x == 2" << std::endl;
int main(int argc, char* argv[]) {
    std::cout << "*****" << std::endl;
    std::cout << "*****" << std::endl;
    return 0;

In case you missed it, note the "if(false)" at the end of the "case 0:"

renji@shrine:~/tmp$ g++ test.cpp && ./a.out
execute only if x == 0
execute if x == 0 or x == 1
execute only if x == 1
execute if x == 0 or x == 1
execute only if x == 2

Something loosely similar to the trickery used in Duff's Device, I guess. This can be used when 2 cases of a switch have different initial code and the same common code, although using it in production code will decrease readability of the code.


Appraisals - The Most Self-Destructive Process in an Organization.

For a variety of reasons, I believe appraisals count among one of the most self-destructive processes a start-up can have.

Think about the following questions:

  • If you are building an organization with the goal of competing against other similar organizations, what sense does it make to pit your own employees against each other?
  • More crucially, how will an employee's goals ever be aligned with the company's goals if he is more concerned about a colleague than about the competition?
  • Even more crucially, how will you ever nurture a team of all-round rock-stars if you are going to bureaucratically separate them into good and bad players and fit them on some ridiculous bell-curve?

Despite being a huge administrative burden on the organization, every company goes through this ritual very religiously and with mind-numbing regularity.  In addition to being a waste of time and money, it also ensures a drop in productivity while people fill out their self-appraisal forms, employee-appraisal forms, 360-degree appraisal forms and what not.

So why do managers recommend it? For various reasons:
  • It shifts the balance of power towards people in the middle layer of management - usually those least qualified to assess performance.
  • Their own goals include staying in budget and reducing costs. They will try to reduce increments and bonuses while it is in the company's interest to hire good people and keep them motivated.
  • Simply to justify their own relevance to the company.

While it is necessary to have some mechanism where overall team performance and quality of work is judged and rewarded, the traditional way is not the right one. All it serves is to drive up internal politics and, like our education system, homogenize a diverse group. 

On the other hand, there are so many better techniques a growing company can use
  • Reward performance of the team as a whole instead of individuals.
    • This creates a greater alignment between individual and company goals.
    • If a team member is not pulling his weight, it gets noticed by the rest of the team
    • Conversely, he is not worried about the opinion of other individual team members but by the opinion of the whole team.
  • Remove the time-periodicity (annual, half-yearly, etc) from the process. How many managers remember what an employee did 6 months ago?
  • Instead, tie rewards to goals. Give bonuses and increments when targets have been met, when  a competitor has been overtaken, or simply when a major release has been made.
  • Let team members nominate performer of the month. This will encourage team members to work better with their colleagues and automatically throw up born leaders.
  • Strongly encourage team members to come forward with their negative opinions any time. There is much more value when a team lead comes to you and suggests that team member X should be let go or reassigned to another team, as soon as it has become a concern for him, rather than wait for the appraisals.
  • Have a system of awarding points at the end of each sprint, based on criteria such as
    • Did the team member meet his sprint goals?
    • Was the task assignment reasonable (for team lead)
    • Was productivity/metrics measured properly

All of the above measures will help to genuinely align goals across the company, reward true performance, reduce waste of time on non-productive efforts, and foster team spirit and competitiveness.