In a graphical user interface, programming instructions embedded in a menu option or button defined by the user. The snippet—consisting of one or more lines of source code—determines what the option or button does when chosen or clicked.
— Computer ScienceA small piece of programming code that is part of a larger program. Usually the code snippet performs a specific function or task.
— Computer Science