From: Jean-Michel Pichavant on
Andr� wrote:
> To Samuel Williams: (and other interested ;-)
>
> If you want to consider Python in education, I would encourage you
> have a look at http://www.python.org/community/sigs/current/edu-sig/
>
> I think you will find that there are quite a few resources available -
> perhaps more than you are aware of.
>
> And, I don't think that because "some people do not like the
> indentation strategy" is a valid reason not to consider that Python's
> syntax is concise and simple. Actually, I would almost argue for the
> contrary. Indentation indicate programming structure/logic very
> clearly, without the need for arbitrary keywords and other punctuation
> symbols. There are very few keywords in the language.
>
> You indicate that Python programs are readable. They are also known
> to be short (much shorter than some other languages).
> Andr�
>
Python indentation has been already discussed many times around, I
remember someone saying something like "How is it possible not to like
indentation while any decent programmer will use it no matter the
language, including all those which feature statements/keywords for blocks".

JM
From: Samuel Williams on
I personally like indentation.

I just wonder whether it is an issue that some people will dislike.

But anyway, I updated the language comparison to remove this critique.

Kind regards,
Samuel

On 4/05/2010, at 9:22 PM, Jean-Michel Pichavant wrote:

> André wrote:
>> To Samuel Williams: (and other interested ;-)
>>
>> If you want to consider Python in education, I would encourage you
>> have a look at http://www.python.org/community/sigs/current/edu-sig/
>>
>> I think you will find that there are quite a few resources available -
>> perhaps more than you are aware of.
>>
>> And, I don't think that because "some people do not like the
>> indentation strategy" is a valid reason not to consider that Python's
>> syntax is concise and simple. Actually, I would almost argue for the
>> contrary. Indentation indicate programming structure/logic very
>> clearly, without the need for arbitrary keywords and other punctuation
>> symbols. There are very few keywords in the language.
>>
>> You indicate that Python programs are readable. They are also known
>> to be short (much shorter than some other languages).
>> André
>>
> Python indentation has been already discussed many times around, I remember someone saying something like "How is it possible not to like indentation while any decent programmer will use it no matter the language, including all those which feature statements/keywords for blocks".
>
> JM
> --
> http://mail.python.org/mailman/listinfo/python-list

From: superpollo on
Samuel Williams ha scritto:
> I personally like indentation.
>
> I just wonder whether it is an issue that some people will dislike.

i think there is an issue if you -- say -- produce python code, from
within another programming environment, to be executed on the fly, at
least in some instances. there might be problems if for example you
generate code from a one-line template.

i use a special template system for my job, which goes like this:

....
%%SCHEMA:<PYCODE1:print $A*2**($B)>
....

$A, $B, $C being "loop" control variables reserved to the template
system. upon parsing, the system generates the corresponding code (say
"print 12*2**3") and stores the output for further use.

due to design restrictions, i cannot write a code-template which spans
multiple template-lines, and that is a problem with python, because for
instance i cannot use conditionals or for loops. if it was C or java
there wuold be no problem since the source is free-form, so an entire
program can "live" on a single source line.

bye
From: Stefan Behnel on
superpollo, 04.05.2010 12:28:
> i think there is an issue if you -- say -- produce python code, from
> within another programming environment, to be executed on the fly, at
> least in some instances. there might be problems if for example you
> generate code from a one-line template.

There are a couple of code generation tools available that you can find on
PyPI.

However, the main reason why this problem doesn't hurt much in Python is
that Python is a dynamic language that can get you extremely far without
generating code. It's simply not necessary in most cases, so people don't
run into problems with it.

Stefan

From: superpollo on
Stefan Behnel ha scritto:
> superpollo, 04.05.2010 12:28:
>> i think there is an issue if you -- say -- produce python code, from
>> within another programming environment, to be executed on the fly, at
>> least in some instances. there might be problems if for example you
>> generate code from a one-line template.
>
> There are a couple of code generation tools available that you can find
> on PyPI.
>
> However, the main reason why this problem doesn't hurt much in Python is
> that Python is a dynamic language that can get you extremely far without
> generating code. It's simply not necessary in most cases, so people
> don't run into problems with it.
>
> Stefan
>

Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> A,B=2,3
>>> if A>B:
.... print A+B
.... else:
.... print A**B-B**2
....
-1
>>> A,B=3,2
>>> if A>B:
.... print A+B
.... else:
.... print A**B-B**2
....
5
>>>

tell me please: how can generate the same output (depending on A and B)
without control structure? i mean in a natural "pythonic" way...

bye