r/ProgrammerHumor • • Feb 05 '18

StackOverflow in a nutshell.

Post image
16.2k Upvotes

1.2k comments sorted by

View all comments

Show parent comments

7

u/Nicd Feb 06 '18

It means a "syntax shortcut" sort of. An alternative syntax to write something that is faster / cleaner. Like in JavaScript default arguments function foo(a=1) {...} are basically syntactic sugar over the old way of manually checking if each argument was given and setting the proper value: function foo(a) { if (a === undefined) a = 1; ... }

5

u/[deleted] Feb 06 '18

Oh I see. I know it as shorthand syntax.