Computer algebra systems are high level programming language. Writing good code does not need
documentation. The code itself shows what is done. Here is an example which takes two pictures
and procuces a GIF movie interpolating them:
A=Import["image1.jpg"]; B=Import["image2.jpg"];
width=Length[A[[1,1]]]; height=Length[A[[1]]];
ImageInterpolate[t_]:=Image[(t A[[1]]+B[[1]] (1-t)),Byte,ColorSpace->RGB,ImageSize->{width,height}];
Export["mix.gif",Table[ImageInterpolate[k/50],{k,0,50}],"GIF"]
It takes over a minute to process. A simple C program doing the same is a multiple times larger but also
needs multiple less time to process. But it needs to be documented because even simple things like
reading in a picture
fgets(buffer,1025,in);
if(strncmp(buffer,"P6",2)){
fprintf(stderr,"Unsupported file format (need PPM raw)\n");
exit(1);
}
do fgets(buffer,1025,in); while(*buffer == '#'); // get picture dimension
x_size = atoi(strtok(buffer," "));
y_size = atoi(strtok(NULL," "));
fgets(buffer,1025,in); // get color map size
c_size = atoi(buffer);
if((image = (char *) malloc(3*x_size*y_size*sizeof(char)))==NULL){
fprintf(stderr,"Memory allocation error while loading picture\n");
exit(1);
}
i = 0;
ptr = image;
while(!feof(in) && i<3*x_size*y_size){ *ptr++ = fgetc(in); i++;}
fclose(in);
But C it is worth the effort. For more advanced image manipulation tasks for example,
Mathematica often can no more be used, due to memory or just because it takes too long
(Math link does not help here very much since objects like a movie (a vector of images) can just
not be fed into computer algebra systems without getting into memory problems, which deals with a movie as a whole).
For computer vision stuff for example, one needs to deal with large chunks of the entire movie).
While the simplicity of programming with high level programming languages is compelling, speed often matters.
There is an other nice benefit of a simple language like C: the code will work in 20 years. Computer algebra
systems evolve very fast and much what is done today does not work tomorrow any more in a new version. Higher
level languages evolve also faster. And large junks of internal CAS code are a "black box" invisible for the
user. Both worlds makes sense: the low level primitive, transparent and fast low level language and the slower, but
extremely elegant high level language.