• -- /*

    ... Live code that optionally needs disabling ...

    -- */

    is interesting, thanks. I saw that style for the first time just the other day on some sample code in a post here but didn't extrapolate the significance.

    For optional code I normally do

    /**DEBUG *

    ... Optional Debug code ...

    *DEBUG **/

    the single/double stars are deliberate so I can remember which end I need to add/remove the "/" later on! i.e. the double-star end is retained

    Comment-out block activated:

    /**DEBUG *[highlight="#ffff11"]/[/highlight]

    ... Optional Debug code ...

    [highlight="#ffff11"]/[/highlight]*DEBUG **/

    Whilst on the subject, I have another workaround - which folk may think is shoddy? or have a better suggestion?

    zzzz Comment out for TEST / PRODUCTION

    /**DEV ONLY *[highlight="#ffff11"]/[/highlight]

    ... some DEV code ...

    [highlight="#ffff11"]/[/highlight]*DEV ONLY **/

    The "zzzz" triggers a syntax error, so I have to deal with the comment. When addressed I change the comment to "--xxzzzz". If that gets saved into the Source Code file it will be picked up when I (do a DIFF compare when I) check-in the file, and I will change it back to "zzzz" at that time.

    At "release" to QA we concatenate all relevant source code files (every SProc, Trigger, View etc.) into a single release-script, search for "ZZZZ" and find & fix the comment appropriately for Release.

    Oh! for a pre-processor directive 🙂