My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 244: Warn about suboptimal comment-style
1 person starred this issue and may be notified of changes. Back to list
Status:  Accepted
Owner:  ----


Sign in to add a comment
 
Reported by gwe...@gmail.com, Dec 25, 2009
character-wise, one saves characters by using {- -} instead of --s
when there are 3 or more consecutive lines. That is,

 --- foo
 -- bar

is equal to

 {- foo
 bar -}

But

 -- foo
 -- bar
 -- quux

uses 2 more characters than

 {- foo
 bar
 quux -}

3 lines might be on the borderline, but I think at 4 lines or more,
the superiority of {--} is clear:

 -- foo
 -- bar
 -- quux
 -- qux
 -- courge
 -- graply

 {- foo
 bar
 quux
 qux
 courge
 graply -}

Using the right comment style in the right context helps out automated
tools detecting redundancy, editors, people reading the code (less visual
noise), and people editing Haddocks (easier to move stuff around).
Jan 3, 2010
Project Member #1 ndmitch...@gmail.com
I personally don't like this change, but I can see that some people would. I think it 
would have to be added as off-by-default (something HLint doesn't really have yet, 
but should get). Technically, HLint is still on the old style HSE stuff, so can't 
even see the comments, so this would have to wait for that anyway.

PS. I'd certainly write:

{-
foo
bar
quux
qux
courge
graply
-}

I don't like multiline comments sharing comment lines.
Status: Accepted
Labels: -Priority-Medium Priority-Low Proj-HLint
Sign in to add a comment

Powered by Google Project Hosting