Collection of comment styles.

June 03, 2007 @ 07:36 AM | posted by carmelyne

(last updated: 08.08.07)

Single line comments:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
AppleScript (*Hello I am a comment*) 
ASP <% 'Hello I am a comment. %>
Bash # Hello I am a comment 
C // Hello I am a comment
C++ /* Hello I am a comment */
CSS /*  Hello I am a comment */
Coldfusion <!--- Hello I am a comment --->
DOS :: Hello I am a comment 
Erlang % Hello I am a comment 
HTML <!-- Hello I am a comment -->
Java // Hello I am a comment 
JavaScript  /* Hello I am a comment */ 
Liquid {% comment %} Hello I am a comment {% endcomment %} 
Lua -- Hello I am a comment --
Perl # Hello I am a comment  
PHP <?php // Hello I am a comment ?>
Python # Hello I am a comment  
Regex (?#Hello I am a comment)
Rails <%# Hello I am a comment %>
Ruby # Hello I am a comment 
Smarty {* Hello I am a comment *}
XML <!-- Hello I am a comment -->
YAML # Hello I am a comment  

I've been wondering what comment style is used in Liquid.

Got any to share?

[ Last updated: August 08, 2007 @ 10:48 PM ]


11 Responses to...
“Collection of comment styles.”

  1. Armin Ronacher:

    Python has # comment, not // comment



    Posted:
  2. carmelyne:

    @armin, you're correct. I've updated the post. Thank you. :)



    Posted:
  3. topfunky:

    The DOS shell uses the double-colon:

    ::



    Posted:
  4. stoyan:

    Erlang: % this is a comment



    Posted:
  5. carmelyne:

    @topfunky, DOS is always almost forgotten. Thanks for that input.

    @stoyan, thanks on the Erlang input. I've been meaning to check Erlang.



    Posted:
  6. João Sena Ribeiro:

    C++ uses both (C-kind) styles, and C uses the first, or both, from C99 forward:

    /* This is a comment. */ // So is this.



    Posted:
  7. carmelyne:

    @João, Thanks for the C++.



    Posted:
  8. Damon Clinkscales:

    According to the Liquid help at Shopify, Liquid uses this form:

    Hi there. {% comment %} I am hidden. {% endcomment %}



    Posted:
  9. carmelyne:

    @damon, Thanks. I can officially hi now!



    Posted:
  10. Shernobyl:

    21 AppleScript -- Hello I am a comment



    Posted:
  11. carmelyne:

    Thanks, Sherno.



    Posted:

Sorry, comments are closed for this article.

Snippets of 06/24/07

Rails 'A'..'Z' Paginate

1
2
3
4
5
6
7
8
9
10
11
# Starts with 'A'..'Z' Paginate / model
def self.sort(sort)
  if sort
    find(:all, :conditions => ['name LIKE ?', "#{sort}%"])
  else
    find(:all, :order => 'name')
  end  
end

# index action / controller
@models = Model.sort(params[:sort]) 

Recent Posts...

RailsConf 2006
I heart devChix