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

  • SEARCH
  • Home
  • 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 8040435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:53:46+00:00 2026-06-05T03:53:46+00:00

I am accustomed to write the code as(just an example) Request.QueryString[xxxx] != null Recently

  • 0

I am accustomed to write the code as(just an example)

Request.QueryString["xxxx"] != null

Recently someone said that

null != Request.QueryString["xxxx"]

gives a better performance.

I am curious to know as whether it actually brings any difference or not and if so how?

Note~ The above is just an example. To be generically speaking

Whether

Constant [Operator] Actual Value (e.g. 1 == Convert.ToInt32(textbox1.text))

is better than

Actual Value [Operator] Constant (e.g. Convert.ToInt32(textbox1.text) == 1)

Thanks

  • 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-06-05T03:53:47+00:00Added an answer on June 5, 2026 at 3:53 am

    No, it’s not true in general. Comparison operators need to evaluate both their sides so there is no gain in putting constants on the left. But having them on the left hand side (called Yoda style) reduces coding errors in languages where you are allowed to use assignment operator inside a conditional and you unintentionally mistyped the comparison operator == as a single =:

    // What you intended to write
    if (a == 6) ...
    // What you wrote instead
    if (a = 6) ... // --> always true as the value of a is changed to 6
    // What if Yoda style is used
    if (6 = a) ... // --> compile time error
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently debugging someone else's code that flips the ups and downs relative
(Sort of a newbie question from someone that is more accustomed to how Flash/ActionScript
I'm fiddling around with creating sub queries just to become accustomed to them. I'm
I've become so accustomed to stack overflow style formatting that I find it a
We may be accustomed to code below: if(File.Exists(xxx)) { //I am here using(var streamReader
I'm accustomed to running a git comparison that will allow comparison with local git
I find that browsing source code of open source libraries being used in projects
Being accustomed to VB.NET, I'm used to just raise events. Sure, custom events differ,
I am accustomed from PHP to set up CRON on the URL address, that
I know that PHP doesn't yet have native Enumerations. But I have become accustomed

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.