Subject: Re: [OT] Python code is not Pseudocode [was Re: [OT] CS Languages for Teaching ]

From: Omer Zak <[email-masked]>
Date: Wed, 09 Feb 2005 13:55:33 +0200

On Wed, 2005-02-09 at 13:14 +0200, Shlomi Fish wrote:

> I once talked about it with people in the IRC, and someone mentioned he has 
> written a 200-lines Python program and had to make only 20 changes to get it 
> to compile and run. I told him they were 20 changes too many, because in 
> Pseudocode, he would need 0.

I disagree with the numbers.
Pseudocode is good as a design tool.  When you design an algorithm, you
want to tweak it until the design is right (as tested by simulations
inside your head).

This involves changes in the algorithm.
Even if it is written in pseudocode.

In fact, you choose the most optimal pseudocode for this stage of your
project - the pseudocode which best matches your problem domain, and
which allows you the most parsimonious ways to express the algorithm and
tweak it.

I am CC'ing this on Hackers-IL mailing list and I suggest that this
interesting discussion be shifted to Hackers-IL.
                                               --- Omer
-- 
My own blog is at http://www.livejournal.com/users/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

---

From: "kamikaza_mic" <[email-masked]>
Date: Wed, 09 Feb 2005 18:16:37 -0000

> want to tweak it until the design is right (as tested by simulations

There is problem with the whole claim (or at least the way its worded).

Pseudo code is not language dependent. Most people write pseudo code
in a mix of natural language and coding paradigms in a languaget that
they are comfortable with. What he seems to claim is that python is
close enough to natural language for him to write pseudo code in
something close enough to python (since it took few changes) while the
reply of the other person is that he is so comfortable with python
that he can write his pseodo code in python directly (he thinks
programing in python paradigms).

Personally I can write pseudo code directly in c and then too I would
only need to add the includes to make things run. Of this is up to the
point of variable declaration, but c++ makes it possible to define
variables in place so... It would require a compile instead of just
interpreter but thats a semantic difference with this comparison in my
view.

Most good programers I know can read c code as if it was pseudo code,
esspecially if the variable/function names are descrivetive enough,
although it may not look so to beginers.

The whole discussion of language readability and closeness to pseudo
code is rather mute.

Each person should choose the combination of language thats closest to
his/her way of thinking and that at the same time is most suited to
solve the problem at hand (usually this means its the least cumbersome
in describing the problem parameters, and thus the solution).

You need to choose the right tool that matches you to the job.

I wouldn't touch perl for realtime/driver work and try to avoid c for
text manipulation.

On the other had c is great for hardware level work, perl is very
powerful at regular expression type processing and matlab makes life
with tensor/matrix algebra a lot easier.