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,

----1----2----3----4----5----6----7----8----9----10----11----12----13----14----15.

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.

Comments

  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.

    ReplyDelete
  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 ?

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

    ReplyDelete

Post a Comment

Popular posts from this blog

Praying for "love"

Dear Love, I am sitting beside you. I know you are ill for several days. Your health looks miserable and many a times you were not able to respond. I have been busy in my work, and could not take care of yours. I am feeling really bad and guilty for my behavior. I remember those moments when we were talking, laughing and enjoying every moment of our life. Watching your pale face I am feeling sad and disheartened... It was almost two years back when we met. I came to this place ( IIITb ) alone, with none of my old friends with me. No one was here with whom I could talk, share my thoughts and was feeling as if I am in desert. True, it is that there were folks around me, but effectively, even then, life was dry and relentless. In those dark moments I met you. Initially you were unresponsive in many contexts, but gradually I came to know lot of things about you. Believe me, at the very first sight I got enchanted to you. You were the real fashionista, always wearing in black embroideries c

And There Ends My Academic Career ...

Results have come. I passed this year also with usual mental peace. Finally, after almost twenty years of passages, I have no more usual academic class to go through. There will be no more class tests, no more subjects, no more college projects, no more round making across college campus and yes no more spicy stories. You will tell me, okay you can have PhD yaar, but then I will respond back -- "no more interest". My career was never rosy and also it was never pale, it never made me jump high, but it never made be feel remorsed, it was a typical career of an average Indian student. I still remember how much it was tough to study Geography in school days and how many times my Father used to mention me exam schedules. I always disliked going to class and I will wonder if my average attendance through out my career will be more than 60%. Well, the white shirt and navy blue short was always boring to wear. I remember the first day when I cheated from my friend the definition of

Jaane Woh Kaise Log The Jinke Pyaar Ko Pyaar Mila ?

Jaane WOH Kaise Log The Jinke Pyaar Ko Pyaar Mila ? (How were those people whose love got love ?) Have you heard this song ? Have you seen this movie -- Pyaasa ? ... Ye Dunia Mil Bhi Jaaye To Kya Hain... Pyaasa comes among Indian classics and the intensity of depiction of thoughts in this film is great. You will go with the flow of film (aha the movie is not parallel to the pace with which movie of our genre move) and will start thinking within your life. The title of this post is from one of the songs of this movie. In the due course of life we think about career, life, power and many other things. We meet people, talk with them, (people analyze them also) and then we move on ... sometimes with "something" ... thoughts, feelings are the primary one. Amitabh Bachchan was questioned -" Do you need friends". Reply -- "We feel nice when friends are there. But I don't need them. I would not have felt bad if there were no friends with me." You will think