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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:23:31+00:00 2026-05-26T13:23:31+00:00

The error I get from the compiler is "The left hand side of an

  • 0

The error I get from the compiler is "The left hand side of an assignment must be a variable". My use case is deep copying, but is not really relevant.

In C++, one can assign to *this.

The question is not how to circumvent assignment to this. It’s very simple, but rather what rationale is there behind the decision not to make this a variable.

Are the reasons technical or conceptual?

My guess so far – the possibility of rebuilding an Object in a random method is error-prone (conceptual), but technically possible.

Please restrain from variations of "because java specs say so". I would like to know the reason for the decision.

  • 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-26T13:23:31+00:00Added an answer on May 26, 2026 at 1:23 pm

    In C++, one can assign to *this

    Yes, but you can’t do this = something in C++, which I actually believe is a closer match for what you’re asking about on the Java side here.

    […] what rationale is there behind the decision not to make this a variable.

    I would say clarity / readability.

    this was chosen to be a reserved word, probably since it’s not passed as an explicit argument to a method. Using it as an ordinary parameter and being able to reassign a new value to it, would mess up readability severely.

    In fact, many people argue that you shouldn’t change argument-variables at all, for this very reason.

    Are the reasons technical or conceptual?

    Mostly conceptual I would presume. A few technical quirks would arise though. If you could reassign a value to this, you could completely hide instance variables behind local variables for example.

    My guess so far – the possibility of rebuilding an Object in a random method is error-prone (conceptual), but technically possible.

    I’m not sure I understand this statement fully, but yes, error prone is probably the primary reason behind the decision to make it a keyword and not a variable.

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

Sidebar

Related Questions

I use sendSynchronousRequest:returningResponse:error method of NSURLConnection class to get NSData from network. http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/Reference/Reference.html NSData
Here's the error I get: Message from VCC-compiler: Unterminated string at (input Line 39
What is the best way to get error messages from a WF4 workflow back
I need to get a value from another page. But I get this error
Hi I keep getting this error, I'm trying to get tweets from twitter via
I get this error about casting from type A to type B because the
I get this error message from a Ghostscript call: Error: /syntaxerror in -file- Operand
I get following error when trying to access Xampp from a network I've tried
I get an error when i do the following: SELECT * from cGift c1
Why I'm getting this error. My variables get the names from request, and also

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.