正在加载图片...
$29.2 INTRODUCTORY COURSES 939 would be encouraged,at the very beginning of their training,to reason in temms of low- level mechanisms-addresses,pointers,memory,signals.They would inevitably spend much of their time,if they eventually produce a compilable program,chasing various bugs.The approach would leave the students perplexed and might end up in disaster. An introductory course must do the reverse:present the students with a clear, coherent set of practical principles.The notation must directly support these principles, ensuring a one-to-one correspondence between method and language.Any time you spend explaining the language per se is time lost.With a good language,you explain the concepts,and use the notation as the natural way to apply them. Although the main quality of an introductory language is its structural simplicity and its support of O-O ideas such as class-based modularization,design by contract,static typing and inheritance,you should not underestimate the role of syntactic clarity.C++and Java texts are replete with lines such as Examples from the public static void main(String]args basic book on.Java, if (this-fd=-1 &lopen_fd(this)) [Arnold 1996]. if ((xfrm=(char *)malloc(xfrm len 1))==NULL) showing cryptic and confusing syntax relying on many special operators.Beginners should not be subjected to such contortions,justified only by historical considerations;learning to program well is hard enough without the interposed obstacle of a hostile notation. Exceprts from post- David Clark from the University of Canberra went through this experience and ing of 15 October posted some of his conclusions on Usenet: 1996. Last semester I taught the second half of a first year programming course]using Java...My experience has been that students do not find Java easy to learn.Time and again the language gets in the way of what I want to teach.Here are some examples: The first thing they see is public static void main (String[]args)throws IOException There are about 6 different concepts in that one line which students are not yet ready to learn... You get output for "free",but have to jump through several hoops to input anything. (import,declare,initialize.).The only way to read a number from the keyboard is to read a string and parse it.Again,this is something that crops up in the first lecture. Java treats the primitive data types (int,char,boolean,float,long,...)differently from other objects.There are Object-type equivalents (Integer,Boolean,Character etc.). There is no relation between int and Integer. The String class is a special case.(Again,for efficiency.)It is only used for strings that don't change.There is a StringBuffer class for strings that do change.Fair enough.but there is no relationship between String and String Buffer.There are few features in common. The lack ofgenerics means that you are forever casting ifyou want to use a collection of elements such as Stack or Hashtable.[These things]are hurdles for beginning students,and distract them from the main learning outcomes of the course. Prof.Clark goes on to compare this experience with his practice of teaching with the notation of this book,for which,he writes,"I do virtually no language teaching beyond giving some examples of code".§29.2 INTRODUCTORY COURSES 939 would be encouraged, at the very beginning of their training, to reason in terms of low￾level mechanisms – addresses, pointers, memory, signals. They would inevitably spend much of their time, if they eventually produce a compilable program, chasing various bugs. The approach would leave the students perplexed and might end up in disaster. An introductory course must do the reverse: present the students with a clear, coherent set of practical principles. The notation must directly support these principles, ensuring a one-to-one correspondence between method and language. Any time you spend explaining the language per se is time lost. With a good language, you explain the concepts, and use the notation as the natural way to apply them. Although the main quality of an introductory language is its structural simplicity and its support of O-O ideas such as class-based modularization, design by contract, static typing and inheritance, you should not underestimate the role of syntactic clarity. C++ and Java texts are replete with lines such as public static void main(String[] args { if (this–>fd == –1 && !open_fd(this)) if ((xfrm = (char ∗)malloc(xfrm_len + 1)) == NULL) { showing cryptic and confusing syntax relying on many special operators. Beginners should not be subjected to such contortions, justified only by historical considerations; learning to program well is hard enough without the interposed obstacle of a hostile notation. David Clark from the University of Canberra went through this experience and posted some of his conclusions on Usenet: Last semester I taught the second half of a first year programming [course] using Java… My experience has been that students do not find Java easy to learn. Time and again the language gets in the way of what I want to teach. Here are some examples: • The first thing they see is public static void main (String [ ] args) throwsIOException There are about 6 different concepts in that one line which students are not yet ready to learn… • You get output for “free”, but have to jump through several hoops to input anything. (import, declare, initialize.). The only way to read a number from the keyboard is to read a string and parse it. Again, this is something that crops up in the first lecture. • Java treats the primitive data types (int, char, boolean, float, long,…) differently from other objects. There are Object-type equivalents (Integer, Boolean, Character etc.). There is no relation between int and Integer. • The String class is a special case. (Again, for efficiency.) It is only used for strings that don't change. There is a StringBuffer class for strings that do change. Fair enough. but there is no relationship between String and StringBuffer. There are few features in common. • The lack of generics means that you are forever casting if you want to use a collection of elements such as Stack or Hashtable. [These things] are hurdles for beginning students, and distract them from the main learning outcomes of the course. Prof. Clark goes on to compare this experience with his practice of teaching with the notation of this book, for which, he writes, “I do virtually no language teaching beyond giving some examples of code”. Examples from the basic book on Java, [Arnold 1996]. Exceprts from post￾ing of 15 October 1996
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有