Talk:Assignment (computer science)

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

I'm trying to learn programming and was looking for a definition for the differences between Assigment and Equality, the wikipidia provided half the answer but I couldn't easily find or understand the other half so I just did my own definition (I "got it" running the code). Not sure if this is correct but it makes sense to me. Using Python btw.

Assignment vs Equality[edit]

Assignment is where a value is assigned to a variable. It can be easily thought of as a statement so in the example below var equals hello world.

>>> var = "hello world"
>>> print var
hello world

Equality . It can be easily thought of as a question so if we continue the example and pose the question does var equal hello world? we return the answer True.

>>> var == "hello world"
True

x86 MOV instruction[edit]

RE: "Machine language and assembly language MOV is not an "assignment statement") "

1: i don't think you are correct, though you may have a technical reason for making that statement. in any event, MOV is at least equivalent, or else analogous, to assignment.

2: so what? all i added was a see also link. if you want to see how you move data around in x86 assembler (which is what assignment is used for in highlevel languages), then see the x86 assembler MOV instruction. if you want to see the fundamental instruction that a high-level assignment statement will compile to, see the x86 assembler MOV instruction. Sahuagin 14:36, 4 May 2007 (UTC)[reply]

  • Programming language constructs are not the same thing as machine instructions.
  • Even if they were, there is no particular reason to link to the x86 assembler instruction. Why not the corresponding Java bytecode, ARM instruction (there are more of them in the world than there are x86's), and (hey, why not?) IBM 360 instruction?
  • You are mistaken about what an assigment statement "will compile to". MOV is a machine instruction used to implement assignment in some cases. In other cases, assignment is implemented using a register-to-register instruction (e.g. a=a+1 where a is in a register), a block copy (when the thing being assigned is big), or sometimes even nothing at all at runtime. --Macrakis 16:34, 4 May 2007 (UTC)[reply]

"MOV is a machine instruction used to implement assignment in some cases". works for me. Sahuagin 21:37, 4 May 2007 (UTC)[reply]

MOV is used for many things, including implementing assignment. Assignment is compiled into many things, including MOV. I don't think it makes sense to try to compress a discussion of programming language compilation into a "see also" reference to a machine instruction, especially not a particular instruction set architecture's machine instruction. --Macrakis 02:17, 7 May 2007 (UTC)[reply]

I agree with Macrakis. I see no reason to link to MOV at all. I can see why someone might think MOV is related to assignment, but the relationship is in fact tenuous. A link to a discussion of compiling assignment statements would be appropriate. — Chris Page 21:36, 8 May 2007 (UTC)[reply]

assignment compatibility[edit]

Neither this article nor the English-spoken Wikipedia mentions the very important issue of assignment compatibility - this is really a blind spot, since the broadly non-existing assignmenz compatibility in programming languages and executable programs is responsible for many, many vulnerabilities, software bugs and endless and unnecessary debugger sessions at runtime. I really do not understand why this important topic seems to be neglected if not ignored by so many academics (and unfortunately this was also the case for many programming language designers).

If you understand German you may refer to de:Zuweisungskompatibilität.--Bautsch (talk) 09:36, 11 October 2011 (UTC)[reply]

Article is incomplete[edit]

This article is incomplete without mention and guidance towards ASCII, Unicode, and XHMTL and such topics. See the Ampersand article for comparison and other possible treatments and relative expansion directions.

  • BUT I'm merely trying to code something and need a unicode value, and neither article has been the reference to such one would and should expect. A table of such codes should be locally on the article where such codes are so universal as a quick look up place, even as the last section before references.

As a natural reference to the instance needed, this 'missing' treatment sucks for quick answers. Ditto the formulation of the HTML page I tried earlier. I don't need the binary, just the HTML/XHTML a wiki will parse properly including a template. People have time pressures, so why not accommodate that aspect with a one row table? // FrankB 16:55, 16 June 2013 (UTC)[reply]

  1. I don't really understand your question. Have you figured out an answer since you posted?
  2. Does this article help you: String literal ?
  3. What are the connections between assignment and ASCII, Unicode or XHTML?
  4. There are a couple of short tables at Notation. Do they help, and if not, why not?
  5. Can you add the missing table yourself?
--Hroðulf (or Hrothulf) (Talk) 09:16, 3 July 2015 (UTC)[reply]

drive letter assignment in see-also?[edit]

Why do we need a link to "drive letter assignment" in this article? Where is the relation (apart from the word assignment) to the assignment as described in this article here? IMHO this link is completely useless - even misleading - and should be removed completely. 79.193.248.193 (talk) 14:47, 9 September 2013 (UTC)[reply]

79.193.248.193 (talk) 14:47, 9 September 2013 (UTC)[reply]
  • Good call. This is likely an attempt to disambiguate this usage, which is placed at a generic title related with computing, to make readers aware that the other meaning also has an article. I've moved it to a hat note so that it's clear that their meanings are not related. Diego (talk) 15:07, 9 September 2013 (UTC)[reply]


Assignment versus initialization[edit]

This article (Semantics, right above Single assignment) mixes up two different concepts – assignment and initialization. The difference can be seen clearly in C++ when overloading assignment operator or creating copy constructor. I don't feel very confident though to rewrite this part. 78.128.196.3 (talk) 12:24, 20 September 2013 (UTC)[reply]

Initialization is one form of assignment, and the specific differences are explained in the Single assignment section. That in C++ there's an specific syntax for the initial and the other assignments doesn't make them essentially different. What do you find in the Semantics section that would need rewriting to deal with that particular kind of assignment? Diego (talk) 12:47, 20 September 2013 (UTC)[reply]

Interwikis[edit]

This page has Wikidata entry: https://www.wikidata.org/wiki/Q231158 with versions in multiple languages. For some reason, the "Languages" sidebar in English article does not show any interwiki links to articles in other languages, even though there are interwiki links to English article from articles in other languages. Is it just for me or something is broken? I could not find any information about this in help. — Preceding unsigned comment added by 31.13.144.50 (talk) 02:10, 3 July 2015 (UTC)[reply]

  • Fixed It is not just you, but nothing was broken. The wikidata only gets updated in wikipedia when the article is edited or purged, which I did a few seconds ago. (I used this method.) --Hroðulf (or Hrothulf) (Talk) 09:03, 3 July 2015 (UTC)[reply]
Thanks! Just fixed identical problem in an article in another language. — Preceding unsigned comment added by 31.13.144.4 (talk) 14:40, 3 July 2015 (UTC)[reply]

External links modified[edit]

Hello fellow Wikipedians,

I have just modified one external link on Assignment (computer science). Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 18 January 2022).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 02:58, 20 October 2016 (UTC)[reply]