User login

Line length for comments to wrap, Drupal best practices

Agaric asked this question on IRC #drupal-dojo, eventually the answer came back: 80 characters.

Thanks add1sun!

IRC is a little like the real sea, and tossing bottles with messages into it...

agaric: coding standards: for long comments (/** *stuff here */) that wrap, we're supposed to hard wrap, right? At how many characters?
Michelle: coding standards?
Druplicon: coding standards is http://drupal.org/coding-standards
agaric: It doesn't cover recommended line length for comments... I guess we're just supposed to keep them reasonable
Michelle: I don't know... I don't code for core so I never looked at them
Michelle: They'd know in #drupal
agaric: Thanks Michelle, I just don't think programmers should be given that much artistic creative freedom
Michelle: LOL
Michelle: I don't code for anyone else so I can do what I like

add1sun: agaric, i think the standard is to keep it under 80 for the wrap

Spot-checking core confirms this. Longest doxygen style comment line that I've found is 78 characters.

Other resources:
http://www.stack.nl/~dimitri/doxygen/docblocks.html

Agaric asked this question on IRC #drupal-dojo, eventually the answer came back: 80 characters.

Thanks add1sun!

IRC is a little like the real sea, and tossing bottles with messages into it...

agaric: coding standards: for long comments (/** *stuff here */) that wrap, we're supposed to hard wrap, right? At how many characters?
Michelle: coding standards?
Druplicon: coding standards is http://drupal.org/coding-standards
agaric: It doesn't cover recommended line length for comments... I guess we're just supposed to keep them reasonable
Michelle: I don't know... I don't code for core so I never looked at them
Michelle: They'd know in #drupal
agaric: Thanks Michelle, I just don't think programmers should be given that much artistic creative freedom
Michelle: LOL
Michelle: I don't code for anyone else so I can do what I like

add1sun: agaric, i think the standard is to keep it under 80 for the wrap

Spot-checking core confirms this. Longest doxygen style comment line that I've found is 78 characters.

Other resources:
http://www.stack.nl/~dimitri/doxygen/docblocks.html

Comments

test

test

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.