Mailinglist Archive: opensuse (1473 mails)

< Previous Next >
Re: [opensuse] editor that does not eat out TAB characters
  • From: G T Smith <grahamsmith@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Thu, 18 Jun 2009 12:13:34 +0100
  • Message-id: <4A3A215E.2050009@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Hash: SHA1

nordi wrote:
G T Smith wrote:
Indentation based block definition has some limitations.
I would like to know about those limitations. You can use blocks for
scoping variables even when those blocks are 'only' defined with
indentation. Python does not do that, but that does not mean it cannot
be done. Anything else?

Mildly puzzled by this assertion, Python does not support this but it
can be done!? (how? by a code hack or redefining the language syntax).

My view on the block delimitators is they are rather like the capital
letter at the beginning of a sentence and a full stop at the end. They
are not essential but they help make things more readable.

A minor issue. Which for any half way decent IDE would be reformatted as ..
You are assuming that you have an IDE ready when you do the development.
This only holds true until you have to work on a customers server over
ssh to fix a bug. And it assumes you always write your programs with an
IDE. I, at least, do not edit my shell scripts with Eclipse. Neither
would I write Python or Perl programs of just 50 lines with a big IDE.

For small scripts I would agree using full IDE is a bit like cracking a
nut with sledgehammer, but for more complex applications a full IDE,
with non runtime syntax checking, formatting, IDE controlled debugging
and CVS /Subversion support is pretty well essential. (BTW I have run
Eclipse over ssh and it usually works quite well). Also in situations
where you have to work with a language you are unfamiliar with or very
rusty on, IDE syntax checking and help systems can be very helpful.

BTW I would not never consider debugging code on a production machine if
I could possibly avoid it. That path leads to madness....

BTW Some consider it good practice in C/C++ and similar to use the form...

if (1 == foo) bar();

to avoid accidents like

if (foo = 1) bar();
Yes, that is certainly good practice. But the second example will get
you a syntax error in Python, another kind of mistake you cannot make in
that language. Probably a lesson learned from C.

There are occasions that assignment within a logical test is quite
useful for brevity or complex coding. So this is not always an error but
this is more an indicator that this is an intended rather than an
unintended action. For those unfamiliar with the language it can be
difficult to follow, however one tends to assume that those charged with
maintenance have some knowledge.

A note to the TO: When you try to get the program to work, make sure you
use the same version of Python that was used to program it. Some other
distributions ship rather old Python versions (their package management
uses Python, so they are much more conservative with new Python
versions). If your program was written for one of the old versions it
may give you trouble with Python version 2.6 that ships with current
openSuse distributions.

Hmmm... Another reason to avoid python IMHO, most versions of a language
should have a degree of backwards compatibility.


- --
I have always wished that my computer would be as easy to use as my
My wish has come true. I no longer know how to use my telephone.

Bjarne Stroustrup
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE -

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse+help@xxxxxxxxxxxx

< Previous Next >