Programming Languages and Art

I was recently translating a very old piece of code written in the ’80s in FORTRAN77 to Matlab. This process has taken me 3 weeks for 20 line code!

Partly because probably I am not a skilled programmer and partly because statements like GOTO do not exist in Matlab.

My aim was to work out exactly the efficiency of a numerical algorithm so I needed to know exactly the value of each variable at every loop counter etc. so the code had to be transcribed exactly. No fancy coding skills to improve the “code” were to be invoked.

In this exercise I realised that programming is more an art form than anything else. There is a beautiful flow of logic (actual mathematical algorithm)  that has to be channeled (dictated by the language constructs, data structures and commands) into a specific form (much like a canal I suppose).

Each time we choose a different language, expressing the same algorithm can take a very different form. Interestingly the language itself can impose either an improvement or a the opposite. In some ways the language can function like the clothes we force our bodies into- giving a specific shape.

In some cases its bit a like struggling to find a word in a language where it doesn’t exist  to express a sentiment that we have a word for in another language.

I wonder if anyone has studied how programming language constraints influence actual logic/algorithms?

Or is this simply my own lack of expertise leading me to fanciful thoughts?


One comment on “Programming Languages and Art

  1. That is totally true. I was grading some undergrad assignments on numerical computing. The question was a bit open-ended. The C programmers had numerical ways of doing it (taking logarithms, using built-in numerical constants), but the Java programmers were very likely to do it by string handling! They would read the numbers as strings and split them in various ways etc. I’m not very familiar with Java, but I think its standard library has a lot of string handling features not found in the C library.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s