Welcome Guest, Not a member yet? Register   Sign In
Useful utility: Comment Headings
#1

[eluser]Dave Stewart[/eluser]
Hi all,
Not strictly Code Igniter-related, but I updated one of my many projects the other day: Comment Headings.

It makes for easy navigation of ActionScript, PHP, or any other programming source code files, by allowing you to place dirty great LARGE headings in them:

Code:
//--------------------------------------------------------------------------------------------
//
//    ██████      ██              ██             ██   ██        ██   ██             ██      
//    ██  ██                      ██             ███ ███        ██   ██             ██    
//    ██  ██ ████ ██ ██ ██ █████ █████ █████     ███████ █████ █████ █████ █████ █████ █████
//    ██████ ██   ██ ██ ██    ██  ██   ██ ██     ██ █ ██ ██ ██  ██   ██ ██ ██ ██ ██ ██ ██    
//    ██     ██   ██ ██ ██ █████  ██   █████     ██   ██ █████  ██   ██ ██ ██ ██ ██ ██ █████
//    ██     ██   ██  ███  ██ ██  ██   ██        ██   ██ ██     ██   ██ ██ ██ ██ ██ ██    ██
//    ██     ██   ██  ███  █████  ████ █████     ██   ██ █████  ████ ██ ██ █████ █████ █████
//
//--------------------------------------------------------------------------------------------
// Private Methods

    // some method

    // another method

    // etc

Looks slightly spaced out in the forum, but compare navigating the two files below:
A Comment Heading commented file
A normally commented file

Or check out the live demo, and download link, here:
http://www.keyframesandcode.com/code/dev...-headings/

Just thought it might be useful to some of you - I know I find it invaluable now.

Cheers,
Dave
#2

[eluser]xwero[/eluser]
Wow that are some headings Smile

I think it's overkill, but in CI you don't see comment headings so it's open for all developers to use the style the feel most comfortable with. One library that could use comment headings is the (form_)validation library where you have 3 sections AFAIK : validation process, rules and output.
With the added php style guide in the documentation i would like to see how the people at EL think about comment headings. They already added an extra separator to make the end of a method more visible.
#3

[eluser]Dave Stewart[/eluser]
Heh heh,

I seem to get about 70/30 feedback in its favour. The more hardcore the coder the more vocal they are, which tends to be typical of anything not standard, but it's totally fair to be guarded against sloppiness.

As far as I'm concerned in day-to-day work, as long as the actual underlying code is good quality and standardized, and the headings are not over-used, it's a definite productivity boost.

But we're probably agreed, it's not for everyone!

Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB