Elev8;10996351 wrote:Firstly, using braces allows for easy expansion at a later date without the need for trying to find find the end point.
Why would you need to "try and find" the end point? The end point is the very next line...
Elev8;10996351 wrote:It does work well in template code, similar to WordPress' layout...
<?php if($x=$y) : ?>
Random HTML
<?php else : ?>
Other HTML
<?php endif; ?>
I can't stand the way WordPress does this in their template code. I usually end up modifying it to use braces, or remove it entirely and do my own thing.
Elev8;10996351 wrote:Secondly, code folding is just terrible IMO.
Both Dreamweaver and Notepad++ use "folding", but it's just such a bad habit to get into.
How is it terrible and how is it a bad habit? 😕
Weedpacket;10996354 wrote:I use code folding to collapse documentation out of the way, but I don't use it for pairs of braces. Instead I avoid letting the code between them get too long and hairy in the first place. If I find myself checking braces I take it as a sign that "here be long and hairy code" threatens and I work on sorting it out.
I'll use it for functions, especially if I have a PHP file that has a bunch of functions in it. Most editors allow you to hover over the collapsed section and a small "tooltip" of sorts shows you the code that's collapsed, so you can at a glance see the function's code (at least part of it, anyway). I also never find myself "checking" braces since my editor highlights matching braces.
Weedpacket;10996354 wrote:I have braces on their own line so that it takes less conscious effort to pair them visually, raising the threshold where I start deliberately checking.
I also put braces on their own line; I feel it makes it not only easier to read, but it also gives literal meaning to "code block".
Weedpacket;10996354 wrote:Using a 7-pt font further reduces the amount of eyeball roving involved.
My eyes are bad so I code in size 14pt font. :eek:
Derokorian;10996381 wrote:Also since I tend to comment the way PHPDocumentor says to (which is supported for parsing by my editor) its super nice to get rid of those 40 lines of comments and get to just the code.
+1 for phpDocumentor comments.