Using Ascii Text to Help Section Code

Contributor Icon Contributed by davak Date Icon October 12, 2003  
Tag Icon Tagged: Computer programming

When coding in a plain text environment, it is difficult to set off sections and comments. The use of ascii generated text can make your life easier.


Coding in a plain text environment can be difficult because it is often hard to identify and set off areas of code. The generation of large ascii text to head and comment sections is very helpful in making your code more readable.


/* .__
____ ___ ________ _____ ______ | | ____
_/ __ \\ \/ /\__ \ / \\____ \| | _/ __ \
\ ___/ > < / __ \| Y Y \ |_> > |_\ ___/
\___ >__/\_ \(____ /__|_| / __/|____/\___ >
\/ \/ \/ \/|__| \/
*/

Websites such as the ASCII generator makes the production of this text very easy.

Now you can detail your code with style.

Previous recipe | Next recipe |
 
  • Doug Merritt
    At best this is fluff, on the order of
    drawing little hearts or flowers over
    the letter 'i'.


    At worst this is plain bad practice,
    because it creates text that cannot
    be automatically searched.


    Standard practice is to just insert
    a row of dashes or asterisks or
    equal signs if you want to separate
    sections, and that's good standard
    practice

  • davak
    If it bothers you not to be able to search, then include similar labelling plain text in the comment. I am not suggesting that this is a replacement for good commenting.

    However, if you are editing in a plain text environment, having a unique labelling system with ascii text allows one to quickly scroll to an area of interest. For example, when I am actively working on one particular area, I often label it with a huge ascii label of "HERE." Of course, I comment my code as I go... but having the ASCII label allows me to point out a particular area of interest.

    Doug, I appreciate different opinions... and even more I appreciate people like you that contribute to the site.

    I may disagree, but thanks for helping.

    Davak
  • guest
    I agree with Doug; it is quite silly to do it. If you need a method of distinguishing sections, it is a simple matter to make a block of symbols, such as asterisks, that identify the section and include simple text in it.

    *****************************************************
    *****************************************************
    ********MY SPECIAL SECTION BLOCK IDENTIFIER**********
    *****************************************************
    *****************************************************


    It is very simple to make another style to identify another section type.

    +++++++++++++++++++++++++++++++++++++++++
    +++++++++++++++++++++++++++++++++++++++++
    +++++++++special section identifier two +++++++++++++
    +++++++++++++++++++++++++++++++++++++++++
    +++++++++++++++++++++++++++++++++++++++++
    +++++++++++++++++++++++++++++++++++++++++


    I think any "normal" person gets the idea.

    "Simplicity is simply the hardest concept to reduce to practice. It seems to be easier the less we know, or perhaps for those of lesser intelligence. The simpleton practices it innately. I suggest he has much to teach the rest of us, and he will do it simply."

    from Dr. Dave's "It's Nearly a Philosophy"
  • davak
    <ul id="quote">I think any "normal" person gets the idea. </ul>

    I'm not normal, I'm a computer geek. :)

    I may not agree, but I appreciate your opinion...
blog comments powered by Disqus