Ordering Comments

Thread is closed for posting
2 posts, 0 answers
  1. MiddleTommy
    MiddleTommy avatar
    163 posts
    Member since:
    Nov 2009

    Posted 17 Jul 2010 Link to this post

    When you have simple comments above a method or property it reorders those comments to the bottom of the class when ordering takes place.

    public class Hello
        //this is the contructor
        public Hello(){}

    //is reordered to
    public class Hello
        public Hello(){}
        //this is the contructor

    I think comments above a property, class or method that has no blank line between the comment and the code should not be reordered away from the code

  2. Deyan Varchev
    Deyan Varchev avatar
    150 posts

    Posted 19 Jul 2010 Link to this post

    Hello Tommy,

    Thanks for sharing your suggestion. Although it sounds logical, it will depend on the semantics of the comment whether it is for that particular method or not. Quite frequently developers comment-out large amounts of their source code (methods) and in those cases the code formatting will not work as expected. In general it is a good practice to use Doc comments (prefixed with /// in C# or ''' in VB.NET) instead of normal comments. This way, JustCode will know that the documentation is intentionally put in front of the method and will keep its correct position after formatting.

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top