Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

C# coding style?

edited June 2011 in Vanilla 2.0 - 2.8
I was just wondering about the C# (I presume?) coding style behind Vanilla.

I generally change my coding style depending on the language I work with (AS3: camelCase, PHP: underscore_case).

I'm generally not too keen on SentenceCase methods and classes in C# as it's not as intuitive to distinguish between properties and classes, but nonetheless, that's what we've got, so I was wondering about the historical background behind the choice?

Cheers,
Dave

Comments

  • Options
    LincLinc Detroit Admin
    I'm not sure there's any reason to it other than it's what Mark and Todd started coding in because it was their preference.
  • Options
    SS ✭✭
    edited June 2011
    Vanilla I was coded in this style too.
    I very like CamelCase coding style name declaration, actionScript/javaScript/php_under_score style is really pissed me off.

    I believe that Mark was coming to PHP from C# (or something similar ???.NET maybe)
    Many functions names and class names are really same and do same things.

    C# (???.NET):
    String.IsNullOrEmpty (function)
    DataSet class
    SqlConnection.ConnectionString

    PHP/Garden:
    StringIsNullOrEmpty($String);
    Gdn_DataSet
    GetConnectionString

    I like CamelCase style because it used in UnrealScript, and Unreal Tournament (UT2004) is my favorite game (I made a couple of mods/mutators for it).
  • Options
    edited June 2011
    Thanks for the C# info there - I thought as much.

    Personally, I always try to code in the style of the language - it makes it easier for others used to that style to read your code, and remains consistent with native members.

    So even though I don't like the visual ambiguity of upper CamelCase Methods and Classes in C# (compared to lowercase camelCase methods and Classes) if I wrote C# I would probably stick to it.

    Anyway, the question was in no way a moan - Garden is written so it ain't gonna change - I was just interested :)
Sign In or Register to comment.