Conditional Expressions don't solve the problem

Dale Strickland-Clark dale at riverhall.NOTHANKS.co.uk
Wed Oct 17 14:24:19 EDT 2001


>
>But it's a good thing you mentioned this, because it gives me the
>opportunity to elaborate on some of my language design sensibilities.
>
>I find a conditional expression useful IN SOME CASES where the
>requirement to use a separate if statement and a temporary variable
>interrupt the thought process of a human reader trying to understand
>the code.

Isn't 'SOME CASES' enough? Although most of the suggestions I've seen
so far lack elegance and sufficient brevity to make them worth the
effort.

>On the other hand, the ability to hide an assignment inside an
>expression is IMO purely a way to save some keystrokes: the variable
>needs to be named anyway, so you may as well do the assignment in a
>separate step so that the reader is alerted of it.

This is stubborn and your phrasing suggests a deep reluctance for this
for some reason.

To me, the primary reason for using Python is that I find it quicker
to develop systems in than any other language I've tried. That speed
is mainly from some of the powerful features such as list,
dictionaries and string handling.

However, In some ways, I feel Python is a struggle when it comes to
language constructs.

I get the impression that this is for readability but that doesn't
survive scrutiny.

For example, there is only a 'while' but no 'until'. I have to use 'if
not' when 'unless' would be more natural. 

But worst of all is that I can't assign a value and test it at the
same time. It means I have to add at least an extra line of code and I
have to retype a variable name. It makes for more verbose code and it
reduces my productivity.

Productivity is THE MOST IMPORTANT thing when you're developing
software for money.

Frankly, I'm not worried if non-Python programmers can understand my
code. I need it working and fast and an assignment operator would help
me.


--
Dale Strickland-Clark
Riverhall Systems Ltd



More information about the Python-list mailing list