Correct use of curly braces vs alternative synax

As in many things wordpress, inertia has a lot to do with why things are done in specific way. Early core themes were written using those constructs and later developers copied them because they either did not know better or thought there was some non obvious reason to prefer them.

As @Howdy_McGee said, it is just a style preference but I would avoid the endif, endwhile as curly braces are standard block delimiters across many languages and therefor are in general easier to read even if we will ignore the benefit of syntax highlighting and block collapsing in general editors.

Leave a Comment

tech