What’s in a name?

Writing code to a large extent is about setting up the memory in a certain fashion and instructing the computer to make changes to it.

This may sound simple. The harder part is to remember what part of the memory you set up represents what in the problem you solved.

Suppose we are writing code to draw a circle. We need the center coordinates and the radius, assuming some logic will act on it and layout the pixels for you as a circle. The center and radius have to be kept in memory. These are just 3 numbers 2 for center and 1 for radius.

The complexity begins when you assign labels to these 3 numbers. We normally label them i,j,k or better c1,c2,r to represent center coordinates and radius or more enthusiastically centerx, centery, radius.

As a program’s complexity increases in terms of things to be kept in memory, the complexity of naming the memory rises drastically.

In large projects that serve domain specific models, it is a hell. So many names representing so many things.

We are not very good at remembering names. As you grow old it gets worse.

Most of the time taken to read a piece of code goes in knowing what those names stand for and what they hold in memory and how they are related to one another and finally mapping all those to the real world problem it represents like the pizza delivered to you or if it is raining in the city you are about to land.

Everyone has their own way to name things like they give fancy names to their kids. That makes it harder to read code written by others. It’s like you walking into a friends house and adapting to the way your friend has named the things in his house.

“Get me the Gillette razor on the bottom shelf in the first floor right hand side bathroom”

Hmm.. That’s how it feels when you read code written by others.

Is there a way out of this ?

As far as I know there is none, unless we begin to make machines that can think like us.

When we do that we can subject those machines to the torture of making sense of the labels the way we have subjected ourselves for no reason. But we want machines to better us. If not, what’s the point in making machines ? We need them to understand humans and preferably help us retire from the drudgery of work. But who knows once we give the ability of human intelligence to machines, they may end up wanting a vacation for themselves and escape from their masters just like the way we do.

Well, the point is, we need machines to program themselves. Until we reach that stage, we have to live with names, more names and more and more of that.

The other way to get rid of names is to stop coding and become poetic. You can then ask ‘What’s in a name?’ like Shakespeare did and begin to say ‘Who Romeo is, is more important than the name Romeo or what the code does for me is more important than how it uses the names’.

In a more practical sense, you can become a manager. Then you are like Juliet asking the outcome of the code side-stepping the coding name hell.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Thalapathy Krishnamurthy

I am building Trec. A new way to read the Web. If you are interested, send a mail to trecapp04@gmail.com. You will be notified.