One of the things that Rebol has wanted to go after is the idea that you don’t need an IDE or syntax highlighting to feel the code is readable or looking pleasing.
(I’ve felt like there is something of a similarity of goals here with MarkDown; that the idea you could pull the code out of an old-school typewriter and feel the lack of any kind of rendering engine isn’t a liability.)
On this note, the use of semicolons for comments in Rebol has never felt good to me. Semicolons standing alone almost look like dirt; they’re too light and broken-up to feel like a good “barrier”.
some (code [that looks]) kind of Englishy ; a Rebol comment
The solutions that have come along feel like they’re making the problem worse, and I resent having to “make something up” to tack on more characters that are optional as decoration to make up for how weak semicolon is:
double (semicolons [are also]) broken-dirty ;; a Rebol comment semicolon (and [dashes aren't]) really better ;-- a Rebol comment
Historically, semicolons come from Lisp and its family…as well as many assembly languages. Besides the complaints I give about it, I’m certain it looks quirky unnatural to the average programmer of today.
The two notably popular choices for end-of-line comments are
// from many C-derived languages (originally a C++ invention, but added to C–which is saying something, because C has been very reluctant to take C+±isms)…and the
# which is popular in shell/scripting languages. For a big survey of forms of comments, Rosetta Code has it covered:
Meanwhile languages that seem to be more in the script space have gone with
#…but not just the usual suspects like Awk/Sed/Perl/PHP/YAML, but PowerShell, Ruby, Python, Julia…
I don’t think repeating random mistakes because they are popular is a good idea. But there seems to be a kind of visual truth about these stronger separating choices. When I have to use some other language and then come back to Rebol and accidentally start commenting with
#, I think about how much better the resulting code looks.
(I encourage others to experiment and see how you feel.)
There’s obviously an issue (ha) with using
# with no space after it as a comment, since that is how ISSUE! is denoted. I don’t really feel like requiring a space after it to get comment behavior is so bad, as
#this looks bad anyway. Though repeating # should be legal, to kind of draw separators, e.g.
######### This should be able to be a comment ##########
It feels much more solid than:
;;;;;;;;;; This terrible abomination ;;;;;;;;;;;;;;;;;;;;
Sometimes I think
# is perhaps a bit too heavy, and the
// reminds me of one of my historically favorite marking patterns…standardized by OSHA to mean “physical hazard”:
////////// This is actually kind of cool /////////////////
So I’ve got some mixed feelings personally about liking
//, and also thinking
// makes for a pretty poor Rebol WORD! (try putting it in a PATH!) so it would be nice to make it illegal there–which declaring it a comment would do. But it seems when you look at the group of languages Rebol is most aiming at that # makes more sense, as well as being able to accomplish the goal of the desired barrier in a single character instead of two.
There’s also the need to support shebang in some way, and it would be easier if things like
#! were not issues but treated as comments…which could go with the
## types of exceptions above.