in reply to Syntax Highlighting Editors Beware

The dash (-) has been present in identifiers for a long time.

Two examples:

PowerBuilder will treat the expression A-B as either an identifier or an expression depending on the the value of the DashesInIdentifiers property. If DashesInIdentifiers is set to 1, then A-B is an identifier,if set to 0, then A-B.

In Progress 4GL Identifiers for any Progress 4GL objects such as a table, field, variable, or internal procedure, allow the dash characters (but not the first character).

I am sure there are many more languages supporting this. Dashes are also allowed in XML tag names.

The question is if you gain anything from it? I always favoured underscores over dashes for readability. IMHO $this_is_some_name is more readable then $this-is-some-name.

I am not too happy with allowing the quote (‘) in identifiers. I fail to see the benefit. $I'am-afraid-it-will-only-create-confusion;-)

Replies are listed 'Best First'.
Re^2: Syntax Highlighting Editors Beware
by krishnoid (Novice) on Aug 11, 2008 at 03:29 UTC
    I am sure there are many more languages supporting this.

    How ironic (?) this should appear in a thread about Syntax Highlighting Editors Beware -- considering what the hallowed standard for emacs-lisp identifiers looks like. Personally, I've been looking forward to this since I first started programming in C (shortly after learning emacs-lisp). It means I need to hit shift only once (for the sigil) when typing a long variable name.