5 ms·
> but the amount of needless bashing it gets here is astonishing I don't think it's needless. I'll bash Java as long as it's the language for AP computer scien
by ModernMech 5y ago
> but the amount of needless bashing it gets here is astonishing
I don't think it's needless. I'll bash Java as long as it's the language for AP computer science. Imagine a budding young programmer, bright eyed and bushy tailed, eager to get into computer science. They get to class and greet the teacher "Welcome class, let's learn about Java. There's a wide world of computers out there, but your perception of computing will be that Computing <-> Java until maybe the sophomore year of college. Have fun!"
Students come to me their sophomore year of college completely awestruck. "I had not idea! I thought programming was all Java!" they tell me. Imagine that. Close your eyes and picture a world where all of programming is Java programming. How quick did you open them and splash water on your face to wake rid yourself from that nightmare?
Java is singlehandedly responsible for snuffing the dream of so many young programmers. I've seen it in my own research, where kids in elemntary and middle school describe programming as fun, interesting, and challenging. That's because at this age they're using fun languages like Blockly, and they spend their time programming making and playing games.
Then they get to AP computer science and they are introduced to Java. Perceptions of programming fall through the floor, with more students calling it difficult, frustrating, and scary. It's tragic what Java is doing to young people.
Like, I understand we want students to have skills they will use in business, but we can't present programming to them as if all of programming is OOP enterprise development in Java. It's a crying shame.
- hulitu 5y agoTell that to Google.
- baud147258 5y ago> "I thought programming was all Java!" If students get this preconception, I think it's more an issue how they are taught, not an issue with Java itself. I mean the first language I learned and most of my classes were in Java, but that didn't prevent me from knowing there other existing languages and learning about them.
- baud147258 5y agothough, on retrospect, I can admit that Java might not be the best language to learn programming
- mahesh-hegde 5y agoTeaching Java in abstract, useless lessons about OOP and inheritance is definitely bad. But I would say Java is as good a first language as python is. The purpose of first programming language is teaching concepts - functions, structs / classes, abstraction, data structures (importantly lists and maps); And how to solve problems using that. Python does well in intuitive syntax for lists/maps, handy standard library functions, and having an REPL; But it gives an illusion that types are redundant. The programmer picking up C++ or Java after python sees only ceremony. You can also learn the modern java without all the OOP shoved in: Basic programs, functions, data types, arrays, using classes to create custom types, using HashMap, ArrayList, HashSet from standard library; then interfaces, inheritance / subtyping, lambda functions. Use jshell to try small snippets; The problem with teachers teaching java is that they focus too much on inheritance, with mostly superficial examples like "dog extends animal" instead of something in real world. Inheritance is mostly about subtyping, and any CS student with enough math background should not struggle to understand that.
- blarg1 5y agoI still have nightmares from back then.
- dchftcs 5y agoThat's not the fault of the language, though I'd say maybe Kotlin is a considerably better choice nowadays. If by blockly you mean the visual interface, what you said is going to be true for any language. If by blockly you mean javascript, maybe, but honestly if it's an exercise to build foundations (and not just for personal gratification), javascript (or python) isn't much easier for kids than Java, because it has more footguns. And if there's any fault in the language chosen for AP computer science, the blame should go to the designer of the curriculum.
- ModernMech 5y ago> And if there's any fault in the language chosen for AP computer science, the blame should go to the designer of the curriculum. Java was recommended for AP CS 22 years ago. At this point I lay less fault at their feet and I'm more interested in why it's still there at long last. > If by blockly you mean the visual interface, what you said is going to be true for any language. My research isn't published yet but I've found this is not necessarily true. This is a product of taking a thing not built for kids but rather professional programmers, and then forcing kids to use it. The problem with Java is that it's the kind of system where you need to know everything about it to use it all. Going from 0 to "hello world" requires over a dozen distinct Java concepts explained. public class MyFirstJavaProgram { public static void main(String []args) { System.out.println("Hello World"); } } We've got access modifiers, classes, scopes, lifetimes, variable types, void variables, methods and in particular the main method, String types, arrays of strings, input arguments to main method, the System class, output streams, function calls, string literals, and to top it all off a good old fashioned statement terminator as the cherry on top of that feature sundae. The great irony is that the AP Computer Science Ad Hoc Committee call this behemoth "simple". That's lesson one, and all it gets you is "Hello World". Most instructors handle this as "Ignore all the things you're writing down, we'll talk about them over the course of the next 3 months." Because that's how long it really takes. This leaves students in a perpetual state of confusion, where they feel like they never really understand what's going on. Everything is a mysterious incantation and nothing really makes sense. Do wrong thing and it tells you it's wrong, but you won't understand why. Students spend a lot of time memorizing "static void pub main()"... or was it public void static main? Or static public void class? I dunno, let's consult the spellbook. Because on day one their instructor said "ignore all of that, it's too complicated for you." Well students do ignore all of that, and it teaches exactly the wrong lesson -- they don't learn Java or programming, they learn that programming is hard and not for them yet. It's beyond them, but they're going to do it, and maybe one day they will understand, but not today. Today just write the code and run it. At this point, most students give up. And I will say that yes, this is Java's fault. Not all programming languages require you to learn a dozen very deep and nuanced concepts to get to "Hello World". Here's the ideal Hello World program for students and honestly for me too: "Hello World" That's it. That's the ideal. You get that in languages like Matlab, and I've had great success teaching robotics using Matlab. With Matlab, students are writing real robot programs within a few hours, whereas with Java students are still raising their hand asking "Wait, so what's the difference between an object and a class? What's a method versus a function? What's static mean? What does void mean? What does []args mean?" It's my contention that the design of the Java language frequently turns away all but the most technically minded students at precisely the time when they are the most impressionable when it comes to their perceptions of computing, and we're all worse off for it.
- fomine3 5y agoAgree, but recently Minecraft mod (written in Java) is a popular way how to learn code with joy.
- bee_rider 5y agoWe switched to Python at my school. Not sure how I feel about Python (or Java) as a first language. Something a bit lower like C would be a better foundation, IMO.
- tkot 5y agoPython is definitely simpler to start with but it doesn't expose the beginners to some concepts directly - interfaces are implicit because of duck typing (unless you use the ABC module), everything is public (underscores are just a convention), there is no method overloading etc. I think it might be more valuable to expose beginners to static typing because it's much easier to transition from "objects have distinct types" to "pretty much everything is just a hashmap" than the other way around. The thing about C as a first language is that you need to not only learn what programming is but you also need to learn manual memory management which raises the bar significantly and it's pretty easy to write code that fails for reasons which are difficult for a beginner to figure out (like segfaults).
- auggierose 5y agoThere are books like "Java in Two Semesters: Featuring JavaFX" [0], which appears in the series "Texts in Computer Science"! Now, that series used to be called "Graduate Texts in Computer Science", until they dropped the Graduate to allow for books like these, I guess. And even "Undergraduate" would have been an oversell. Actually, "Computer Science" still is. [0]: https://link.springer.com/book/10.1007/978-3-319-99420-8 https://link.springer.com/book/10.1007/978-3-319-99420-8
- pjmlp 5y agoIf people are afraid of programming languages, then they should go to the psychologist. Sounds harsh? Not at all. Programming languages are a letters on a digital paper, they don't steal and rape people on dark corners, or beat them to death.