Case Sensitive, Multiline Comments

Magnus Lyck? magnus at thinkware.se
Wed Jun 1 20:06:14 EDT 2005


> >  > You haven't looked very well though: there are actually quite a lot
> >  > of extra spaces. Still, it's nicely done indeed.
> > Hmm.  I only saw doubled spaces after commas and periods. 
> Doubled spaces after commas are definitely not standard usage.

I guess the fact that *all* comments on my post only referred
to my formatting, tell us something about how distracted we can
get by purely "typographic" aspects of text. I think that might
strengthen my case. Text that visually looks different than we
are used to, distracts us from the content.

Another interpretation would be that the content of my previous
post was a bit thin, since I was to caught up with form... I guess
that *also* suggests that we should use standard Python formatting
and concentrate on content...

Of course, if you're used to typing If in other languages, Python
might initially feel annoying, just as C++ feels stupid when it
forces me to put a silly ; in the end of each line. On the other
hand, there are other things beyond syntactic details that differ
more between languages, and it's pretty easy to get used to Python.

I think the thing that bothered me most initially was the differnt
shape of the code, since there were no explicit block end markers
in Python.

I was really used to code looking like this:

xxxx
xxxx
  xxx
    xxxx
    xxxx
  xx
  xxx
    xxxx
      xxx
    xxx
    xxxx
  xx
xx

And now it looked:

xxxx
xxxx
  xxx
    xxxx
    xxxx
  xxx
    xxxx
      xxx
    xxx
    xxxx

It somehow felt very abrupt, and I missed the visual cues that
we were going back to a previous block level. After some time I
got used to it, and I very rarely hear anyone contest that code
written in Python usually is easier to read than code written
in other languages. The lack of block end markers, is one of
several Python features that promote clarity and a high signal/
noise ratio in the source code.



More information about the Python-list mailing list