This is a migrated thread and some comments may be shown as answers.

Blocks for single line statements

3 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
miksh
Top achievements
Rank 1
Iron
miksh asked on 30 Jul 2013, 12:55 PM
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);

3 Answers, 1 is accepted

Sort by
0
Zdravko
Telerik team
answered on 01 Aug 2013, 02:09 PM
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.
0
miksh
Top achievements
Rank 1
Iron
answered on 01 Aug 2013, 02:14 PM
Done.

Why does your feedback portal NOT support the code blocks in the message body? Very inconvenient.
0
Zdravko
Telerik team
answered on 02 Aug 2013, 12:36 PM
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.
Tags
General Discussions
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Zdravko
Telerik team
miksh
Top achievements
Rank 1
Iron
Share this question
or