Skip to main content

Expressiveness and Computer Languages -- I

Over last many years the world has seen plethora of languages, be it, Fortran, Pascal, SmallTalk, C, C++, JAVA, Perl and many others. The list is growing and each language comes with some new idea or new design paradigm lying in it. This is interesting and it will be even more interesting if some one finds whether a similar progress tree was involved in natural languages evolution or not. The popular languages are those which are intended to solve variety of problems with recommendable ease and effectiveness. Ofcourse ease and effectiveness may sometime compete each other but then solving problems of Nature, often requires balance.
I am a darn persistent supporter of the idea that there should be a change in the paradigm of tackling problems in Science and Mathematics. We need to solve problems not only using pen and paper but there should be an algorithmic description of the same. Why an algorithmic description ? There are many causes :-
  1. They give most clear solution. So although they may be written in natural languages, they still manage to give concrete picture.
  2. These algorithms can be translated to a coded language (having a well defined syntax).
  3. With the availability of computers one can check a given algorithm for a variety of inputs. This gives scope and limitation of a given algorithm.
However in most of the science and technology books, that I have seen, I have found that such type of description is often absent or is present only in end-excercises or appendix. This makes one feel that these algorithms are not in the main flow of subject matter and can be easily skipped.
There are many other level of confusion. With the evolution of Information Technology and Computers, many computer related subject matter have been introduced in pre matriculation classes. I met one student ( a standard IXth student) who was studying JAVA for one week, VB for another, also C, HTML ... and in the end he was totally confused. Moreover it often gets very hard for a person to relate study of these subject matter directly with other subject matter. For example, say Mechanics with C. Now it is evident that C can be used to simulate motion. But is it very simple? By simulating motion of projectile can we hope for simulation of simple harmonic motion ? Will our involvement in algorithmic discussion will digress our attention on the subject matter ? These questions are very pertinent. Consider Mathematics that is taught in schools. There are text materials on the conception of number lines. So a student is told that we can lay numbers on a lines, as,


This number line conception is extended to accommodate negative integers and then real numbers. In a sense authors try to give an idea of "Scale" to measure things. Can we introduce the idea of "int, float, double" there? So at the same point we can say that an "int" is a scale which can measure say upto 2^32 -1 on this or that computer. So instead of introducing "int" as a data type, we can naively introduce it as a scale. Similarly consider floating points. We can't measure any number to infinite precision. Consider a scale which measures to a resolution of millimeters. We can't expect it to measure micrometer or nano meter. It is analogous to idea of floats. Can we introuduce there datatypes like "float" or "double" which also measure to a given precision. This will help students to relate with these data types more effectively. (This is important because many prime languages have basic data types --- int, double, float ). A thought will then pop up --- this will make study of Mathematics harder. The answer is a big NO! Instead of making it tougher it will make the subject matter more clearer. Impact of integration of languages with Mathematics will give clearer picture and will make Computer Science part of main stream. Also Computer Science will not become an extra subject rather it will merge into rest of subjects.
However a much finer thread can be sewed by making languages expressive. What do we mean by being expressive ? Consider addition of two complex numbers , A and B.
void fun()
complex_int A,B,C;
//input A,B
C = A.add(B);
//output C

Another variant is :-
void fun()
complex_int A,B,C;
//input A,B
C = A + B;
//output C

I think definitely the second one is more expressive. So instead of doing hard work round "." operator it is fine to do with "+" which we call operator overloading. There are many such scenario. Consider the Statistic subject of class X. Students are told to fine mean/median. This is nothing but some additions and divison.
So if we have these numbers, 10,15,16,20,34,45,56, the mean is

(10 + 15 + 16 + 20 + 34 + 45 +56)/7.

Instead of getting the core conception of what mean is all about, students are more bothered about addition and subtraction. Can we go for this thing :-
void fun()
vector_double v;
file >> v; // file points to file in which data is kept.
double mean = v.sum()/v.size();

What can be a possible framework for integration of Computer Science with other subject matter ? How languages can be made more expressive so that they can be easily applied to other subject matters ? Can we go for expressiveness and effectiveness of a language at the same time ? I will continue writing on this topic.


  1. Computer programming is, I think, rather like every other area of human activity : it is subject to fashions and fads.

    I can't help remembering that man went to the moon before object oriented programming came along! During my PhD studies I wrote about 11,000 lines of code and never once used O.O.P.

  2. Actually I also support your view. The key point is that "Algorithms" are cleanest way to solve problems. Meanwhile these "Algorithms" are better expressed in terms of some computer languages. Now often we use programs to solve problems of varied kind. The blog addresses the problem of clear, concrete integration of programming languages with main flow of subject matter like, say, Physics or Mathematics. How languages can be moulded effectively so as to apply to these subject matter ?

  3. difficult to live without OOP.
    now there are new things comming up. Aspect Oriented Programming and Test Case Oriented Programming.
    Cheers man


Post a Comment

Popular posts from this blog

Virginia Slims -- You've come a long way, baby

Phil Harris -

Smoke Smoke Smoke That Cigarette

Now I'm a fella with a heart of gold,
The ways of a gentleman,
I've been told.
The kind of a guy that wouldn't even harm a flea
But if me and a certain character met
That guy that invented that cigarette
I'd murder that son of a gun in the first degree.
Well not because I don't smoke myself
I don't reckon they'll harm your health
I've smoked all my life and I'm not dead yet.
But nicotine
slaves are all the same,
At a pettin' party or a poker game,
Everything's must stop while they smoke a cigarette.

Smoke! Smoke! Smoke! that cigarette.
Puff! Puff! Puff!
And if you smoke yourself to death,
Tell Saint Peter at the golden gate
That you hate to make him wait,
But you got to have another cigarette.

Now in a game of chance the other night,
Old Dame Fortune was doing me right.
The kings and queens just kept on comin' round
I played 'em hard and I bet 'em high
But my bluff didn't work on a certain guy
He kept on r…

Archie and Betty ... or Archie and Veronica

So with whom Archie should go finally ? The 600th edition's cover page suggests it could be Veronica !!!

Oh! don't say that this is their personal life, personal decision ... and one should not interfere, intervene !!! Veronica seems to be happily blogging, and cheerfully oozing her wavy words. But lo and behold, the whole blogger world is damn serious about this issue, and internet is flooded out of discussion - with whom Archie should marry !

He should marry otherwise "Bahan Jee" (sister kinda) type Betty or should he go for the "Kat" Veronica?

Its 2009. Its 68 years of Archie Andrews. He is still young, still to marry ... thanks because he is a comics character. But he is not just a comics character. Along with Veronica, Betty, Jughead, Reggie, Dilton and all of Riverdale and Riverdale High School - Archie develops on your imagination. In your teens you may have been fan of this team, your father in his teens may be fan of this team and perhaps may be your…

Sowmalya on Ramaiya Vasta Vaiya

Sowmu, my friend and the song Ramaiya Vasta Vaiya of Shree 420.
If we think from the premises of this film this song resembles the pain one is going through during the parting times.

But if we see the song from the beginning the song is being sung by a group of street people who in general does not have anything to loose or not much a thing to gain .Their singing the song indicates their casual interaction with life and easy acceptance of any good or bad. One big teaching which comes from this film is HOPE. Which reflects in a couple of plots of the film e.g. the 100 rupees flat sequence , the hope to get everything back for the poor, getting the love back after all the miss happenings.As we know this film is the journey of a small town guy coming to a big town and lost his naive ness partly due to the circumstances and partly by his inclination to be rich early (which in general every body have) .The first part of the song tries to make him remember the pure soled human with which he …