首页 | 本学科首页   官方微博 | 高级检索  
     检索      


String formatting considered harmful for novice programmers
Authors:Michael C Hughes  Ma Mercedes T Rodrigo
Institution:1. F.W. Olin College of Engineering , 1 Olin Way, Needham, MA, 02492, USA;2. Department of Information Systems and Computer Science , Ateneo de Manila University , Quezon City, Philippines
Abstract:In Java, System.out.printf and String.format consume a specialised kind of string commonly known as a format string. In our study of first-year students at the Ateneo de Manila University, we discovered that format strings present a substantial challenge for novice programmers. Focusing on their first laboratory we found that 8% of all the compilation errors and 100% of the exceptional, run-time behaviour they encountered were due to the improper construction of format strings. Format strings are a language unto themselves embedded within Java, and they are difficult for novice programmers to master when learning to program. In this article, we present exemplars of students' problematic interactions with the Java compiler and run-time environment when dealing with format strings, discuss these interactions, and recommend possible instructional interventions based on our observations.
Keywords:Novice programmer behavior  string formatting  syntax errors  BlueJ  Java
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号