Blocks for single line statements

4 posts, 0 answers
  1. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 30 Jul 2013 Link to this post

    Hello,

    Could you review your logic to apply the blocks to the single line statements?
    What I don't like in the current implementation is how JC treats comments.

    Compare the following code with the option "Always except for single line statements":
    My suggestion is simple: define "single line statements" as a real single line no matter of what (code/comment/etc)

    // Case 1: no issues here
    if (System.Globalization.CultureInfo.InvariantCulture.Name == "en-CA")
        language = string.Format("EN:{0}", someDescription);
    else
        language = string.Format("FR:{0}", someDescription);
     
    // Case 2: no issues here.
    if (System.Globalization.CultureInfo.InvariantCulture.Name == "en-CA")
    {
        language = string.Format("EN:{0}",
            someDescription);
    }
    else
    {
        language = string.Format("FR:{0}",
            someDescription);
    }
     
    // Case 3: here is the issue! Visually, there is no difference from case 2!
    if (System.Globalization.CultureInfo.InvariantCulture.Name == "en-CA")
        // Comment line 1
        language = string.Format("EN:{0}", someDescription);
    else
        // Comment line 1
        language = string.Format("FR:{0}", someDescription);
     
    // Case 4: even worse!
    if (System.Globalization.CultureInfo.InvariantCulture.Name == "en-CA")
        // Comment line 1
        // Comment line 2
        // Comment line 3
        // Comment line 4
        // Comment line 5
        language = string.Format("EN:{0}", someDescription);
    else
        // Comment line 1
        // Comment line 2
        // Comment line 3
        // Comment line 4
        // Comment line 5
        language = string.Format("FR:{0}", someDescription);
  2. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 01 Aug 2013 Link to this post

    Hello Michael,

     Thanks for contacting us.
    I would suggest posting this in our feedback portal where it could gather popularity among our community.
    As higher votes it gets as sooner it will be implemented.
    Thank you.

    Regards,
    Zdravko
    Telerik
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
  3. DevCraft banner
  4. miksh
    miksh avatar
    275 posts
    Member since:
    Nov 2006

    Posted 01 Aug 2013 Link to this post

    Done.

    Why does your feedback portal NOT support the code blocks in the message body? Very inconvenient.
  5. Zdravko
    Admin
    Zdravko avatar
    657 posts

    Posted 02 Aug 2013 Link to this post

    Hi Michael,

     Indeed you are right. We have to improve this.
    Thanks and sorry for the inconvenience.

    Regards,
    Zdravko
    Telerik
    Share what you think about JustCode with us, so we can help you even better! You can use the built-in feedback tool inside JustCode, our forum, or our JustCode feedback portal.
Back to Top