[ubuntu-za] Sa computer olympiad

Jan Groenewald jan at aims.ac.za
Thu Oct 1 06:37:15 BST 2009


On Thu, Oct 01, 2009 at 12:39:06AM +0200, Robert wrote:
>    I was one of those involved in the running of the competition, and would
>    just like to add some of my own comments.
>    Simply put, python allows you to code complicated algorithms in an elegant
>    and quick way.
>    The only drawback is of course the fact that it is slower... we have to
>    use time multipliers to ensure that everyone's code is evaluated fairly.
>    So for most problems we would allow Python 10x more time than C++ code,
>    (Java gets 2x).

A more holistic view includes programming time and not just runtime.

Say you had this situation

C programming time: 3 days; C runtime: 3 minutes
C Debugging time: priceless.
Total C time: 3 days

Python programming time: 1 day; Python runtime: 1 hour
Cython optimization time: 1 day; new runtime: 1 minute
Total Python time: 2 days.

You would end up with faster code quicker. This I think is feasible
in a large proportion of cases. 

Python, being inherently more readable, is more shareable, and so 
something like "code usage time by everyone" might also compare favourably.

>    But on the whole, python is great for competitions, (I think it was the
>    third most popular language in the google code jam after C++ and Java) and

Yes, let me not hammer the point, all the languages are important and have strengths,
but say "Python is good for competitions or teaching" does not invalidate it for
serious work.

>    it is also easy to learn. This was demonstrated highlighted when we gave a
>    weekend introduction to programming to grade 7-9's. You'd be surprised at
>    how much you can get through in just 2 days. For a full report on that
>    particular event check
>    http://marco-za.blogspot.com/2009/08/introuduction-to-programming-using.html

Whereas with a new group, in C, you can hit disaster. We've done an introductory
course in C and in Python for 3 weeks. After 3 weeks students are proficient enough
in python to visualise scientific data of a wide variety. In C, only those who could
program already learnt something new. It is just one example, but my guess is it
is a representative one.

>    Another thing to note is that for the first time this year, we ran the
>    third round on Ubuntu PC's. In the past we've always run it in a Windows
>    lab, but with so many participants using linux at home, we decided to take
>    the leap and run the third round in the Shuttleworth Lab at UCT, on PC's
>    running Jaunty. Which worked out to be much less of a hassle administer.

If you need an Ubuntu lab on good desktops in future, contact me off list 
in advance. Perhaps we can offer something competitive, depending on time
of year.

   /V\     Jan Groenewald
  /( )\    www.aims.ac.za

More information about the ubuntu-za mailing list