What’s Programming?

Sai Raghava
Code Lore

--

A program is to computer as a language is to humans.

Yeah! You heard that right. Programming(the art of writing programs) is a way of communicating with computer and getting things done.

You can’t shout at your computer as King Joffrey(in GOT) shouts at humans, to get the things done. As we understand words, the computer understands codes. They must be dealt in a slightly different way.

Let us see how we can accomplish a small task using computer. To get the sum of two numbers 4&5, a simple python program would look like ‘print 4+5’. That’s it!

Simple and interesting right?

What we just saw was simply a bit in Gigabyte. Now, let us see some real life scenarios.
Have you ever happened to come across to any situation where you.

  • had to do things repeatedly,which involved a lot of manual work?
  • Want to do tasks in a creative way, to be an out of the box person?
  • Found yourself lazy to do certain tasks?

If indeed you did happen to come across such situations then here comes the programming to your rescue. You can automate all these kinds of simple tasks by writing a few lines of code, and the machine/computer does the rest of the work for you. Now, your work is made easy while you’re being lazy!

How to program?

Now that programming sounds interesting,

1.How do I write programs?
2.Where do I write them?

These are some basic questions that need to be addressed. Let me give you my answers to them.

As you can guess any man’s answer quite simple that is using a pen or a pencil on a paper.
I was kidding, this is not the correct answer though it seems to be right.The right ones are:

1. In any one of the programming languages to translate our thoughts into code.
Choosing a correct language to code is one of the most fundamental and important task.One must consider several factors before coming to a decision.

Not all languages serve the purpose.Few languages are designed specifically to deal with certain tasks. In such cases, you must write the code in that language explicitly. If there are multiple languages to choose, choose the one which is easier to learn and has more support globally(this ensures that you don’t end up getting your errors unresolved).

2.Obviously, on the machine which has to perform your desired task. These machines may range right from a Computer(performing arithmetic operation), Refrigerator(automated power usage) to simple machines like a clock(sound alarm at a particular time).

Let me tell you my favorite programming language and how it all started.

Python: The best programming language to start with.

Yes, Python is by far my favorite programming language. You can google it and get to know some of the advantages of Python.But, let me give you my insights on it.

  • First things first, it is similar to English. No typical syntaxes. No boring braces.Its as simple as writing a set of English statements.
  • Comes with an ocean of libraries to swim in. With this vast availability of libraries, you can almost do anything using python. Right from printing ‘HELLO WORLD’ on console to web scraping,auto-filling forms etc.
  • It has a lot of support globally,and has a huge demand.

With all these powerful advantages, you can do any stuff just by writing a small script. Name any thing that you wish to accomplish using programming, you can do it using Python.

That’s Python for you.

How it all started?

One day, while surfing the web, I found this prestigious coding competition called Google Code Jam. I gave it a shot by registering for the event. You can google it and know few things about it, but the best part of the event was, there wasn’t any restriction on platform you use. You can code in any language you wish.

For many days, I was trying to learn Python, but never really put an effort. On the day of event, I changed my thought and started to code in Python.With one hand, I was googling Python syntaxes and data structures. On the other hand, I was implementing them. Trust me people, I was able to complete my first problem in an hour(which is a big deal to me).

I could’ve never done it so fast using the languages I’ve known so far(C/C++). It was so easy for me to translate my thoughts into code, without actually dealing with inner implementations. This made my work easy, and I continued doing so.

For the first time in my life, I dedicated nearly 22hrs for coding. And all the credit goes to Python. Thus, my love towards Python started.

Oh! And I nearly forgot to mention that I’ve made it through the second round of that competition.

My journey so far!

I was like a new born child in the world of Python, excited to learn new things. With the help of my friend, I learnt few basics and started translating problems which I already solved using C/C++. Most of the code got drastically reduced. The compression ratio was almost 10:1. I started reading articles about Python, when one day I found an article on Quora which sounded interesting. I showed that to my friend and started to code. Here’s what it is:

During our work, we google every now and then to know the score of our favorite match.What if, the score of your team would be notified to you every 2 seconds on your working tab. You need not switch between tabs, refresh the page every second to know updated score. Sounds good right?!
We sat for an hour or so, googled how to do that, wrote a small script, and got that working.I would continue doing my work parallelly and receive score updates seamlessly.

From then on wards I never looked back.
I was waiting for situations where I could do crazy things using Python.
Then came a wonderful opportunity. One day, I was heavenly pissed off with my sir so much that I wanted to kill him right away and send him to the seventh level of hell asap. Not with AK-47 or C4, but with Python, I mean language not the snake.
He sent us a google form to our group to update all our scores of an internal exam. An idea struck my mind, and I was googling whether it was possible or not. There, I found a guy similar to me, Stack Overflow, asking

“How to auto fill a google form using Python?”

I went through those answers, struggled a bit, was exhausted after a time for sure.But, the revenge on my sir was driving me insane. I took out my laptop and started researching again and found a snippet. I modified it accordingly and made that work in the end.
I wrote a script that would do 30 entries into that form every minute. He would die scrolling down to find what the actual entries were.

This is what I call “Geeky way of taking revenge”.

Neither am I a Pro in Python nor I’m an amateur, but I’m the kind of person who knows how to accomplish his tasks using Python.

Hope, I gave brief insights on what programming is, and few real life examples that would inspire you to start programming.

That’s all for today folks!. Meet you in my next article. Till then, Happy Coding!

Originally published at iamraghava.wordpress.com on May 24, 2016.

--

--