📜 ⬆️ ⬇️

The dangers of learning in Java

"You're lucky. We lived for three months in bags of sackcloths in dirty sheds. We got up at six in the morning, washed the bags, ate crust of stale bread and went to work at the mill, 14 hours a day, from Monday to Sunday, and when we got home, our dad smacked us with his belt ”
- Monty Python's Flying Circus, Four Yorkshire


Lazy youth.

What can be good in hard work?
')
A sure sign of my aging is my grumbling and complaints about the “modern youth” and about how they do not want or can no longer do anything complicated.


When I was young, I learned to program on punch cards. If you accidentally made a mistake, you didn’t have such a “modern opportunity” how to press the backspace key and re-enter what you need. You had to throw out the card and start typing again.

When I started interviewing programmers in 1991, I usually allowed them to use any programming language to solve my encoding problem. In 99% of cases, they chose C.

These days they usually choose Java.

Don't misunderstand me: there is nothing wrong with using Java as a working language.

Wait a minute, I want to change this statement a little. I am not saying in this single article that there is something wrong with using Java as a working language. There is a lot of wrong in this, but it will wait until another article.

Instead, I want to say that Java is generally not complex enough to separate excellent programmers from mediocre ones. Maybe this is a great language for work, but today is not about that. I can even go so far as to say that the fact that Java is not complicated is a feature, not a bug, but this leads to this problem.

This may sound a bit harsh, this is just my humble opinion, but there are two things that computer science ( CS ) has traditionally been taught at universities and that many people never fully truly understand: pointers and recursion.

At the very beginning of college, you take a course in data structures, with linked lists, hash tables and other little things, with extensive use of pointers. Such courses are quite often used as dropout courses: they are so complex that everyone who does not have the mental abilities necessary for CS is abandoned, and this is very good, because if you think that pointers are difficult, then wait until you have to prove the facts of the theory of a fixed point.

All those young geniuses who wrote high-school ping-pong for Apple II in high school go to colleges, choose CompSci 101, a course in data structures, and when faced with working with pointers, their brains just explode and they decide to transfer. on political science, because now the law school seems to them the best choice. I’ve seen screenings of students from CS courses many times, and usually the dropout rate ranges from 40% to 70%. Universities tend to think this is a waste; I think that this is simply a necessary natural rejection of people who simply cannot be happy or successful in a programmer’s career.

Another challenge for many students was a course in which functional programming was studied, including recursive programming. The Massachusetts Institute of Technology had a very high level for these courses, developed a compulsory course (6.001) and a textbook (Abelson and Sassman, Structures and Interpretation of Computer Programs ( Abelson & Sussman's Structure and Interpretation of Computer Programs) ) that are used by dozens or even hundreds of the best CS schools as a de facto standard for CS introduction courses.

The complexity of these courses is simply overwhelming. In the first lecture, you study Scheme in its entirety, and now you can be introduced to fixed-point functions that use other input functions. When I was able to overcome such a course, CSE121 at the University of Pennsylvania, I saw how many, if not most, students could not do it. The stuff was too complicated. I e-mailed to Professor a long letter full of sobs, stating that It is Just Unfair. Someone at the university must have heard me (or one of the other complainants), because now they are learning Java in this course.

Now I would prefer not to be heard.
Think you know what it is? Check Yourself Here!

This is the subject of controversy. Years of whining lazy students like me, combined with complaints from the software industry about how few American universities have graduated from CS, have done their job, and over the past decade many irreproachable schools in the rest have switched 100% to Java. And this was welcomed: for recruiters who use “grep” to evaluate resumes (note: grep is a program in Unix that allows you to select lines that have the right word ), this seems to be pleasant, and, best of all, in Java There is nothing complicated enough to really weed out programmers without that part of the brain that is responsible for pointers or recursion, respectively, the level of screening in universities decreases, CS faculties produce more students, get more money for it, and everything becomes good.

Happy students of Java schools will never encounter horrible segfault (approx. Segmentation Fault is a typical error when accessing an incorrect address ) when trying to implement pointer-based hash tables. They will never make mad, crazy attempts to pack something into bits. They will never load their heads with thoughts about how in fully functional programs the value of a variable never changes, and yet it constantly changes! Paradox!

They do not need this part of the brain to get a red diploma.

Am I just one of those old-fashioned grumblers, like the Four Yorkshiremen, who brag about how hard it was to live in the harsh old days?

Hey, in 1900 Latin and Greek were compulsory subjects in college, not because they were somehow necessary in life, but because their knowledge was one of the obligatory attributes of an educated person. In a sense, my arguments are no different from the arguments that Latin proponents gave (all four). “[Latin] trains your mind. Trains your memory. Unraveling sentences in Latin is a great mind exercise, a real intellectual puzzle, and a good introduction to logical thinking, ”wrote Scott Barker. But I could not find a single university that still teaches Latin without fail. Are pointers and recursion really Latin and Greek computer science?

So, I can easily agree that programming with pointers is not necessary today in 90% of code development, and even presents a danger in industrial code. Yes. Perfectly. And functional programming is not so often used in practice. I agree.

But it is still important for some of the most amazing software development. For example, without pointers you can never work on the Linux kernel. You cannot understand a single line of Linux code or any operating system without a real understanding of the pointers.

Without an understanding of functional programming, you cannot come up with MapReduce, an algorithm that makes Google so well scalable. The terms Map and Reduce come from Lisp and functional programming. MapReduce is understandable to anyone who remembers from his course equivalent to 6.001 that truly functional programs have no side effects and therefore are easily parallelizable. Very indicative is the fact that MapReduce was invented at Google, but not at Microsoft, and this says something about why Microsoft is still playing catch-up, trying to make the main functions of the search engine work, while Google went to next problem: building Skynet , the world's greatest parallel supercomputer. I do not think that Microsoft really understands how far behind they are.

But even far from tasks where the importance of pointers and recursion is obvious, their real significance lies in the fact that creating large systems requires the flexibility of the brain that you get when you study them, and the capabilities of the brain that you needed in order not to fly out. off course during training. Pointers and recursion require certain abilities from a person: to reason, to think abstractly, and, most importantly, to see the problem on several levels of abstraction at the same time. Therefore, the ability to understand pointers and recursion is directly related to the ability to be a great programmer.

Nothing in Java-based education eliminates students because of the lack of flexibility of their brains to understand these concepts. As an employer, I see that 100% -Java schools started churning out CS graduates, some of whom are simply not smart enough to work as programmers with something more sophisticated than One More Accounting Application In Java, although they managed the creak of the "modern-simplified-for-stupid" term paper. These students would never have mastered 6.001 at Massachusetts Technology, or CS 323 at Yale, and frankly, this is the reason why, from an employer’s point of view, a Massachusetts Technology or Yale diploma has more weight than Duke’s diploma, who recently became Fully-In-Java, or Penn University, who replaced Scheme and ML with Java, trying to teach a course that almost killed me and my friends, CSE121. It's not that I don't want to hire smart guys from Duke or Penn — I hire them — it's just harder for me to understand who they are. Previously, I could say that a guy is really smart, if he can figure out a recursive algorithm in a few seconds, or he implements functions that manipulate linked lists based on pointers, as fast as he can write on a piece of paper. But in the case of Java graduates, I cannot say whether the applicant has problems with these tasks, because he simply lacks the appropriate education, or because he does not have the appropriate part of the brain necessary for excellent work as a programmer. Paul Graham calls them Mount Programmers.

It's bad enough that Schools-on-Java do not screen out those who can never become great programmers, but schools can rightly say that this is not their problem. The industry, or at least the “recruiters-using-grep” ones, really require schools to teach Java.

But "Java-only schools" also stopped training students' brains so that they become knowledgeable, agile, and flexible enough to design programs well (and I don’t mean object-oriented "design" when spend countless hours rewriting your own code when rebuilding your object hierarchy, or suffer from such fake “problems” as choosing “contains” or “is” (example: has-a vs. is-a, choosing between inheritance and class composition )). Training is needed to learn how to think on several levels of abstraction at the same time, which is absolutely necessary for designing an excellent software architecture.

You may be wondering if learning about object-oriented programming (OOP) can be a good substitute for pointers and recursion as scrubbing courses. The short answer is no. Without discussing the virtues of OOP, one can simply say that it is not difficult enough to screen out mediocre programmers. Teaching OOP consists mainly of memorizing several vocabulary terms such as “encapsulation” and “inheritance” and learning the answers to many questions about the difference between polymorphism and overloading operations. No more difficult to memorize significant dates and names in history lessons, the PLO poses an inadequately simple task in order to scare away freshmen. When you have problems with OOP, your program still works, it just becomes difficult to support. Allegedly. But when you have problems with pointers, your program issues a Segmentation Fault, and you have no idea what's going on until you stop, take a deep breath and actually try to get your mind to work on two levels of abstraction at the same time. .

Recruiters-using-grep, by the way, are ridiculed here, and there are good reasons for this. I have never been familiar with someone who understands Scheme, Haskell, and C pointers, and could not learn Java in a couple of days, and after that write Java code better than people who have five years of experience with Java, but try to explain this is the average HR biorobot.

What about the mission of the CS faculties? This is not a vocational school! Their job is not to prepare people for work in industry. This is only for community colleges, they will tell you (note: there is a two-year college in the USA that trains specialists with average qualifications to work in the local community ) and government retraining programs for laid-off workers. They are supposed to provide students with the fundamental tools to live their lives, rather than preparing them for the first days of work. Right?

Yet. CS is evidence (recursion), algorithms (recursion), languages ​​(lambda calculus), operating systems (pointers), compilers (lambda calculus) - and as a result we get that schools-to-Java that do not teach C and not teach Scheme, in fact, do not teach computer science. How useless is it in the real world to understand the concept of currying (note: in functional programming, generating from one function another function with fewer arguments; for example, from f (x, y) = x * y) getting the function f3 (x) = f (x, 3 ) = 3 * x) , so it is also a necessary prerequisite for higher education in the field of CS. I do not understand why professors in committees who approve college programs allow their programs to become so stupid that they not only cannot prepare programmers who are ready for work, they cannot even prepare graduates who could receive a PhD degree ( approx .: analogue candidate of science ) and compete with them for jobs. No, wait. Forget it. Maybe I still understand.

Indeed, if you come back and study the discussions that took place in academic circles during the Great Java Transition, you will notice how much interest you might have in asking if Java is simple enough to use it as an educational language.

“My God,” I thought, “they tried to dull the course even more!” Why not feed all the students with a spoon? Why would the teachers themselves not do the tests for them - then surely no one will go on to the humanities! How is it supposed to teach someone something if the course is carefully designed to become even simpler than it is now? It seems that the task is to make an effort (PDF) to develop a simple subset of Java, designed for students to study, release simplified documentation, which carefully hides all this EJB / J2EE garbage from their delicate brains so that they don’t disturb their tiny heads with any other classes except those that are needed in order to solve the standard simplest set of tasks for the course.

The most sympathetic explanation of why CS faculties so enthusiastically stupefied their courses is that they will have significantly more time to study current CS concepts, unless they have to spend two lectures to explain the difference between, say, int and integer in java. Well, if this is the only case, 6.001 is a great answer for you: the Scheme language is so simple that the whole language can be told to intelligent students in about ten minutes; after that you can spend the rest of the semester on fixed points.

Fuh.

I go back to ones and zeros.

(Do you have ones? Lucky bastard! All we had was zeros.)

the end
Translator: Ilya Bolodurin

The article is long-standing, but "hooked."

Upd
In the comments, many asked to voice their own opinions, and not stupid copy-paste articles. Answered

Source: https://habr.com/ru/post/122665/


All Articles