Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jksmith
on Aug 31, 2009
|
parent
|
context
|
favorite
| on:
Tips to a new django developer
Please, for the love of conciseness, never assign a boolean based on an if statement.
dmoho
on Aug 31, 2009
|
next
[–]
What if the assignment to the boolean was only one of the things you wanted to execute based on the result of the if statement?
jksmith
on Aug 31, 2009
|
parent
|
next
[–]
Even then, I'd rather see:
DEBUG = socket.gethostname() == 'developmentcomp'
if DEBUG then...
rbanffy
on Aug 31, 2009
|
parent
|
prev
|
next
[–]
It's not
aichcon
on Aug 31, 2009
|
prev
[–]
How would you rewrite it?
jpeterson
on Aug 31, 2009
|
parent
[–]
DEBUG = socket.gethostname() == 'developmentcomp'
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: