skip to main content
10.1145/3019612.3019748acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Code Spartanization: one rational approach for resolving religious style wars

Published:03 April 2017Publication History

ABSTRACT

Spartan programming is a coding style which tries to minimize the elements of code, like in a laconic speech. In the context of code, the minimized elements of speech include lines, characters, arguments, nesting use of ifs and whiles, etc. The style is achieved by the process of repeated application of code transformation techniques, or refactoring operations, drawn from the spartan toolbox of tippers. Each tipper improves at least one of the code size metrics, without degrading any of the others. We present the unique look of spartan code, and the process of achieving it, including the three main kinds of tippers: structural, nominal, and modular. We do not make the case for the spartan style here, leaving the readers to find beauty or savageness in it. The evaluation part of this work gives evidence that the application of structural tippers contributes to the naturalness of software.

References

  1. M. Allamanis and C. Sutton. Mining source code repositories at massive scale using lang, modeling. In Proc. of 10th Working Conf. on Mining Soft. Repositories (MSR'13), pages 207--216, San Francisco, California, USA, May18--19 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. K. Arnold and J. Gosling. The JAVA Programming Language. The Java Series. Addison-Wesley, Reading, MA, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. Atwood. Spartan programming. https://blog.codinghorror.com/spartan-programming/.Google ScholarGoogle Scholar
  4. G. V. Bochmann. Multiple exits from a loop without the goto. Commun. ACM, 16(7):443--444, July 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. M. Burrows and D. J. Wheeler. A block-sorting lossless data compression algorithm. Technical Report 124, Digital Systems Research Center, May 10 1994.Google ScholarGoogle Scholar
  6. L. Clark. A linguistic contribution to goto-less prog. Commun. ACM, 27(4):349--350, Apr. 1984. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. E. W. Dijkstra. Letters to the editor: Go to statement considered harmful. Commun. ACM, 11(3):147--148, Mar. 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. A. Donovan and B. W. Kernighan. The Go Programming Language. Addison-Wesley Professional, Nov. 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. Ege, Raimund Singh and B. Meyer. Proceedings of the technology of object-oriented languages 26. In Proceedings of the Technology of Object-Oriented Languages 26, TOOLS '98, 1998.Google ScholarGoogle Scholar
  10. J. Y. Gil and G. Lalouche. When do soft, complexity metrics mean nothing? ---when examined out of context. Journal of Object Technology, 15(1):2:1--25, 2016.Google ScholarGoogle ScholarCross RefCross Ref
  11. Y. Gil, M. Goldstein, and D. Moshkovich. How much information do soft, metrics contain? In Proc. of the 3rd ACM SIGPLAN Workshop on Evaluation and Usability of Prog. Lang, and Tools, PLATEAU '11, pages 57--64, New York, NY, USA, 2011. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Y. Gil and G. Lalouche. On the correlation between size and metric validity. Empirical Soft. Eng., 2016.Google ScholarGoogle Scholar
  13. W. G. Griswold, M. I. Chen, R. W. Bowdidge, J. L. Cabaniss, V. B. Nguyen, and J. David Morgenthaler. Tool support for planning the restructuring of data abstractions in large systems. IEEE Trans. Softw. Eng., 24(7):534--558, July 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. A. Hindle, E. T. Barr, Z. Su, M. Gabel, and P. Devanbu. On the naturalness of soft. In Proc. of the 34th Int. Conf. on Soft. Eng., ICSE '12, pages 837--847, Piscataway, NJ, USA, 2012. IEEE Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In Proc. of the 27th Conf. on Soft. Eng., ICSE '05, pages 117--125, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Jbara and D. G. Feitelson. On the effect of code regularity on comprehension. In Proc. of 22nd Int. Conf. on Program Comprehension (ICPC'14), pages 189---200, June2--3 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. P. Jones. Haskell 98 Language and Libraries: The Revisited Report. Cambridge University Press, 2003.Google ScholarGoogle Scholar
  18. D. E. Knuth. Structured programming with go to statements. ACM Computing Surveys (CSUR), 6(4):261--301, Dec. 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. K. J. Lieberherr. Adaptive Object-Oriented Software: The Demeter Method with Propagation Patterns. PWS-Kent Publishing, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Lutz. Programming Python. O'Reilly, first edition, Oct. 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. L. Ramshaw. Eliminating go to's while preserving program structure. Journal of the ACM, 35(4):893--920, Oct. 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. E. Sennesh and Y. Gil. Structured gotos are (slightly) harmful. In Proc. of the 31st Annual ACM Symposium on Applied Computing, SAC '16, pages 1784--1789, 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Wirth. The programming language Pascal. Acta Informatica, 1:35---63, 1971. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. W. A. Wulf. A case against the GOTO. In E. N. Yourdon, editor, Classics in Soft. Eng., pages 83---98. Yourdon Press, Upper Saddle River, NJ, USA, 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. F. Zhang, Q. Zheng, Y. Zou, and A. E. Hassan. Cross-project defect prediction using a connectivity-based unsupervised classifier. In Proc. of the 38th Int. Conf. on Soft. Eng., ICSE '16, pages 309--320, New York, NY, USA, 2016. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. T. A. Zoethout and E. I. N. Stein. Why the Goto is harmful. SIGPLAN Not., 14(11):116--122, Nov. 1979. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Code Spartanization: one rational approach for resolving religious style wars

                    Recommendations

                    Comments

                    Login options

                    Check if you have access through your login credentials or your institution to get full access on this article.

                    Sign in
                    • Published in

                      cover image ACM Conferences
                      SAC '17: Proceedings of the Symposium on Applied Computing
                      April 2017
                      2004 pages
                      ISBN:9781450344869
                      DOI:10.1145/3019612

                      Copyright © 2017 ACM

                      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                      Publisher

                      Association for Computing Machinery

                      New York, NY, United States

                      Publication History

                      • Published: 3 April 2017

                      Permissions

                      Request permissions about this article.

                      Request Permissions

                      Check for updates

                      Qualifiers

                      • research-article

                      Acceptance Rates

                      Overall Acceptance Rate1,650of6,669submissions,25%

                    PDF Format

                    View or Download as a PDF file.

                    PDF

                    eReader

                    View online with eReader.

                    eReader