<s>
Snippet	B-Application
is	O
a	O
programming	O
term	O
for	O
a	O
small	O
region	O
of	O
re-usable	O
source	O
code	O
,	O
machine	B-Language
code	I-Language
,	O
or	O
text	O
.	O
</s>
<s>
Ordinarily	O
,	O
these	O
are	O
formally	O
defined	O
operative	O
units	O
to	O
incorporate	O
into	O
larger	O
programming	B-Architecture
modules	I-Architecture
.	O
</s>
<s>
Snippet	B-Application
management	I-Application
is	O
a	O
feature	O
of	O
some	O
text	B-Application
editors	I-Application
,	O
program	O
source	B-Application
code	I-Application
editors	I-Application
,	O
IDEs	B-Application
,	O
and	O
related	O
software	O
.	O
</s>
<s>
In	O
programming	O
practice	O
,	O
"	O
snippet	B-Application
"	O
refers	O
narrowly	O
to	O
a	O
portion	O
of	O
source	O
code	O
that	O
is	O
literally	O
included	O
by	O
an	O
editor	O
program	O
into	O
a	O
file	O
,	O
and	O
is	O
a	O
form	O
of	O
copy	O
and	O
paste	O
programming	O
.	O
</s>
<s>
Snippets	B-Application
are	O
thus	O
primarily	O
used	O
when	O
these	O
abstractions	O
are	O
not	O
available	O
or	O
not	O
desired	O
,	O
such	O
as	O
in	O
languages	O
that	O
lack	O
abstraction	O
,	O
or	O
for	O
clarity	O
and	O
absence	O
of	O
overhead	O
.	O
</s>
<s>
Snippets	B-Application
are	O
similar	O
to	O
having	O
static	O
preprocessing	O
included	O
in	O
the	O
editor	O
,	O
and	O
do	O
not	O
require	O
support	O
by	O
a	O
compiler	O
.	O
</s>
<s>
On	O
the	O
flip	O
side	O
,	O
this	O
means	O
that	O
snippets	B-Application
cannot	O
be	O
invariably	O
modified	O
after	O
the	O
fact	O
,	O
and	O
thus	O
is	O
vulnerable	O
to	O
all	O
of	O
the	O
problems	O
of	O
copy	O
and	O
paste	O
programming	O
.	O
</s>
<s>
For	O
this	O
reason	O
snippets	B-Application
are	O
primarily	O
used	O
for	O
simple	O
sections	O
of	O
code	O
(	O
with	O
little	O
logic	O
)	O
,	O
or	O
for	O
boilerplate	O
,	O
such	O
as	O
copyright	O
notices	O
,	O
function	O
prototypes	O
,	O
common	O
control	O
structures	O
,	O
or	O
standard	O
library	O
imports	O
.	O
</s>
<s>
Snippet	B-Application
management	I-Application
is	O
a	O
text	B-Application
editor	I-Application
feature	O
popular	O
among	O
software	O
developers	O
or	O
others	O
who	O
routinely	O
require	O
content	O
from	O
a	O
catalogue	O
of	O
repeatedly	O
entered	O
text	O
(	O
such	O
as	O
with	O
source	O
code	O
or	O
boilerplate	O
)	O
.	O
</s>
<s>
Text	B-Application
editors	I-Application
that	O
include	O
this	O
feature	O
ordinarily	O
provide	O
a	O
mechanism	O
to	O
manage	O
the	O
catalogue	O
,	O
and	O
separate	O
"	O
snippets	B-Application
"	O
in	O
the	O
same	O
manner	O
that	O
the	O
text	B-Application
editor	I-Application
and	O
operating	O
system	O
allow	O
management	O
of	O
separate	O
files	O
.	O
</s>
<s>
These	O
basic	B-General_Concept
management	I-General_Concept
abilities	I-General_Concept
include	O
operations	O
such	O
as	O
viewing	O
,	O
adding	O
,	O
editing	O
,	O
deleting	O
,	O
sorting	O
,	O
filtering	O
,	O
grouping	O
,	O
renaming	O
,	O
and	O
storing	O
snippets	B-Application
in	O
a	O
repository	B-Application
,	O
catalogue	O
,	O
or	O
database	O
.	O
</s>
<s>
Some	O
editors	O
provide	O
a	O
macro	O
ability	O
to	O
snippets	B-Application
allowing	O
function	O
prototypes	O
and	O
variable	O
control	O
structures	O
to	O
be	O
generated	O
based	O
on	O
a	O
standard	O
template	O
.	O
</s>
<s>
Some	O
programmer	O
's	O
applications	O
such	O
as	O
Eclipse	B-Application
,	O
NetBeans	B-Application
,	O
and	O
Microsoft	O
's	O
Visual	B-Application
Studio	I-Application
(	O
uses	O
TextMate-inspired	O
snippets	B-Application
underhood	O
)	O
and	O
other	O
IDEs	B-Application
include	O
built-in	O
parts	O
of	O
structure	O
for	O
ease	O
of	O
coding	O
.	O
</s>
<s>
Other	O
applications	O
such	O
as	O
Macromedia	B-Language
Dreamweaver	I-Language
make	O
use	O
of	O
these	O
code	B-Application
snippets	I-Application
as	O
well	O
for	O
Web	O
development	O
.	O
</s>
<s>
Snippets	B-Application
may	O
be	O
used	O
inside	O
commandline	B-Application
interfaces	O
like	O
bash	O
,	O
zsh	O
(	O
GNU	O
Linux/Unix	O
-like	O
)	O
or	O
powershell	B-Application
(	O
MS	B-Application
Windows	I-Application
)	O
.	O
</s>
<s>
When	O
the	O
snippet	B-Application
is	O
inserted	O
,	O
the	O
programmer	O
is	O
prompted	O
for	O
the	O
values	O
of	O
the	O
two	O
parameters	O
.	O
</s>
<s>
If	O
the	O
snippet	B-Application
is	O
subsequently	O
changed	O
,	O
say	O
to	O
use	O
__temp	O
instead	O
of	O
temp	O
,	O
it	O
will	O
not	O
change	O
the	O
code	O
that	O
has	O
already	O
been	O
inserted	O
,	O
but	O
will	O
be	O
used	O
in	O
subsequent	O
insertions	O
of	O
the	O
snippet	B-Application
.	O
</s>
<s>
A	O
snippet	B-Application
for	O
this	O
might	O
be	O
represented	O
as	O
:	O
</s>
<s>
In	O
addition	O
to	O
the	O
basic	B-General_Concept
management	I-General_Concept
abilities	I-General_Concept
described	O
previously	O
,	O
snippet	B-Application
management	I-Application
features	O
can	O
be	O
classified	O
according	O
to	O
the	O
scope	O
of	O
interactivity	O
between	O
snippets	B-Application
and	O
the	O
text	B-Application
editor	I-Application
or	O
application	O
that	O
hosts	O
them	O
.	O
</s>
<s>
These	O
snippet	B-Application
feature	O
groups	O
include	O
:	O
</s>
<s>
Snippets	B-Application
of	O
this	O
type	O
consist	O
primarily	O
of	O
fixed	O
text	O
that	O
the	O
user	O
can	O
choose	O
to	O
insert	O
into	O
the	O
current	O
document	O
.	O
</s>
<s>
Static	O
snippets	B-Application
are	O
similar	O
to	O
simple	O
macros	O
,	O
excepting	O
that	O
macro	O
are	O
often	O
evaluated	O
(	O
or	O
inserted	O
)	O
by	O
a	O
command-line	B-Application
program	I-Application
instead	O
of	O
IDE	O
.	O
</s>
<s>
Snippets	B-Application
consist	O
of	O
fixed	O
text	O
combined	O
with	O
dynamic	O
elements	O
(	O
placeholders	O
)	O
which	O
are	O
allowed	O
to	O
be	O
modified	O
either	O
by	O
editor	O
or	O
by	O
user	O
.	O
</s>
<s>
Examples	O
of	O
dynamic	O
elements	O
could	O
be	O
variables	O
such	O
as	O
the	O
current	O
date	O
or	O
system	O
time	O
,	O
or	O
input	O
from	O
the	O
user	O
that	O
is	O
supplied	O
via	O
a	O
GUI	B-Application
,	O
or	O
input	O
from	O
another	O
application	O
.	O
</s>
<s>
Snippets	B-Application
consist	O
of	O
runnable	O
segments	O
of	O
code	O
in	O
either	O
a	O
macro	O
language	O
or	O
a	O
scripting	B-Language
language	I-Language
.	O
</s>
<s>
Scriptable	B-Application
snippets	I-Application
provide	O
the	O
greatest	O
degree	O
of	O
flexibility	O
to	O
the	O
user	O
,	O
although	O
that	O
depends	O
somewhat	O
on	O
the	O
programming	O
languages	O
supported	O
by	O
the	O
text	B-Application
editor	I-Application
,	O
and	O
whether	O
or	O
not	O
the	O
programming	O
language	O
is	O
well-known	O
,	O
or	O
particular	O
and	O
unique	O
to	O
that	O
specific	O
editor	O
.	O
</s>
<s>
The	O
type	O
of	O
scripting	O
support	O
varies	O
,	O
but	O
may	O
include	O
features	O
such	O
as	O
running	O
shell	B-Application
commands	I-Application
,	O
providing	O
a	O
GUI	B-Application
dialog	O
or	O
other	O
methods	O
of	O
user	O
interaction	O
with	O
the	O
operating	O
system	O
;	O
other	O
applications	O
;	O
or	O
other	O
sub-components	O
of	O
the	O
hosting	O
application	O
itself	O
.	O
</s>
<s>
Placeholders	O
are	O
elements	O
within	O
a	O
snippet	B-Application
that	O
are	O
left	O
to	O
be	O
supplied	O
by	O
the	O
user	O
or	O
other	O
external	O
process	O
.	O
</s>
<s>
The	O
values	O
for	O
placeholders	O
are	O
not	O
determined	O
until	O
the	O
text	O
of	O
the	O
snippet	B-Application
is	O
inserted	O
during	O
an	O
editing	O
session	O
.	O
</s>
<s>
Other	O
applications	O
employ	O
graphical	B-Application
user	I-Application
interfaces	I-Application
and	O
modal	O
dialog	O
boxes	O
that	O
allow	O
the	O
user	O
to	O
enter	O
one	O
or	O
more	O
values	O
to	O
be	O
supplied	O
for	O
the	O
placeholders	O
.	O
</s>
<s>
Placeholders	O
are	O
usually	O
indicated	O
by	O
some	O
special	O
character	O
or	O
sequence	O
of	O
characters	O
to	O
distinguish	O
them	O
from	O
the	O
rest	O
of	O
the	O
snippet	B-Application
text	O
.	O
</s>
<s>
Some	O
systems	O
allow	O
snippet	B-Application
placeholders	O
to	O
be	O
named	O
identifiers	O
.	O
</s>
<s>
Example	O
of	O
a	O
snippet	B-Application
in	O
TexMate	B-Application
syntax	O
:	O
</s>
<s>
This	O
allows	O
the	O
user	O
to	O
indicate	O
that	O
the	O
value	O
supplied	O
for	O
one	O
placeholder	O
should	O
be	O
replicated	O
in	O
multiple	O
places	O
,	O
relative	O
to	O
the	O
entire	O
text	O
of	O
the	O
programmable	O
snippet	B-Application
.	O
</s>
<s>
This	O
allows	O
the	O
user	O
to	O
indicate	O
that	O
one	O
or	O
more	O
values	O
supplied	O
for	O
a	O
placeholder	O
should	O
be	O
replicated	O
and	O
transformed	O
in	O
other	O
places	O
within	O
the	O
text	O
of	O
the	O
programmable	O
snippet	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
the	O
user	O
may	O
supply	O
a	O
document	O
title	O
in	O
one	O
part	O
of	O
the	O
snippet	B-Application
,	O
and	O
specify	O
that	O
the	O
document	O
title	O
should	O
be	O
repeated	O
in	O
other	O
places	O
,	O
with	O
the	O
first	O
instance	O
being	O
all-uppercase	O
and	O
every	O
other	O
instance	O
being	O
lower-case	O
.	O
</s>
<s>
For	O
applications	O
that	O
support	O
scriptable	B-Application
snippets	I-Application
,	O
the	O
range	O
of	O
supported	O
programming	O
features	O
varies	O
.	O
</s>
<s>
The	O
following	O
enumerates	O
some	O
of	O
the	O
features	O
that	O
are	O
commonly	O
implemented	O
for	O
programmable	O
snippets	B-Application
.	O
</s>
<s>
Although	O
plain	O
text	O
is	O
a	O
fundamental	O
feature	O
included	O
even	O
with	O
applications	O
that	O
support	O
only	O
non-programmable	O
"	O
static	O
"	O
snippets	B-Application
,	O
programmable	O
snippets	B-Application
are	O
also	O
used	O
for	O
working	O
with	O
plain	O
text	O
.	O
</s>
<s>
One	O
common	O
complication	O
,	O
however	O
,	O
is	O
that	O
environments	O
that	O
support	O
programmable	O
snippets	B-Application
often	O
have	O
to	O
make	O
distinctions	O
between	O
what	O
counts	O
as	O
"	O
plain	O
text	O
"	O
and	O
what	O
counts	O
as	O
"	O
programming	O
instructions	O
"	O
.	O
</s>
<s>
Further	O
complicating	O
this	O
distinction	O
is	O
the	O
fact	O
that	O
applications	O
that	O
support	O
programmable	O
snippets	B-Application
almost	O
always	O
include	O
support	O
for	O
recognition	O
of	O
multiple	O
programming	O
languages	O
,	O
either	O
through	O
basic	O
syntax	O
highlighting	O
or	O
execution	O
of	O
embedded	O
commands	O
.	O
</s>
<s>
For	O
these	O
and	O
other	O
reasons	O
,	O
emitting	O
plain	O
text	O
from	O
programmable	O
snippets	B-Application
almost	O
always	O
entails	O
being	O
careful	O
to	O
avoid	O
problems	O
with	O
syntax	O
and	O
delimiter	O
collisions	O
.	O
</s>
<s>
Programmable	O
snippets	B-Application
often	O
include	O
an	O
ability	O
to	O
establish	O
a	O
binding	O
to	O
an	O
existing	O
variable	B-Language
scope	I-Language
or	O
namespace	O
,	O
from	O
which	O
the	O
user	O
can	O
select	O
any	O
of	O
various	O
constants	O
or	O
variables	O
.	O
</s>
<s>
Scriptable	B-Application
snippets	I-Application
are	O
often	O
associated	O
with	O
one	O
or	O
more	O
currently	O
active	O
files	O
.	O
</s>
<s>
Scriptable	B-Application
snippets	I-Application
may	O
allow	O
execution	O
of	O
code	O
in	O
one	O
or	O
more	O
programming	O
languages	O
.	O
</s>
<s>
The	O
most	O
basic	O
alternative	O
to	O
code	B-Application
snippets	I-Application
is	O
subroutines	O
in	O
libraries	O
.	O
</s>
<s>
Subroutines	O
can	O
be	O
incorporated	O
into	O
a	O
reusable	O
software	B-Library
library	I-Library
and	O
shared	O
between	O
multiple	O
programming	O
projects	O
.	O
</s>
<s>
Design	O
patterns	O
in	O
object-oriented	O
programming	O
,	O
and	O
functional	B-Language
programming	I-Language
,	O
are	O
both	O
techniques	O
that	O
can	O
allow	O
programmers	O
to	O
avoid	O
or	O
reduce	O
the	O
practice	O
of	O
repeatedly	O
inserting	O
snippets	B-Application
into	O
different	O
pieces	O
of	O
code	O
with	O
slight	O
variations	O
each	O
time	O
.	O
</s>
<s>
In	O
languages	O
in	O
the	O
C	B-Language
family	O
,	O
preprocessors	B-General_Concept
are	O
sometimes	O
used	O
for	O
this	O
purpose	O
.	O
</s>
<s>
As	O
of	O
2021	O
some	O
sophisticated	O
deep-learning	B-Algorithm
tooling	O
emerged	O
that	O
can	O
help	O
to	O
infer	O
specific	O
functionality	O
from	O
a	O
human	O
readable	O
text	O
and	O
generate	O
corresponding	O
source	O
code	B-Application
snippets	I-Application
(	O
e.g.	O
</s>
<s>
GitHub	B-Application
Copilot	I-Application
)	O
.	O
</s>
