5 ms·
Readability is why I use "closing flags" so I don't get lost in a sea of closing curly brackets. Example: if ($TreeHasLeaves) { Write-Host -f green "The v
by stephengillie 9y ago
Readability is why I use "closing flags" so I don't get lost in a sea of closing curly brackets. Example:
if ($TreeHasLeaves) {
Write-Host -f green "The variable TreeHasLeaves is $($TreeHasLeaves)"
}; #end if TreeHasLeaves
My "GilLang" auto-adds these closing flag comments after each closing bracket - currently it only supports Powershell, but the goal is to streamline basic coding (if/then, for/foreach, do/while, try/catch) in many languages. To create the above function statement, curly brackets included, just type use "New-FunctionStatement if TreeHasLeaves -Powershell".
- na85 9y agorainbow-delimiters-mode is great for this, if you're an emacs user.
- stephengillie 9y agoIs this a good example?[0] That would be helpful, and I hope Notepad++ gains the feature. Notepad++ does have a bracket helper that highlights the other bracket, but flagging the closing bracket helps when there are several brackets. [0] https://raw.githubusercontent.com/thblt/eziam-theme-emacs/master/screenshots/rainbow-delimiters.png https://raw.githubusercontent.com/thblt/eziam-theme-emacs/ma...
- leephillips 9y agoVim has that, too (as a plugin). Great for lisps.
- vorotato 9y agoVscode has both rainbow delimeters and rainbow tabs plugins, highly recommend both.
- duedl0r 9y agoI think that's readable just for you, if you're used to it. For me it's just noise. Why would you need it anyway? My take is, to minimize nesting and scope, so I can see right away where the scope starts and ends.