A nice class for supporting sessions in CGI scripts.
Usage Example:
If it won't be simple, it simply won't be. [Hire me, source code] by Miki Tebeka, CEO, 353Solutions
Thursday, May 17, 2007
Monday, May 07, 2007
Avoiding Indent
To reduce the amount of indentation, you can negate your logic:
will become:
def positive_logic(x):
if x > 2:
y = f(x)
if y < 10:
g = f(y)
if g > 0:
do_cool_stuff(g)
will become:
def negative_logic(x):
if x <= 2:
return
y = f(x)
if y >= 10:
return
g = f(y)
if g <= 0:
return
do_cool_stuff(g)
Subscribe to:
Posts (Atom)