Analogy between English and C as a language

In our first post, we discussed that any programming language is a language in the first place. So it must be analogous to a language in how the constructs are used and formed in it. In this post, we will try to understand this aspect by making analogous comparison between English and C as a programming language.

As we know that any language has its character set as the most basic construct. English has Roman script as its character set, which includes a-z, A-Z. Similarly, to write a program in any programming language, you must be aware of the character set of that programming language.


The character set of C language is following:

– Alphabets (a-z, A-Z)

– digits (0-9)

– special symbols (any printable symbol like !,&,@,#) etc


In other words, any thing that can be printed forms the character set of C language. You can use these to form bigger constructs that we will discuss later.


Next, we know that in English, characters combine to make words, which have specific meanings. And these words may be of different categories viz nouns, pronouns, adjectives, adverbs etc. On a similar note, in C, we have variables, constants and keywords.


Similar to words combining to form sentences, C has commands/instructions. These instructions carry specific meanings and usually are related to either some task to do for the computer, or some message for the user.


Next in hierarchy, we have paragraphs or essays in English. On a similar note, we have programs in C that carry out a task on a whole. For instance, we might have a program to create a database which is a combination of multiple instructions.


Thus we have discussed how C is analogous to English, or any other language in terms of the constructs. I am pasting below the link of video from my YouTube channel in Hindi. You can go through it if you wish to.



No comments:

Post a Comment

Thanks for your valuable inputs/feedbacks. :-)