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 8402631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:07:18+00:00 2026-06-09T22:07:18+00:00

I see some code in Nimbus look like this: if (nil == someObject) but

  • 0

I see some code in Nimbus look like this:

if (nil == someObject)

but I usually type:

if (someObject == nil)

Are there any differences in these statements?

  • 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-09T22:07:19+00:00Added an answer on June 9, 2026 at 10:07 pm

    Technically no. The former, Nimbus, is using what is endearingly called “Yoda Conditions”.

    The name of the game being foolproofing here. See, the problem is that this:

    if (someObject = nil) // SETS someObject to nil
    

    is totally valid, only one character away from == nil, and really easy to miss. However, if you attempt to do this:

    if (nil = someObject)
    

    your compiler will freak out, preventing the issue.

    Personally, I hate Yoda Conditionals, as I think they’re hard to read. It does mean being extra careful with my code, but hey, I’m the better for it, right? It all comes down to style here, so whatever makes you more comfortable, go for.

    Oh, and if you’re using Xcode, this is nearly a moot point. If you check out this question, you’ll see that Xcode now warns you if you attempt to do an assignment within an if without extra parens. That is,

    if (someObject = nil) // throws a warning, whereas
    if ((someObject = nil)) // does not
    

    making the issue much harder to miss.

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

Sidebar

Related Questions

In documentation code I see some things like this: /* * @(#)File.java 1.142 09/04/01
I'd like to see some sample code for that. Any good Tutorial-Link is also
i see some code like this SERIAL_NO=121 if [ -z ${SERIAL_NO} ]; then echo
I see some code of some guy that goes like this: while (!(baseType ==
I see some code that looks like this: if(@$_POST['myvar']) What does the @ sign
So I'm looking through some code, and I see this: class whatever { public:
i have see some code like bellow: params = { 'username': username, 'password': password,
This is a common occurence when I code...I see some code that looks kind
I would like to see some code/tutorials on reading an excel spreadsheet (a calender)
I'm fairly new to this concept. I see some functions within some code that

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.