Defending the ternary operator
Carlos Ribeiro
cribeiro at mail.inet.com.br
Sat Feb 8 13:47:42 EST 2003
More information about the Python-list mailing list
Sat Feb 8 13:47:42 EST 2003
- Previous message (by thread): Defending the ternary operator
- Next message (by thread): Defending the ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Saturday 08 February 2003 10:40 am, Paul Rubin wrote: > Laura Creighton <lac at strakt.com> writes: > > > On Sat, 2003-02-08 at 01:01, Laura Creighton wrote: > > > > Regardless of the reasons some people _want_ conditionals, people > > > > are going to _use_ them because they save keystrokes. The number of > > > > people who will do anything to save keystrokes is legion. > > > > > > Why do you lack such faith in programmers? > > > > Because I am one. Because I know so many of them. Because 'lazy > > work' and 'hurried work' has been the bane of all creators since we > > first started creating anything. > > Why do you think saving keystrokes impairs readability? Usually, for > me at least, a shorter program is easier to read, not harder. While I agree that programmers love to save keystrokes, in some cases is more important to save line count. Long blocks of code tend to be hard to read, and in some cases, modularization with functions isn't possible or desirable. If used **with care**, conditional operators may allow to eliminate a few 'auxiliary' if statements out of the way, thereby making the structure clearer. Things such as selecting values for printing, etc., don't need to stay on the way, and may be distracting when looking at the code. Removing/simplifying them is a good reason to use the conditional operator. Carlos Ribeiro cribeiro at mail.inet.com.br
- Previous message (by thread): Defending the ternary operator
- Next message (by thread): Defending the ternary operator
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list