4

Ok, сontinuing the theme of highlighting. Why doesn't Stack Overflow highlight the "get" and "set" keywords? Even with <!-- language: lang-c# -->:

public class Something
{
    private readonly int field;
    public int Property { get; protected set; }
}

EDIT: there is also an issue with "readonly".

9
  • 8
    It is not Stackoverflow fault. SO uses third party library (google prettify) for highlighting. Tell them about this problem, and, I guess, as far as google release new version, you'll get highlighting here.
    – om-nom-nom
    Apr 18, 2012 at 18:18
  • 1
    Because this issue is still open (sort of; identifying the properties in the lexer to properly highlight the get/set is non-trivial).
    – Tim Stone
    Apr 18, 2012 at 18:21
  • @om-nom-nom But those libraries are either open source or tunable.
    – lorond
    Apr 18, 2012 at 18:23
  • @Lorond Yes, but I suppose SE doesn't want to maintain an own clone/fork of the library when the improvement could go into the main release. Apr 18, 2012 at 19:22
  • SO is (quite rightly) telling you that properties are a lousy idea, and you shouldn't use them. Apr 18, 2012 at 19:31
  • @Jerry: [citation-required] I can think of lots of reasons to use properties when you're writing C# code, if only because the .NET Framework does this extensively itself.
    – Cody Gray
    Apr 18, 2012 at 20:17
  • @TheEstablishment: Yes, .NET is lousy design. You can cite me, if you want. When it comes to designing code, I'm obviously a much better authority than whoever made the decisions in that design! :-) Apr 18, 2012 at 20:25
  • @JerryCoffin: It's hard to tell if you're joking or not. I like you're style...or do I? Apr 18, 2012 at 21:01
  • @BrianGideon: I usually don't know for sure either. Apr 18, 2012 at 21:11

1 Answer 1

1

As Tim noted in comments, this is something you'll need to take up with the Prettify folks to get this implemented (if it is even possible and desirable).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .