18

In the Remarks section of a Microsoft dbset.add page I read

Remarks: Note that entities that are already in the context in some other state will have their state set to Added. Add is a no-op if the entity is already in the context in the Added state.

What is no-op used for, and what does it express? Is it "not operational"?
I checked in several dictionaries but was unable to find it.

12
  • 4
    So far as I know, no-op is only ever the microprocessor instruction meaning 'do nothing'. Invariably associated with instruction code 0, largely because if a block of memory containing executable code were to fail or not be correctly written in the first place, it would very like end up containing 0's. Doing nothing is the safest option in that case. It's at least quirky, if not downright geeky, for that MS tech writer to use it in the way he has. Commented May 18, 2011 at 21:35
  • 1
    @FumbleFingers I agree that it's geeky. Fortunately it's targeted at geeks, the bulk of whom will understand it. Commented May 18, 2011 at 21:43
  • 2
    @Fumblefingers - kids today with their automatic garbage collected virtual machines have never heard of assembly language....grumble...
    – mgb
    Commented May 18, 2011 at 22:08
  • 1
    this really should be migrated to SO or some other computer-oriented stackexchange
    – Ken Liu
    Commented May 19, 2011 at 3:30
  • 2
    en.wikipedia.org/wiki/NOP
    – Ed Guiness
    Commented May 19, 2011 at 8:36

2 Answers 2

29

"No operation", i.e. do nothing.

It comes from the assembly language instruction "noop" on most processors which does nothing for one clock cycle and is used for example in delays.

4
  • 3
    In the early days of microprocessors getting into the home, it wasn't uncommon for games to include no-op simply to slow things down enough for players to keep up. Business-oriented code rarely needed that kind of thing. It wasn't until games programmers hit the problem that we got 'timer interrupts', so games could play at the same speed regardless of the hardware they ran on. Commented May 18, 2011 at 21:55
  • Note that on modern processors the NOP instruction takes considerably less than a cycle, and it not useful for delays any more. It does have a use in code that is compiled for debugging, where it serves as a placeholder for code lines that doesn't produce any machine code, so that each line has some code where a breakpoint can be set.
    – Guffa
    Commented May 18, 2011 at 21:59
  • 1
    Becket: I remember programming my own 'snake' game on a 16Kb Sinclair Spectrum. First I had to write my own assembler program for the machine. And there wasn't enough memory, so I had to put my program and its variables into 'screen' memory. Little crawling dots all over the top half-inch of display. Ah! - those were the days! Commented May 18, 2011 at 22:17
  • Actually, I believe that the time wasting NOOP would actually waste 2 machine cycles. One to FETCH the instruction and one to EXECUTE it because that's what uPs do: Fetch and execute.
    – user57748
    Commented Nov 19, 2013 at 20:15
3

This seems to be vaguely computer-science related. I think it means that "Add" is a non-operation. In more words, the "Add" operation does nothing to an object in the "Added" state. Does that answer your question?

Edit: Martin's answer is better.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.