Navigation

    What the Daily WTF?

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    1. Home
    2. Sitten_Spynne
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Sitten_Spynne

    @Sitten_Spynne

    0
    Reputation
    1
    Posts
    14
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Sitten_Spynne Follow

    Best posts made by Sitten_Spynne

    This user hasn't posted anything yet.

    Latest posts made by Sitten_Spynne

    • RE: Recursion in C# Properties

      @MasterPlanSoftware said:

      @Huf Lungdung said:

      TRWTF is your naming convention. How would you code in a case-insensitive language?
       

      Are you suggesting your C# naming conventions should be different because some languages are case insensitive??


        Microsoft suggests it.  The .NET Framework CLS does not dictate that languages must be case-sensitive, and for this reason any public members of a type must be named in a manner that allows a case-sensitive language to use them:

       http://msdn.microsoft.com/en-us/library/04xykw57(VS.71).aspx

      Do not use names that require case sensitivity. Components must be
      fully usable from both case-sensitive and case-insensitive languages.
      Case-insensitive languages cannot distinguish between two names within
      the same context that differ only by case. Therefore, you must avoid
      this situation in the components or classes that you create.

      You can do what you want with your private members, but at least for public members you have to play as if your language isn't case-sensitive to remain CLS-compliant.

       That said, the thought of using recursive code from properties is a horrible WTF.  Property access should never throw a property or incur a delay; recursion can cause stack overflows or take some time to run.  This is a situation that calls for Get/Set methods, rather than "clever" use of recursion.


       

      posted in Side Bar WTF
      Sitten_Spynne
      Sitten_Spynne