Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6050669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:42:52+00:00 2026-05-23T07:42:52+00:00

I am using ReSharper to refactor my code, and one of the suggestions of

  • 0

I am using ReSharper to refactor my code, and one of the suggestions of ReSharper is to use a respective branch instead a if statement that is always true.

If I have

if (myVar != null){
   //code
}

And I apply the respective branch the code is like the following

{
   //code
}

Is this a short cut of an if statement?
What is this used for?
What is the difference between the cutely brackets and nothing?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:42:52+00:00Added an answer on May 23, 2026 at 7:42 am

    The block is required to stay there, or semantics would change.

    The scope of variables declared inside the branch block would change when you remove the braces. Potentially with conflicting/hiding (lambda) variables this would lead to surprises.

    To remove the braces, position the cursor on either one and hit Alt-Enter, ‘Remove Braces’

    Reintroduce braces: select block of code, Ctrl-Alt-J, 7 to surround with block 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started using Resharper. One of its features is that it suggests changes
I recently upgraded to using ReSharper 5 (currently in beta). I noticed that in
When I create a constructor with parameters using Resharper's 'Generate code' feature, I get
I just wanted to know your experience with using resharper. We have a very
I have recently started using ReSharper which is a fantastic tool. Today I came
I'm using ReSharper 5.0, and am wondering how its code analysis function knows to
I've begun using ReSharper and really enjoy it. However I have a project which
I use code rush and refactor pro (highlight possible code issues and so on
I have been using ReSharper for quite a long time and get used to
I'm using Resharper 6 and ASP.NET Web Methods and have an irritating warning in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.