Strings not comment pattern Re: Turtle feature request : multi-line comments (was Re: Proposed conventions: System Triplestore, turtle Command, Text Embedded Turtle)

1. I agre that multi-line comments 
are nice.   I also find it a shame that shell and C, and later C-like 
languages used different comment characters historically.
I'm not going to make a big fuss over it.

2. To add multi-line comments would break old parsers 
seriously, and would break I suspect a very very small number of old documents.

Switching from # would break  massive number of old documents of course.

I don't think the argument about SPARQL computability is very strong,
as that occurs within {} blocks only and block comments
are IMHO less likely within those blocks, I would expect to find them
outside those blocks and line end comments more within the blocks.

3. Block comments may be in many cases deemed inferior to
strings.  And you have multi-line strings. 
In both python and N3 derivatives (sparql, turtle, etc) I have 
picked up the meme that if something is worth block commenting its worth
adding a string to the system instead.

in Pythion, don't write

#  This python program calculates the date of Easter
#
#  Use it like this
#
# 	python   easter 2007
#

def main:
	
	whatever

Write

__doc__ = """ This python program calculates the date of Easter.

 This python program calculates the date of Easter

  Use it like this

 	python   easter 2007
"""

def usage:
	
	print __doc__

def  main:
	
	whatever

In N3 etc don't write 

#   To-Do list ontology
#
#  This ontology should give you all
# the terms you need for doing all kinds of cool things with to-do lists.
# bla bla blah ...
#
#

but write

@prefix s: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> . 

<> a owl:Ontology;
	
s:title "To-Do list Ontology";
	
s:comment """#  This ontology should give you all
the terms you need for doing all kinds of cool things with to-do lists.
bla bla blah ...
""" .

For this reason I have my editor color comments red and strings green,
as a gentle reminder to me.  It would be good for style guides to 
point this out.  Ontology authors certainly should  be very suspicious
od any block comments, but also people inputting random 
stuff about their CD collection or whatever in N3.
It's a pattern I guess. Maybe it has a name already.

Hoping the mail system preserves the indentation above for you

Tim

Received on Saturday, 2 June 2012 22:19:24 UTC