Variety is the spice of….programming!

Hello Earth! Its been a really long time since my last post, and the very fact that I write this comes as a surprise to me and anyone who knows me :-D. I have never really been big on blogging, and whatever little I did in that direction was for Google Summer of Code.

It happens so many times that I get random ‘lightbulb’ moments about programming/computers/life, and most of them get lost in talking with my own self(yes I do that) or random discussions with a friend or two. So I have now decided to remember these little gems and try and write them down on (what was meant to be) my blog. So, here goes, my first real blog post…

They say VARIETY is the SPICE of life. And well, its kinda true, since boredom from monotony is perhaps the biggest reason why people stop doing stuff…good or bad. However, its pretty difficult to understand how to introduce variety in every aspect of one’s life. And since I try to think  about everything from a programming perspective, I spent a whole hour yesterday trying to figure out if variety is essential to someone ‘talking’ to computers on a day-to-day basis.

What is a programmer’s job, really? In simple terms, to write code that makes someone’s life easier. In fact, thats true for any engineer out there. Whatever you as an engineer make/design/build, its always to make someone’s else’s job easier…from making software like Photoshop for designers, to building machines that make mass-scale production a breeze. Will variety help you in being better at your job? I think yes. Heres three reasons why (I have written everything from a programming perspective, but I guess you can apply it to any domain of engineering)-

1. Variety gives you a wider range of tools to work with

Doesn’t it? Its your job to solve problems. And the more the techniques and frameworks you know, the bigger the range of tools you have to solve any given problem. When I first started writing backend code, SQL was all that I knew, from my college education. It was all breezy for almost a year, until I started coming across problems that involved little to no schema, at which point relational databases became a pain in the ass. Thats when I found the gem called NoSQL. What would have been complex and outright inelegant code in SQL suddenly became a straightforward solution with NoSQL. That doesn’t mean I am going to abandon MySQL any time soon…it just means I now have one more technique in my repertoire for database design.

In short, don’t be afraid to do your research, experiment with new technologies and hack around. Not all problems need to be solved with the knowledge you have as of now. The more you stick with knowledge you already have, the more outdated you get.

2. Variety gives you a wider perspective

This is perhaps the biggest advantage of introducing variety in your working styles. For example, Python programmers are excellent at writing short, crisp code. Java developers are amazing at Object-Oriented Software Design. C coders are exceptional at optimization. Now combine experience in each of these three, and you have a programmer who intuitively writes elegant and efficient code. I am not saying that you have to keep writing code in every language out there. But hacking around never hurt anybody! I don’t remember the last time I wrote some code in Java, but using that for my Object-Oriented Programming course has had a big, big influence on the way I implement classes in Python. And trying to write efficient algorithms in C++ helped me realize the importance of implementing clutter-free data structures in Python.

In short, the wider the range of tools and technologies you work with, the greater is the ways in which you approach a problem, and try to solve it. Trying to stick with just one all your life will most probably give you a very linear way of thinking.

3. Variety makes you more flexible

As I mentioned, I don’t remember the last time I wrote code in Java. However, if tomorrow my work does involve me writing Java code, I don’t think I would be completely screwed. In fact, I recently had to turn to Javascript for one of my projects. Anyone whose done work in Javascript knows how it can be so much different from Python/Java/C in some subtle and some not-so-subtle ways. Yes, I was a little confused at first, but the fact that I have worked my head around a few languages before, reduced the overhead of adapting to new stuff to a great extent. And thats where another big advantage of variety comes in.

Variety makes you more flexible. It reduces the time it takes for you to learn new things, and adapt to new ways of doing things and solving problems. And with Agile development being the norm with software architecture today, you just cannot afford to be rigid in the way you approach code.

Advertisements

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 )

Google+ photo

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

Connecting to %s