4 ms·
Indeed. It also saddens me that it does not stick to CS conventions - lots of extra cruft ( the ! for zero-arity method invocation -- instead # for comments etc
by clyfe 15y ago
Indeed. It also saddens me that it does not stick to CS conventions - lots of extra cruft ( the ! for zero-arity method invocation -- instead # for comments etc )
- Cushman 15y agoJust in case anyone else misread this— the comment symbol in MoonScript is literally `--`.
- stephth 15y ago-- is the Lua syntax for comments. I'm curious about why the author kept it.
- jacques_chester 15y ago... because it works fine?
- ColinWright 15y agoAre you actually claiming that "#" is a computer science convention for comments? It's not used in C, C++, Fortran, Lua, or many other languages. For example, comments in OCaml are ( * ... * ) (I've put extra spaces to thwart HN's formatting. Language using "--" for comments include Lua and Haskell. You've made me curious - what languages to you use/know that make you think "#" is a "CS convention" for comments? EDIT: Found a reference: http://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28syntax%29#Comments http://en.wikipedia.org/wiki/Comparison_of_programming_langu... Further edit: In response to the clarification that CS meant CoffeeScript and not Computer Science (nor the riot control gas), the point, I guess, then follows other commentators, who observe that Lua, to which this compiles, uses "--".
- squarecog 15y agoCoffeeScript. CS. JavaScript. JS.
- clyfe 15y agoby CS I mean CoffeeScript, sorry about ambiguity
- Cushman 15y agoBut you're after the right point— the languages are bash, Perl, Python, Ruby. It's a scripting language convention, hence why CoffeeScript adopted it over JavaScript's `//`, hence the confusion as to why MoonScript didn't.