Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions source/guides/troubleshooting/common-mistakes.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,8 @@ It's simply too easy to cause a lot of problems for a lot of people when you're

### If True Is True Equal To Truly True Is The Truth

The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside if the result is `true`, and does not if the result is anything else.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional blank link here got killed

So, if a script does `- if <sometag> == true:`, you're essentially saying `if ( true == true ) == true:` ... which is pretty silly, right?
The way the `if` command in Denizen works is it processes the arguments using logical comparison techniques, then runs the code inside unless the result is falsy<span class="parens">(the word `false`, the number 0, an empty list, and so on)</span>.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You backwards'd this, keep to true/truthy

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unbackwards'd

So, if a script does `- if <sometag> == true:`, you're essentially saying `if ( <sometag.is_truthy> == true ) == true:` ... which is pretty silly, right?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change just is more confusing for no particular reason


**NEVER** input `== true` into an `if` command <span class="parens">(or `while` or anything like it)</span>. It is always redundant.

Expand Down