Archive for the ‘Software’ Category

C++ function resolution

Thursday, May 24th, 2007

I earn my living writing C++ code these days. Everyday I learn something new and interesting about this language. Many languages have a simple core, if you understand a few basic principles you can understand how most of the language works. C++ has a lot of esoteric features and no guiding principles that to borrow a term from human computer interaction allow the programmer to develop expectations. I think the reasons for this are historical.
Reading Lippman’s Inside the C++ Object model and Stroustrup’s Design and Evolution of the C++ Programming language I am amazed by how much attention was paid to match C in performance

f()
{
   a.f()      // resolved at compile time (not polymorphic)
   p->f()     // resolved at runtime
}

The static resolution is a feature. The C++ compiler writers were trying to avoid the single instruction cost of vptr dereferencing. For a programmer this means that just marking a function as virtual does not mean that the most overriden version will be invoked. To ensure that every invocation must also be polymorphic. Also there is a principle at work here. You do not have to pay for what you do not use.

Scenario, simple and Fast

Wednesday, January 10th, 2007

 

In Steve Job’s keynote yesterday there was a mention of Jim Allchin’s desire to buy a Mac. Today the context in which Allchin made that statement has been revealed. In his email Allchin keeps reiterating “scenario, simple, fast’. Any software developer should take these words to heart. The order of these three words is also significant. The most important thing for any software is it’s usage scenario.Usage scenario help in making the right tradeoffs while designing software. But for the few lucky people who write device drivers and are constrained by the operating system interface on one end and the device interface on the other, all other software developer need to pay a lot of attention to the design of the interface that their software presents. As far as the user is concerned the interface is the software. She does not care how extensible, modular the software is. Nor is she bothered if it uses the latest technology or is Web 2.0 compliant ;-) . All the users want is to achieve their goals with the minimum effort.

So you want to be a CEO

Thursday, July 20th, 2006

I attended a great talk today by Ram Gupta. He is a great public speaker and the talk proceeded like a conversation with the audience. Some of his words that I quote here are just brilliant

  • Vision without execution is just hallucination
  • Execution without vision is a hamster running on a treadmill

The interesting part of this talk was a comment by a lady present. She said “Do not worry about becoming a CEO. Today it is more fun to be a founder, build cool stuff and then hire your CEO”

C# enums can be of the following types

Wednesday, June 7th, 2006

byte, sbyte, short, ushort, int, uint, long, or ulong and they need to be explicitly converted when they are used as that type

Object Oriented Programming

Tuesday, February 14th, 2006

These days I am working on a project where I am maitaining a body of code that was developd in C#. For some reason that I have not been able to fathom the previous developer used the following paradigm.

Certain classes are pure data. They do not have any code other than getter and setter functions. Then there are other managerial classes that actually maipulate these classes. The organization is usually a class named XXX_Data and another named XXX_DataManager.

This I beleive violates the fundamental principles of Object Oriented Programming.
I wish these articles are required reading for any developer before he starts belting out code

Handy one liner

Wednesday, October 12th, 2005

Bits and bites from Pål Brattberg » find, grep, xargs and sed one-liner
find . -name “*.cpp” | xargs grep -l WhatINeedToReplace | xargs sed -i s/WhatINeedToReplace/TheNewStuff/

handy tip

A Technique for Implementing First-Class Continuations

Friday, October 7th, 2005

A Technique for Implementing First-Class Continuations
Would help in the .Net port of Unicon if and when I get around to writing it ;-)

Next Big Thing

Thursday, October 6th, 2005

Here are some questions from Don Dodgeto consider while searching for the next big thing

What lessons can be learned from this experience?

* Never get too far ahead of the market. Creating new markets, new business models, and value propositions is very difficult and takes lots of time and money. Pioneers are usually unsuccessful, the fast followers make most of the money.
* Understand who your customer is, what problem you solve, and how much they are willing to pay for it. Sounds simple enough but you would be surprised how many start-ups get excited about their technology innovations and forget about the basic business proposition.
* Never start a business focused on solving a big company’s problem. They don’t know they have a problem…and they are probably right. That is how they got to be so big in the first place. The record labels didn’t know they had a digital distribution problem and were not interested in our solution to it.
* Test your assumptions before spending lots of money. Interview your potential customers. Understand what their top 10 problems are. Don’t try to convince them that you have a solution to a problem they don’t know they have. Take a survey of 100 potential customers. Ask them to list their top 10 problems, without prompting from you. If you don’t see your problem area listed…move on to another problem.

Personel Software Process

Wednesday, October 5th, 2005

For my database class I plan to build a web based tool for “Personal Software Process”. As a guide for this program I am using Introduction to Personal Software Process by Watts S. Humphrey. Now I am not a big fan of big and formalized software processes but I do beleive that techniques outlined in this book will help software engineers monitor and improve the quality of their work. However the extract I quote from this book has nothing to do with software or processes.

Your Personal Objectives

What do you want from your life? This is the big question that many people have trouble answering. A few points are worth considering as you think about the answer.

One way to get satisfaction from a job is to have status or power. People can get this by being a boss or being put in charge of an important service. Power or status can also be indirect like making a lot of money, working for an important company, or driving a fancy car. These are all parts of “being” someone.

While there is nothing wrong with status, it is temporary. You may hold an important job for a while but, sooner or later, your next step will be down. Losing status can be a crisis. Some people are devastated when they first lose an important job. It is easy to confuse the importance of a job with personal importance.

I have known managers who were crushed by a demotion. They had built an image of themselves as important people. As long as they held a big job, everybody treated them as important. the minute they lost that job, however, they were just like everybody else. Nobody cared what they said and they stopped getting special treatment. They had lost the corner office and no longer had a secretary. This can be such a sever shock that some people have nervous breakdowns, heart attacks, or family crisis. Their reward was status and it is gone.

The Rewards of Accomplishment

The need is to decide what it is that you want. Think ahead. When you ultimately retire, what would a satisfying life look like? I suggest that what you have done will be far more rewarding that what you have been. If, for example you plan to do engineering work, you probably have the instincts of a builder. Maybe you will build systems or components. You could end up building methods or processes. Or you might have a scientific bent and build theories or do research to build fundamental knowledge.

Whatever you build, however, quality will be key. You will get little satisfaction from sloppy work. Somehow, even if no one else finds out, you will know you did a sloppy job. This will destroy your pride in the work and it will limit your satisfaction with life. You cannot honestly say to yourself that you really believe in quality but you will just get by this one time. There are always lots of excuses. You might even satisfy others with an expedient answer, but you will never satisfy yourself.

When you do quality work, you will be proud. Even if no one else knows, you know you did a first-class job and you are satisfied that you did your best. The surprising thing is that quality work gets known. It may take a long time, but sooner or later quality work is recognized. Whether you know it, you will get credit for quality of your work.

So ask yourself this question: “Do I want to feel proud of what I do?” Most people would answer yes. But if you really mean it, you need to set personal standards and strive to meet them. When you meet these standards, raise them and strive again. Challenge yourself to do superior work and you will be surprised at what you can accomplish