syntactic sugar : Java Glossary


syntactic sugar
AKA (Also Known As) sugar. In a computer language, there may be an abbreviation that lets you specify something you can also specify longhand. It will not let you specify anything new you could not do longhand. In Java the ++ and += operators could be considered syntactic sugar. In Java 8, the lambda operators could be considered syntactic sugar for anonymous inner classes. The original devisers of Java, Gosling and Joy were strongly averse to sugar. That has been somewhat relaxed recently. It a contemptuous term for language features that make life convenient for the application programmer, but which generate the same byte code as previously. The JDK (Java Development Kit) 1.5+ autoboxing feature that automatically inserts conversions back and forth between Integer and int would be an example. The for : each loop is another example. Extreme aversion to syntactic sugar is the programming equivalent of Puritanism.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number