An algorithm is a finite list of well-defined instructions for accomplishing some task that, given an initial state, will terminate in a defined end-state.
A syntax is how you would write or define this algorithm to be understood by a computer. Visual Basic has a different syntax to C or C++ but the algorithm answer will be the same.
Drawing an analogy from real life, developing algorithm is like make plot, idea, character for the novel….and developing syntax is to start writing the novel after the idea is ready.
Yeah, it was actually as simple as that! See, I am not here to give a lecture about coding or software. I never do. I just want to draw a parallel between the binary world of 0s and 1s and the human world of a head and four limbs.
Let us imagine the 5-year-old us when our guardian first taught us how to ride a bicycle. It wasn’t really riding a bicycle that they were teaching us. They were teaching us the art of balancing on wheels. This was our algorithm. With the help of these first rides on the bicycle, we were equipped to ride scooters and bikes when we came of age. The scooter and bikes rides can be seen as syntaxes, utilized and safely ridden on with the help of the knowledge of the algorithm which is balancing. Tomorrow, if a new kind of two wheeler comes in the market, riding it will be a new syntax, but the same algorithm.
This generation doesn’t really read a lot of books. My mother, being a school teacher, however, ingrained the love of books in me and I grew up a book worm. I remember reading “The other side of midnight” by Sidney Sheldon. Larry, an ex-World War II pilot and struggling commercial pilot is heard saying that the only reason he has been hired by the richest man on the land to fly his jets is because he doesn’t want a pilot who has experience in flying the newest plane in the hangar. Rather, he wants a pilot who can learn how to fly any plane with little practice. Here, we understand the importance of algorithm.
They say if you have learnt Bharatnatyam for a considerable number of years, you can pick up a contemporary routine in a matter of a few days. Here, Bharatnatyam and Contemporary dance styles are syntaxes. The algorithm is the discipline a dancer has in his/her lifestyle, the body balance one learns through years of practice, the sure-footedness of the dancer. These are basic necessities of every dance style and if you have conquered one, you can conquer the others.
I can get carried away by examples, sorry. Now, I hope it is clear to all of you what the difference between algorithm and syntax is – in both software and real life! Needless to say, an algorithm is more important syntax and if one wants to really master something in life, one must concentrate on the algorithm. This, however, is exactly what never happens in our society. Does it never eke you to think how generations of parents have been o-k-a-y with the idea of allowing their kids to “vomit” everything out on the answer sheets in their exams? Did one parent ever ask their kid, “Son, you understand the Physics of cricket better than World History? Go for cricket!” Why was vomiting out random dates in pen and paper more important than really being good at something that he kid understands the nuances of?
As a teen, I had mastered the guitar. Not boasting but I was actually pretty good at it! I mastered my basics on a Spanish one and then an electric was just a piece of cake. I understood the guitar and loved it. But only if that were enough! Getting hang of a syntax with the help of IIT graduate professors who would help me crack the JEE was obviously more important! Thus, even though I never understood why –OH and -HO made up different organic molecules, I had mugged enough to not be confused by the MCQ questions during my engineering entrances. But did that help me? Will I ever be able to teach my kids organic chemistry? Maybe not, and hopefully they will get to learn exactly what their heart and mind sang to in unison.
The industrial revolution started the downfall of human reasoning if you ask me! Early man was extremely curious the first time he discovered fire. Lack of knowledge made him pray to it as it were some God, but at least he gave fire a reason. When line production came into the picture in the 19thcentury, a worker in a factory fitting the screws in a bike engine never questioned why the screw went where the screw went. Thus, syntax was more important than an algorithm to earn bread for the family. This worker went back home and thrashed his son who asked where the sun hid at night. “Draw the sun,” he must have said, “you will get grades for drawing it, not writing about its absence!” This was the rise of the world of syntaxes. Algorithm had no place. A few that broke out of the reign of syntaxes got the Nobel prize, the Man Booker Prize, etc. but obviously after being called a freak a few million times!
I cannot change how the society functions. But I can request – the next time you learn something, make sure you can teach someone else the same thing.