Abstract
Syntactic sugar is introduced to existing programming languages to improve their readability and brevity. There have been many debates about pros and cons of using syntactic sugar. However, it is now an integral part of programming languages. No existing work studies the usage of syntactic sugar in real-world software development. In order to fill this gap, we conducted the first empirical study to examine the usage of syntactic sugar in 20 open source software projects written in either Java or C#. Our study results show that syntactic sugar is generally used more than an corresponding feature in the wild, but there may be a limit to what syntactic sugar cannot replace an corresponding feature completely. In this paper, we make several suggestions as to why this occurs.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsPreview
Unable to display preview. Download preview PDF.
References
Foreach, in Visual Studio .NET (2003), http://msdn.microsoft.com/en-us/library/ttw7t8t6v=vs.71.aspx
Foreach loop, http://en.wikipedia.org/wiki/Foreach_loop
The For-Each Loop, http://docs.oracle.com/javase/1.5.0/docs/guide/language/foreach.html
Myers, J., Well, A., Lorch, R.F.: Research Design and Statistical Analysis, 3rd edn. Routledge Academic (2010)
Parnin, C., Bird, C., Murphy-Hill, E.R.: Java generics adoption: how new features are introduced, championed, or ignored. In: MSR 2011: Proceedings of the 8th International Working Conference on Mining Software Repositories, pp. 3–12 (2011)
Perlis, A.J.: Epigrams in programming. ACM’s SIGPLAN Publication (September 1982)
Skeet, J.: C# in Depth, 2nd edition. Manning Publications, Stamford, CT 06901 (2010)
using Statement, http://msdn.microsoft.com/en-us/library/yh598w02v=vs.80.aspx
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2014 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kim, D., Yi, G. (2014). Measuring Syntactic Sugar Usage in Programming Languages: An Empirical Study of C# and Java Projects. In: Jeong, H., S. Obaidat, M., Yen, N., Park, J. (eds) Advances in Computer Science and its Applications. Lecture Notes in Electrical Engineering, vol 279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-41674-3_40
Download citation
DOI: https://doi.org/10.1007/978-3-642-41674-3_40
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-41673-6
Online ISBN: 978-3-642-41674-3
eBook Packages: EngineeringEngineering (R0)