SV: A little disappointed so far

Curtis W. Rendon mithra at bga.com
Sat May 31 00:11:54 EDT 2003


Carsten Gehling wrote:
>...

Figured this thread has been quiet too long...

> 
> > BTW, why no ++ operator?
> 
> I'm a newcomer to Python too (been working with it for about 2 months), and
> what I miss sorely is:
> 
> 1) ++ operator

I've been using C professionally since 1980, and I very rarely used the
++ operator. Especially since postfix vs prefix (++i; i++) could lead to
unexpected side affects... I preferred to be absolutely sure of what my
code was doing.

> 
> 2) assignments in test-expressions - eg:
> while i++ < 10:
> or
> if row = cursor.fetchone() != None:

Unfortunately one of the leading causes of C/C++ bugs I've chased down
over the years, that and inadvertent reuse of freed pointers.

> 
> 3) the ternary operator - x = y > z ? k : m (and, no, I do NOT like any of
> the workarounds in the Python Cookbook)
> 
> None of the above spoil readability of the code IMHO.
> 

I disagree with you on the ternary also. Once again, I prefer to
explicitly state what my code is doing. The C compilers always generate
(at least since SmallC for CP/M) excellent code for branching, why make
it difficult for a caffeine deprived brain to stumble over it while
trying to debug it?

> I'm surviving without all these contructs - I'll continue to use Python
> anyway - but I find my code increasing unnessecarily in size because of
> these lackings.
> 
> - Carsten

Possibly, but I'll be able to understand it on the first pass ;)

On the related subthread of Perl, I came to it in the early 90's because
I liked not having to use several external programs with varied syntax
in my shell scripts, and because my scripts that did something useful on
UN*X also would do that useful thing in DOS or OS/2. Although I
considered myself to be something of a Perl guru, I was routinely kidded
for making my code look very algol like, and for detailed comments of
what I considered remotely obsfucated statements. I did so because I
wanted to be able to borrow that code for later tasks and understand
what it did and why I did it that way. With Python, I have unified
syntax, powerful tools, portability, clearly readable code, and OO
without the religious zealots of C++ . And I rather enjoy tying C
functions into Python for no better reason to add the Mersenne Twister
random number generator (which I understand 2.3b now deprecates my
extension ;)

;-0

Curtis


-- 
Curtis W. Rendon -- mithra at bga.com
                    www.realtime.net/~mithra    uce at ftc.gov 
                   
A long memory is the most subversive idea in America.

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS d? s+: a+ C++++ UB++++ P+++ L- E- W++ N++ o+ K--- w---
O+++ M-- V PS+++ PE- Y++ PGP++ 5+++ X-- R* tv b+++ DI++++ D---
G+ e* h+ r y++ S at H:2600 at 65409
------END GEEK CODE BLOCK------


----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---




More information about the Python-list mailing list