[erlang-questions] block comments

Björn-Egil Dahlberg egil@REDACTED
Fri Jul 18 14:34:31 CEST 2014

I agree with Richard.

A side note:

My work is about evenly divided between C code and Erlang code.

In C we only use /* block comments */ and // coments are frowned upon 
(you are actually in error if you use them in our code).
In Erlang we have the opposite, only % line comments.

I'm originally from a complete C-world and I really missed the /* block 
comments */ in the beginning when writing Erlang code. Today this is 
completely reversed. I use my editor comment out large sections of code 
if needed. /* block comments */ are actually a hindrance here since I 
need to keep track of the beginning and end of a comment. I frequently 
use // instead - but never in committed code. For me, it's much easier 
to use line comments but I had to unlearn and learn anew.

To answer your question, no block comments in Erlang and you'll likely 
never see them either.

// Björn-Egil

On 2014-07-18 02:58, Richard A. O'Keefe wrote:
> On 18/07/2014, at 12:11 PM, <lloyd@REDACTED> wrote:
>> But why doesn't Erlang have a method for commenting out a block of lines in a module without
>> having to tag every line with %?
> See the Ada rationale.
>> Or did I miss that page?
>> It would be so convenient  at times.
> In my text editor, writing Prolog, I can comment out
> a region in one of two ways:
> <visit beginning>               <visit beginning>
> <mark>                          <mark>
> <visit end>                     <visit end>
> Meta-/                          Meta-%
> It's the same number of keystrokes to get /**/ around
> or % on every line.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

More information about the erlang-questions mailing list