ext_21159 (
matt-arnold.livejournal.com
) wrote
in
nemorathwald
2009-02-02 03:46 pm (UTC)
no subject
Thanks! Is there a bit of advice on programming style, concerning why 0 should come before the = and quantity comes after?
Is there a reason to avoid "if quantity != 1"?
However, both pieces of code expect a positive number and make no provision for negative numbers. Why is "0== quantity or 1 < quantity" more helpful?
(
3 comments
)
Post a comment in response:
From:
Anonymous
This account has disabled anonymous posting.
OpenID
Identity URL:
Log in?
Dreamwidth account
Account name
Password
Log in?
If you don't have an account you can
create one now
.
Subject
HTML doesn't work in the subject.
Formatting type
Casual HTML
Markdown
Raw HTML
Rich Text Editor
Message
[
Home
|
Post Entry
|
Log in
|
Search
|
Browse Options
|
Site Map
]
no subject
Is there a reason to avoid "if quantity != 1"?
However, both pieces of code expect a positive number and make no provision for negative numbers. Why is "0== quantity or 1 < quantity" more helpful?