java的问题
“Welcome students, to your first ever day of computer science! This is going to be a fascinating year, and I cannot wait to teach you all about one of the most relevant topics in the world today. Teaching computer science is my passion, and although all of you may not go on to be computer scientists, I do hope to instill you with deeper understanding of why computer science is so powerful. I hope that wherever you end up, you find a way to use it for the better.
“欢迎您,来到您的计算机科学的第一天! 今年将是令人着迷的一年,我迫不及待地要教大家有关当今世界上最相关的主题之一。 教授计算机科学是我的激情,尽管你们所有人都可能不再继续担任计算机科学家,但我希望向您灌输对计算机科学为何如此强大的深入理解。 我希望无论您最终到哪里,都可以找到一种更好地使用它的方法。
Of course, today is just the first day, and we will start slowly. You will write your first ever program in Java! The learning goals for today are directly related to the program. They are as follows:
当然,今天只是第一天,我们将慢慢开始。 您将用Java编写您的第一个程序! 今天的学习目标与该计划直接相关。 它们如下:
Understand different input and output types for functions 了解功能的不同输入和输出类型 Understand how to read input from the command line 了解如何从命令行读取输入 Differentiate between primitive and reference types in Java 在Java中区分原始类型和引用类型 Manipulate and work with arrays in Java 在Java中操作和使用数组 Understand the programming paradigm known as object-oriented programming: Why do we make a function public? Why do we make it private? What is the difference between a static function and a non-static function? What is dot notation? 了解称为面向对象编程的编程范例:为什么我们要公开一个函数? 为什么我们将其设为私有? 静态函数和非静态函数有什么区别? 什么是点符号?The first lab is linked on the course website. Good luck!”
第一个实验室链接在课程网站上。 祝好运!”
Our teacher above (let’s call him Mr. Bit) seems wonderful at first. He is clearly excited about the topic and cannot wait to share his love for computer science with his students. Passion, after all, is an essential component of good teaching. Mr. Bit’s excited demeanor might even take some of us back to our own first computer science classes.
我们上面的老师(我们叫他比特先生)乍一看似乎很棒。 他显然对该主题感到兴奋,迫不及待想与他的学生分享对计算机科学的热爱。 毕竟,激情是良好教学的重要组成部分。 比特先生兴奋的举止甚至可能使我们中的一些人回到我们自己的第一门计算机科学课。
But then, things take a curious turn. Most, if not all, computer science educators would agree that the Mr. Bit’s lesson plan is a bit flawed. The learning goals intended for the first day of an introductory class — for the first exposure these students have ever had to code — are utterly ridiculous. For starters, these students likely do not even know what the command line is — how are they supposed to understand how to work with it? Additionally, arrays are a fairly involved topic, and usually don’t appear until Week 3 or 4 of an introductory class. And finally, an entire course could be structured around the minute and obscure details of object-oriented programming; stuffing it into a single day (the first day, in particular) is just foolish. It might be fun for the Mr. Bit, but that does not make it best for the students.
但是随后,事情发生了奇怪的转变。 大多数(如果不是全部的话)计算机科学教育家都同意Bit先生的课程计划有点缺陷。 入门班第一天的学习目标(对于这些学生曾经编码的首次接触)是完全荒谬的。 对于初学者来说,这些学生可能甚至不知道命令行是什么-他们应该如何理解如何使用命令行? 此外,数组是一个相当复杂的话题,通常在入门课程的第3周或第4周才出现。 最后,整个课程可以围绕面向对象的编程的细节进行细化和细化。 将其填充到一天(尤其是第一天)中是愚蠢的。 这对Bit先生来说可能很有趣,但这并不能使它最适合学生。
And yet, educators across the nation continue to teach this way year after year, semester after semester. How, you might ask? Well, take a hard, long look at the following:
然而,全国各地的教育工作者们每年又一个学期继续以这种方式进行教学。 您可能会问如何? 好吧,仔细看看下面的内容:
public class Main { public static void main(String[] args) { System.out.println("Hello, World!"); }}Look familiar? I thought so. The famous “Hello World” program, used since the beginning of time (or, er — computer science times) to welcome new seekers of knowledge into the field. Study it closely, and you will see that to really, deeply understand what is happening in the above program, one needs to have a solid grasp of each of the learning goals outlined above. Sure, students can be made to write the program, but what are they really learning? Aside from the temporary excitement of seeing the words “Hello, World!” printed to standard output, they will gain nothing.
看起来熟悉? 我是这么想的。 著名的“ Hello World”程序自开始(或计算机科学时代)开始就用于欢迎新的知识寻求者。 仔细研究,您会发现,要真正深入地了解上述程序中发生的事情,您需要对以上列出的每个学习目标都有扎实的了解。 当然,可以强迫学生编写程序,但是他们真正学到了什么? 除了看到“ Hello,World!”一词的短暂兴奋之外 打印到标准输出,它们将一无所获。
That is the fundamental problem with Java — even the simplest program requires one to possess mastery over several programming concepts that routinely trip up even experienced coders.
这是Java的根本问题-即使是最简单的程序,也需要一个人掌握一些编程概念,而这些编程概念通常会使经验丰富的编码人员感到困惑。
Don’t get me wrong. I’m not hating on Java — it is an extremely powerful language whose object-oriented structure makes it ideal for solving many problems. The problem is not inherent to the language itself — rather, it is entirely contextual. Remove Java from introductory computer science classes, and the problem ceases to exist.
不要误会我的意思。 我并不讨厌Java,它是一种功能非常强大的语言,其面向对象的结构使其非常适合解决许多问题。 问题不是语言本身固有的,而是完全与上下文相关的。 从入门的计算机科学课程中删除Java,该问题不再存在。
Java simply has too many particularities for it to be used as an initial exposure to programming. From the very first program they write, students are implicitly encouraged to write code without truly understanding what it does — a recipe for disaster. By nature of its structure, Java teaches advanced topics such as reference pointing and object-oriented programming prematurely, before students have a solid grasp on more fundamental concepts such as variables and functions. It perpetuates a cycle of coders growing used to its unique object-oriented style and failing to appreciate other, equally valid ways to program.
Java只是具有太多的特殊性,无法用作编程的初始工具。 从他们编写的第一个程序开始,就暗中鼓励学生编写代码,而不真正了解它的作用-灾难的秘诀。 根据其结构的性质,Java在学生对变量和函数等更基本的概念没有扎实的了解之前,会过早地教授高级课程,例如引用指向和面向对象的编程。 它使编码人员逐渐习惯于其独特的面向对象样式,并且无法欣赏其他同样有效的编程方式,从而使这种情况永存。
Java is quite well-suited to certain programming tasks, but this very characteristic is what makes it a poor choice for a first language. Its intricate features and unique structure should be reserved for more experienced programmers who have already internalized the basic tenets of good programming.
Java非常适合某些编程任务,但是这种特性使它成为第一语言的不佳选择。 它的复杂功能和独特的结构应该保留给已经内置了良好编程基本原则的更有经验的程序员。
In contrast to the complicated code snippet above, consider the “Hello World” program in Python (my preferred choice for an introductory language):
与上面复杂的代码段相反,请考虑使用Python中的“ Hello World”程序(我是入门语言的首选):
print(“Hello, World!”)Pretty simple, right? It doesn’t contain any weird syntax or class declarations, and therefore avoids instilling into students any preconceived notions about the nature of programming. Students can write the program and then gently be guided into introductory topics meant to ease them into the world of computer science. Python reads similarly to English and contains minimal syntactical quirks, but it still allows students to program in powerful ways.
很简单,对吧? 它不包含任何怪异的语法或类声明,因此避免向学生灌输关于编程本质的任何先入为主的概念。 学生可以编写程序,然后轻轻地引导他们进入介绍性主题,以使他们轻松进入计算机科学领域。 Python的阅读方式与英语相似,并且包含最少的语法怪异,但它仍然允许学生以强大的方式进行编程。
Nearly all programmers agree that a needlessly complicated approach to any programming problem is a bad one. Well, in a bit of an abstract sense, I would argue that the problem of effectively teaching computer science is certainly an important one. As an analogy, consider how humans develop natural language skills. Children are taught the specific rules of grammar only after they can already understand basic verbal communication. In the initial phases of learning, semantics is more important than syntax. When it comes to teaching programming, the same principle should apply.
几乎所有的程序员都认为,解决任何编程问题的不必要的复杂方法是不好的。 好吧,从某种抽象的意义上讲,我认为有效地教授计算机科学的问题无疑是一个重要的问题。 作为类比,考虑人类如何发展自然语言技能。 只有在他们已经了解基本的言语交流之后,他们才会被教给孩子语法的特定规则。 在学习的初始阶段, 语义比语法更重要。 在教授编程时,应遵循相同的原则。
I once had a professor who complained of his graduate student instructors:
我曾经有一位教授抱怨他的研究生导师:
“They just need to realize that teaching is about instilling important, foundational concepts into their students — not simply emphasizing topics they themselves enjoy while glossing over what students may most need.”
“他们只需要意识到教学是在向学生灌输重要的基础概念, 而不仅仅是在强调学生自己最需要的知识的同时强调他们自己喜欢的主题。 ”
Java may have a lot of cool features, but that doesn’t mean it focuses on what students most need. An initial programming language should underscore simplicity and ease of understanding. Said another way, students should be able to learn all about variables, functions, algorithms, for-loops, and other foundational topics without being hindered by missing semicolons and extra braces.
Java可能具有许多很酷的功能,但这并不意味着它专注于学生最需要的东西。 最初的编程语言应强调简单性和易于理解性。 换句话说,学生应该能够学习有关变量,函数,算法,for循环和其他基础主题的所有知识, 而不会因缺少分号和多余的括号而受到阻碍。
And therefore, for this problem in particular, the solution is not Java.
因此,特别是对于这个问题,解决方案不是 Java。
翻译自: https://medium.com/the-innovation/the-problem-with-java-227a6bbfbe69
java的问题