Re: Language suggestions for beginners




Oliver Bandel wrote:
John Coleman wrote:
[...]
I am planning to teach this course again in Spring of 2007 (possibly as
a team-taught course with a biology professor who has shown some
interest). This time around, I want to use the occasion to teach the
biology students how to program and also (to be fair) teach the CS
students more biology than Melaine Mitchell gets into. I am thinking of
perhaps writing a (short) textbook for the occasion. This raises the
crucial question - which language to use? I personally have written GAs
in C, Scheme and (Excel) VBA. Of those three, the Excel VBA seems like
it would be the most accessible: the syntax preserves the underlying
simplicity of all dialects of Basic, it is reasonably quick, it has
array-bounds checking which would avoid the sorts of errors likely to
plague novices in C.

If you prefer good checking and have no problem
with it, why not using Ocaml?

http://www.ocaml.org/

Best language I used... :)

I've used (and liked) SML in the past, but have never tried Ocaml. I
would tend to shy away from functional languages since I envision a
course where students sort of learn to program in the background while
really focusing on something else (GAs and related things). I just want
to bridge the gap between pseudo-code and somewhat generic running
code. One of the reasons I am thinking about Python is that it lends
itself to somewhat straightforward translation of (imperative)
pseudo-code.



Furthermore, it is pretty convienent to have the
spread*** lying around: it is a natural place to dump statistics for
each generation and rapidly generate charts of (say) average fitness
vs. generation. The main drawback is that it requires the user to have
Excel installed.

Well, if you need such Excel-stuff, so VBA might be a good idea.
But if you want to know how I see VBA as a language: it's crap!

Not to start a language war, but the core VBA language itself has a lot
going for it. For example, direct support for 4 common indefinite
looping patterns:
1) Do While condition ... Loop,
2) Do Until condition ... Loop
3) Do ... Loop While condition
4) Do ... Loop Until condition

It is surprising how many imperative languages give just 2 of the 4 and
require you to negate the condition (and thus make it harder to
understand/debug) to get the other 2.
VBA's Select Case construct is clearly more flexible than C's switch
statement. Finally, it is interesting how VBA allows you to use either
strong typing (declare everything with an explicit data type) or
dynamic typing (via its "variant" data type) or a mixture of the two.
If all I want is an implementation of some algorithm already given in
pseudocode, I can usually whip one up pretty quick in VBA. On the other
hand, If I want to script Excel with VBA then things *do* get ugly
quick - since then you are no longer dealing with the core language but
instead are dealing with Excel's somewhat cumbersome object model.



Does anybody have a recommendation of a language that is open source
and as easy as VBA to pick up?

What is so easy, when using VBA?

And: if the first steps may seem easy, will the
second and the further steps also be easy in such a language?
I doubt...



> From what I have read, I am leaning
towards Python, but am open to suggestions.

I don't know python in detail, but it has some
nice features.

The language you want to use depends on what you prefer...



> I want to avoid C and

good idea to avoid C ;-)

especially Scheme

because of ( (((( ... ))))) ??!

More because of the difficulty of learning to think
recursively/functionally. Some true believers would argue the point,
but I think that imperative programming is much easier for a
non-programmer to pick up.



since I think that with those languages the course
and the textbook would either bloat to more than can be covered in one
semester or degenerate into a programming course. Maybe VBA might be
the best solution after all. Any other ideas?

What do you asked for as language features?
Is a GUI-support necessary?
Which OS do you prefer?

Our computer lab has machines that can either boot to Linux or Windows
(the default). I would probably stick to Windows since that is what the
majority of the students would be familar with,
(...)



Ciao,
Oliver

Thanks

-John Coleman

.


Quantcast