Correct code for a conditional field? What's the correct way to create a conditional so that a field won't display if it's empty? Is it:

{% if entry.myentry | length %}
    ...
{% endif %} 


or 

{% if entry.myentry %}
    ...
{% endif %}


I tried both and both seem to work, but I want to make sure they're both correct.
It depends. Technically to determine if a variable is not empty (keep in mind '0' or 'false' are not considered empty), you can use Twig's 'is not empty':

{% if entry.myField is not empty %}...{% endif %}


But in most situations where '0' and/or 'false' are not expected values, then  anything that evaluates to '0', 'false' or 'null' will also work. So,

{% if entry.myField %}...{% endif %} 


or 

{% if entry.myField|length %}...{% endif %}


If the field is not defined in the field layout however, these may also return an error. In which case you might want to use Twig's 'is defined' first, before checking if the field is empty.

`{% if entry.myField is defined %}...{% endif %}`


In most cases, I just use {% if entry.myField %}...{% endif %}.