Examples

Submitted by Mile23 on Mon, 09/03/2012 - 11:07

Pushed a commit to Examples. This one.

It brings up the all-important stylistic question: Which of these two lines is easier to read?

- $node->ajax_example['example_1'] = isset($result[$node->nid]->example_1) ?
- $result[$node->nid]->example_1 : 0;

or

+ $node->ajax_example['example_1'] =
+ isset($result[$node->nid]->example_1) ?
+ $result[$node->nid]->example_1 : 0;

I really don't like the ? : construct to begin with. Not enough of a readable code block to understand. Easy to miss what's going on while trying to understand someone else's code.

Ah well. I don't run the world. :-)