drop's picture

Please use this topic to suggest agenda items for our weekly meetings.

This week we will be having a Design/UX meeting followed by the weekly Dev meeting. 

See more information about our weekly meetings.

Comments

Something for the development meeting:

I can't find anything in the docs about whether truthy/falsy should be used or whether control blocks should only ever use conditions that will be explicitly true or false.  I think it would be useful to understand acceptable and unacceptable uses of truthy/falsy.  I personally, find code is less clear with truthy/falsy conditions and prefer explicit true/false conditions, but I would be interested in understanding what best practice is.

I've found a few in contrib where truthy/falsy conditions have failed when looking for an array key:

array('value' => $theme->info['version'] ? $theme->info['version'] : ''),

When this key didn't exist it caused undefined index error.  Replacing with this:

array('value' => isset($theme->info['version']) ? $theme->info['version'] : ''),

fixed the issue and prevented an error when the key didn't exist.