No-operation instruction
Updated: 09/12/2023 by Computer Hope
Alternatively called a do-nothing instruction, the no-operation instruction, NO-OP, or NOP instruction in programming tells a program to do nothing if a conditional statement is met.
Tip
This term NO-OP is pronounced "no awp."
Examples of an NOP in different programming languages
- In C, a semicolon ( ; ) by itself or an empty block ( {} ) is a NOP.
- With jQuery, the "jQuery.noop()" function creates a NOP.
- In Perl, the ellipsis statement ( … ) can be used as a NOP. However, if Perl tries executing the code, it gives an Unimplemented exception.
- In Python, the "pass" statement can be used as a NOP.
- With Visual Basic, a semicolon ( ; ) is a NOP.