Renting Cars and Operator Overloading

23Mar09

Let us say you went into Hertz and rented a car. Except as soon as you started trying to drive it you realized the brake and gas pedals are reversed. Would you be able to drive the car ? But the bigger issue is – would you trust that car anymore ? The location of the window controls, the radio controls etc are routinely moved around. But the location of certain things is sacrosanct and that is what allows people to drive different models of cars. Unless you can trust that the basics are exactly the same you would not drive the car! That is the same thing with programming languages, you can change a lot of things but I have found that operator overloading is one of the things which always throws a curveball to the maintainer. The initial developer will always have wonderful things to say about it – but remember that the maintenance period of the code is a lot longer than the initial dev and it is usually done by others. So please don’t do operator overloading – Yes it is cool and might save you x lines of code but it will make the code so much more difficult to maintain.

Advertisement


No Responses Yet to “Renting Cars and Operator Overloading”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.