Teaching Programming

Chris Rebert clp2 at rebertia.com
Mon May 3 09:58:39 EDT 2010


> On 4/05/2010, at 1:06 AM, Chris Rebert wrote:
>> On Mon, May 3, 2010 at 5:29 AM, Chris Rebert <clp2 at rebertia.com> wrote:
>>> On Mon, May 3, 2010 at 5:05 AM, Samuel Williams
>>> <space.ship.traveller at gmail.com> wrote:
<snip>
>>>> In particular, "Why would I learn this language?" section needs to have a
>>>> few paragraphs. I don't use Python predominantly so I hoped that you could
>>>> provide the main reasons why Python is a language someone would want to
>>>> learn about.
>> <snip>
>>> - A very clean syntax and elegant design, compared to other languages
>>
>> Also, I take issue with your classifying Python as orange with regard
>> to "Is the general syntax simple and concise?" on
>> http://programming.dojo.net.nz/resources/programming-language-comparison/index
>> Python's syntax is at least as simple, if not simpler, than Ruby's,
>> which you rate as green. Ruby may be /slightly/ more concise than
>> Python in certain cases due to its Perl influences, but those
>> instances of specialized syntax also make it more complex.
>> To wit, I refer you to
>> http://webcache.googleusercontent.com/search?q=cache:dyugd_KlqvcJ:blog.nicksieger.com/articles/2006/10/27/visualization-of-rubys-grammar+ruby+grammar+visualization&cd=1&hl=en&ct=clnk&gl=us
>> Note the complexity of the graph for Ruby's grammar. By comparison,
>> here is the same graph for Python (generated from a file linked to in
>> the post's comment thread):
>> http://rebertia.com/images/python_grammar_graph.png
>> (Disclaimer: Neither of the graphs are current.)
>>
>> Additionally, you rate Python orange but Perl green for "Does the
>> language provide a useful and consistent set of object oriented
>> constructs?". Could you explain your reasoning for this? While neither
>> Python nor Perl have the level of object-oriented purity of Ruby or
>> Smalltalk, my understanding is that short of using CPAN libraries for
>> Perl or dealing in Perl 6, Perl and Python have a substantially
>> similar object model, so I don't how Python could rate below Perl in
>> this area.
On Mon, May 3, 2010 at 6:38 AM, Samuel Williams
<space.ship.traveller at gmail.com> wrote:
> Dear Chris,
>
> Thanks for reading further into the site.
>
> Yes, it is complicated to provide a good comparison. It isn't always accurate and I welcome feedback.
>
> Please be aware that orange does not mean problem - it simply means take note that there may be potential issues that you need to consider. It is highly subjective, so I appreciate your feedback. The red dot is when there is definitely an issue that needs to be taken into consideration. It isn't "Okay, Warning, Error" because it isn't possible to make this kind of judgement without being omnipotent.
>
> There are several reason why I decided to rate the syntax as not being simple.
>        1) Indentation model is not appreciated by everyone - I think its a good model, but feedback from some other people has been that they don't like it. Also, I've had perfectly good Python code fall to bits after editing in a different editor. I'm not saying that this was the fault of Python, but in an educational context it might be a problem, since people are fairly limited and don't understand these issues.
>        2) I don't think that the list comprehension integrates well with the rest of the language. It is an additional syntactic construct which seems to be separate from the rest of the language. It would be nice if list comprehension was implemented in a way that was more general, using a general closure syntax for example. This is just my opinion, and it might not be valid (I don't research this point very heavily).
>
> I appreciate that in general the Python syntax is good and concise. It is hard. Some teacher might want to consider these issues more carefully. Do you think I should change that spot to green? I don't have a problem with doing that, as long as it makes sense.

Yes, I do think it ought to be green, though I admit I'm not unbiased
on this. I will point out that (1) does not seem related to
"simplicity and conciseness", which is what that row in the comparison
claims to be about.

> With regards to Perl, yes, this is probably something I need to investigate further. It is not always easy to do a comparison of this nature. From my experience, Perl generally seems to have a robust object model that is consistently implemented (even if the syntax is pretty wonky at times). However, in a sense, it is no better or worse than Python implementation... so why is it green dot? Do you think I should change Perl to orange or Python to green.

I'm unsure, but in either case, at least based on my limited knowledge
of Perl 5, it again seems rather strange for Python & Perl to not be
rated approximately the same in this area (if anything, I'd think Perl
might be slightly worse off due to its syntax; but again, I'm not
unbiased and my Perl knowledge is limited).

Cheers,
Chris
--
Avoid "top-posting" (google it)
http://blog.rebertia.com



More information about the Python-list mailing list