Which do you prefer ' or // and why?

I use ’ because I’m use to it, what about you? I notice that Xojo is inserting // comments when methods are generated automatically.

I use both…

// to seperate major sections of a method
’ to comment actions/processes within the methods

WOULD LOVE to see /* and */ style block comments!!

I seem to use ’ more than // but I have switched back and forth.

I use // by habit from using other languages so for me it is nice to have the // option. Now can I have a ; allowable at the end of lines too? Only kidding but I do find myself adding those pesky semicolons some days.

// for things I do for real comments.
And ’ with the IDE command to disable blocks of code.

[quote=14325:@Christian Schmitz]// for things I do for real comments.
And ’ with the IDE command to disable blocks of code.[/quote]

I think that makes quite a bit of sense. Cmd+’ to quickly comment out a bunch of code in the IDE, or uncomment, but // for real source comments, nice!

Just wanted to write the same as Christian. I do it also this way.

I use // for block comment and ’ for line comment.

[quote=14325:@Christian Schmitz]// for things I do for real comments.
And ’ with the IDE command to disable blocks of code.[/quote]

This.

To disable larger sections, I might surround it with #if FALSE. … #endif instead.

[quote=14338:@Kem Tekinay]This.

To disable larger sections, I might surround it with #if FALSE. … #endif instead.[/quote]

Here is an IDE script to get you started…

[code] If SelLength = 0 Then
Call ShowDialog(“No selection found”, _
“Block Comment Wrap requires that you first select the text you wish to wrap.”, “OK”)
Return
End If

Dim code As String
Dim final As String

code = Trim(SelText)
If code <> SelText Then
final = EndOfLine
End If

SelText = “#If FALSE Then” + EndOfLine + _
Trim(SelText) + EndOfLine + _
#EndIf” + final[/code]

One could modify it to check the first and last lines, if they contain #If FALSE Then", then remove them instead of adding them, thus it becomes a toggle command.

[quote=14325:@Christian Schmitz]// for things I do for real comments.
And ’ with the IDE command to disable blocks of code.[/quote]
I do it this way as well.

I use // for in code documentation and ’ for commenting out code.

This would be very nice to have.

To me this isn’t too big of a deal because I find Cmd+’ easier than typing /* … /. Using Cmd+’ also doesn’t cause nested // problems that exist in some languages… Smart ones ignore inner / */.

True but when writing comments in other languages I usually start with the /* */ then start typing the docs. That way I don’t have to worry about the IDE trying to parse what I am typing.

I use // for in code documentation and ’ for commenting out code.

Same as Christian and Bob.

I found // very nice for documentation and I use the keyboard shortcut for commenting a code in the debug process.

Yes, a way to comments many lines can be good if the code inbetween keeps its colors/tabs; else, I select the block of code and use the keyboard shortcut to comment the block of code.

[quote=14325:@Christian Schmitz]// for things I do for real comments.
And ’ with the IDE command to disable blocks of code.[/quote]
This one as well.

I personally prefer // - This is my comment, why I don’t know, I just prefer that to 'This is my comment.

I always use //, why?

3 reasons:

  1. I like. Many other C inpired languages uses this.

  2. It’s faster for me. My keyboard use dead keys for latin languages, this means that when I press [ ’ ] I need to press a space after because the system waits another char interpreting the possibility of an accented letter like .

  3. Printed clarity:

//
// See how clear is this?
//


’ This is not very clear in black/white

I use "// " since I’m in C/C++ as often as in the RS/Xojo IDE.

Since you can set the default comment characters to "// ", CMD-’ does the same thing all of the time.

’ is much less visible, so i use this more often to comment above any code.

// is what i use after a line of code.

Something like this:
'This is my top code comment, it’s better to read for me… as it’s less visible…
Dim myString As String // This is my string, i can clearly see that there is a comment after my code now…:wink: