The Anatomy and Aptness of Learners Programming Language
Total Page:16
File Type:pdf, Size:1020Kb
The Anatomy and Aptness of Learners Programming Language Muhammad Shumail Naveed Dissertation submitted for the partial fulfillment of the Degree of Doctor of Philosophy Department of Computer Science Faculty of Science Federal Urdu University of Arts, Science and Technology Karachi, Sindh, Pakistan. December 2015 © Muhammad Shumail Naveed 2015 CERTIFICATE OF ORIGINAL AUTHORSHIP I, Muhammad Shumail Naveed S/O Muhammad Khurshid Zahid, certify that the work in this dissertation has not previously been submitted for a de- gree nor has it been submitted as part of requirements for a degree except as fully acknowledged with the text. I also certify that the dissertation has been written by myself and any help that I have received in my research work or in the preparation of the dissertation itself has been acknowledged. In addition, I also certify that all the information sources and literature used are indicated in the dissertation. ||||||||{ |||||||{ Signature Date APPROVED BY Supervisor Name: Dr. Muhammad Sarim Assistant Professor Department of Computer Science Federal Urdu University of Arts, Sci- ence and Technology ||||||| ||||||| ||||||| Signature Seal Date Co-supervisor Name: Dr. Kamran Ahsan Assistant Professor Department of Computer Science Federal Urdu University of Arts, Sci- ence and Technology ||||||| ||||||| ||||||| Signature Seal Date Dedicated to my parents Abstract Computer programming is a core area in computer science education. However, learning the programming is notoriously difficult and introductory programming courses are infamous to pose challenges for students. Programming involves the correct understanding of concepts, complicated syntax and the development of problem-solving techniques. It necessitates the beginning students to symbolize their concepts, requirement and method, to obtain an understanding of ideas for which they may have no previous experience, and to articulate these ideas in a prescribed method of a programming language they have never before confronted and consequently influence the high rate of failure and dropout of students in introductory programming courses. Decades of research have been devoted to diminish the problems of introduc- tory programming. Several techniques and methodologies have been proposed, but the introductory programming courses still have high dropout and failure rates. This thesis investigated the existing methods which are defined to overcome the hardness of introductory programming and establish a solution, called a learners' programming language as a zeroth programming course and inter- vened before the first programming course. The proposed solution originally aims to introduce the fundamental concepts of programming and motivates the students and consequently, prepares them for the first programming course. The proposed solution is a two-phase foundation programming course, which presents the elementary topics of programming with the graphical environment and later covers these topics with a dedicated textual language and encourages the students to work in pairs. An experimental prototype of the proposed solution is developed, and a small study was designed to evaluate the significance of the proposed solution. The study demonstrated that experts acknowledged the proposed solution as a log- ical way to prepare the novice students for the first programming course. The practical evaluation evinced the significance of the proposed solution. The stu- dents who attended the proposed course have better performance, commitment and self-perceived programming proficiency. The study demonstrated that the students opinion about the proposed solution was somewhat diverse, but the majority of students acknowledged the significance of the proposed solution. The study ultimately suggests that the learners programming language is a viable approach for preparing and motivating the students and can be very fruitful in controlling the high dropout and failure rates of the first program- ming course. Key words: Introductory programming courses, high dropouts, low retention, motivation and comfort level, syntax and semantics, educational programming languages, CS0, graphical environment, textual language, pair programming, compiler. Acknowledgements First and foremost I am very much thankful to Almighty Allah, who has given me the courage and strength to achieve this accomplishment. I would like to thank my parents for their everlasting love, encouragement, sup- port and constant prayers. In fact, words cannot state how indebted I am to my parents for all of the sacrifices that they made on my behalf. My deepest gratitude is to my supervisor, Dr. Muhammad Sarim for his con- tinual support, encouragement, guidance, enthusiasm, and immense knowledge. He patiently guided me throughout the work, and taught me much about re- search. He prompted me to write this thesis; the ideas and suggestions he has come up with have had a large influence on the direction in which the research has developed. I am also thankful to my co-supervisor, Dr. Kamran Ahsan for his valuable suggestions and support. I am especially grateful to my brother Muhammad Shakeel Azam for his love, encouragement and support. He is the person who sparked my interest in the field of computer. Furthermore, I would like to thank the University of Balochistan for providing me an opportunity to come to Karachi for research at the Department of Com- puter Science, Federal Urdu University of Science and Technology. May the Almighty Allah exquisitely bless all of you. Contents 1 Introduction1 1.1 Statement of Problem........................1 1.2 Purpose of Study...........................2 1.3 Research Questions..........................2 1.4 Outline of the Thesis.........................3 2 Background4 2.1 Introduction..............................4 2.2 Programming.............................6 2.3 Introductory Programming Courses................8 2.4 Dropout and Failure Rates in Introductory Programming Courses 10 3 Literature Review 13 3.1 Introduction.............................. 13 3.2 Natural Programming Languages.................. 14 3.2.1 NLC.............................. 14 3.2.2 Pegasus............................ 15 3.2.3 Metafor............................ 16 3.2.4 NaturalJava.......................... 16 3.2.5 SHRDLU........................... 17 3.2.6 HANDS............................ 17 3.2.7 SNAP............................. 18 3.2.8 sEnglish............................ 18 3.3 Visual Languages and Microworlds................. 19 3.3.1 Greenfoot........................... 20 i Contents ii 3.3.2 Scratch............................ 20 3.3.3 Blockly............................ 23 3.3.4 Alice.............................. 24 3.4 Visualization & Animation Tools.................. 28 3.4.1 Jeliot............................. 29 3.4.2 Visual interpreter....................... 30 3.4.3 VILLE............................. 32 3.4.4 PlanAni system........................ 33 3.4.5 EduVisor........................... 34 3.5 Flowchart Based Programming Environments........... 35 3.5.1 RAPTOR........................... 35 3.5.2 Flowgorithm......................... 36 3.5.3 ProGuide........................... 36 3.5.4 Iconic Programmer...................... 37 3.6 Mini-languages............................ 38 3.7 CS0 \Pre-programming" Courses.................. 41 3.8 Other Popular Solutions....................... 48 4 Learners Programming Language 52 4.1 Introduction.............................. 52 4.2 Learners Programming Language.................. 58 4.3 Aim and Objectives......................... 59 4.4 Course Description.......................... 60 4.5 Phase I................................ 62 4.6 Pair Programming.......................... 68 4.7 Phase II................................ 70 4.8 Dedicated Textual Language.................... 72 4.8.1 Subroutines.......................... 73 4.8.2 Data types and variables.................. 74 4.8.3 Literals............................ 75 4.8.4 Operators........................... 75 4.8.5 Assignment.......................... 76 Contents iii 4.8.6 Input/Output........................ 76 4.8.7 Selection Structure...................... 77 4.8.8 Loops............................. 78 4.8.9 Comments........................... 79 4.8.10 Error handling........................ 79 4.8.11 High level code generation.................. 80 4.8.12 Flexibility of a textual language.............. 80 4.9 Implementation............................ 81 5 Dedicated Textual Language 83 5.1 Introduction.............................. 83 5.2 Lexical Structure........................... 84 5.2.1 Regular Expression...................... 86 5.2.2 Definition of lexical structure................ 87 5.2.3 Regular Grammar...................... 89 5.3 Syntax and Grammar........................ 90 5.3.1 Context-free grammar.................... 90 5.3.2 Definition of syntax..................... 95 5.4 Semantics............................... 126 5.4.1 Attribute grammar...................... 128 5.4.2 Definition of semantics................... 129 5.5 Design of Textual Language Translator............... 138 5.5.1 Lexical analyzer....................... 140 5.5.2 Syntax analyzer....................... 148 5.5.3 Semantic analyzer...................... 163 5.5.4 Symbol table management.................. 168 5.5.5 Error handling........................ 171 5.5.6 Intermediate code generator................. 173 5.5.7 Code generator........................ 174 Contents iv 6 Experimental Prototype of Learners Programming Language