17 ms·
I think a better alternative would be "Don't Make Students Use Java", I seriously can't think of a worse language for training beginner/intermediate programmers
by 0_gravitas 7y ago
I think a better alternative would be "Don't Make Students Use Java", I seriously can't think of a worse language for training beginner/intermediate programmers, I certainly wish my schooling experience consisted of something else. From day one you're introduced to magic on top of magic: "Open up <IDE> and click 'new project' and name it 'MyProj' and now click on the file in the side menu that says 'MyProj' and inside `public static void main(String args[]){}` inside the `public class MyProj{}` write `System.out.println("Hello World")` and go to the top bar and hit 'Run' and then 'Hello World' will appear in the integrated console, ah, programming!"
And you don't even begin to grasp what all those steps you just took in the IDE did until you're at least 1+ years in, and you don't learn what all of those magic words even remotely mean by at least halfway into your second semester.
I felt like every single thing I ever did was magic, never having a clue why it ever actually worked the way it did, and as a result nearly dropped out. The only time things _finally_ started to make sense is when I got to Computer Architecture/Organization with MIPS followed by some work in C.
- ardit33 7y agofor very beginners, yes... Java is not the right programing language to teach. (I'd say Python is). But for intermediate/advanced classes I think Java is a must learn for every CS graduate. 1. While it is bloated, it has so many modern and not so modern concepts into it, that learning it makes you understand those concepts better. (eg: It is hard to understand Generics if your favorite language doesn't have them) 2. A lot of enterprises (and major tech) backends still run on Java. I thin knowing it is a must to be competitive in the job market as a fresh grad 3. Learning Java (and probably disliking it) it will make you appreciate and perhaps make you better at learning other more nimble languages (aka. GoLang and friends)
- 0_gravitas 7y agoI don't particularly agree with the first two but I can WHOLLY agree on the third, in fact, I think I blame Java for my infatuation with FP
- shadowCensor 7y agoPython is perfect for learning programming logic. Wouldn't have wanted it any other way.
- fishmaster 7y agoNope, it's only slightly better than java. Lisps and MLs are objectively better when it comes to teaching Cs materials.
- shadowCensor 7y agoNope.
- bokwoon 7y agoIt’s kind of embarrassing but I didn’t understand generics from my beginner CS course (taught in Java). It wasn’t actively tested on either. I only began to appreciate it when I took an online MOOC in OCaml on a whim.
- kick 7y agoGenerics in Java were poorly-handled and almost universally considered to be a mistake.
- djsavvy 7y agoWhy is that? And how so?
- nitrogen 7y agoI'm not the OP, but look up "type erasure" for one criticism.
- lazulicurio 7y agoType erasure gets an unfairly bad rap. Yes, it makes reflection difficult sometimes. Yes, it doesn't play well with value types. But other than that, erasure is a very powerful concept.
- MereInterest 7y agoMy understanding is that the only value in type erasure is that it maintains compatibility with libraries compiled in ancient versions of Java. Are there language-level benefits to type erasure?
- lazulicurio 7y agoAbsolutely. Erasure lets you write code that's actually generic, instead of code that appears to be generic. For example, in C# IList<Foo> and IList<Bar> are two different interfaces that happen to have similar methods. Whereas in Java, List<Foo> and List<Bar> are the same interface. This means you can do things like this in Java: List<?> list = ... Object o = list.get(0); To do something similar in C# is significantly more effort. You either have to duplicate all of your interfaces (IList + IList<T>), use `dynamic`, or use reflection to compile delegates at runtime. A common complaint is "but erasure lets you add an integer to a list of strings". But as long as you follow PECS[1] rules you can avoid most of those situations. [1] Producer: extends. Consumer: super
- alialghamdi 7y agoI'd like to stress on the second point. When I graduated at 2015, and have done multiple interviews with enterprises, Java or .NET were critical. Don't know if it's the same, but looking into job postings, I'd say it is. It'd definitely different if you work for an IT company, but not always.
- DeathArrow 7y agoWeird reason to promote something in CS courses. CS programs aren't to let you make some easy money in the next few years. CS programs are to provide an thorough and high level of computing, from which writing code is just a small part. Having a CS degree much more than learning a language and framework. If one's goal is just to earn some money in the next few years, he would be better served by taking an Udemy course. University didn't teach me how to code, I did that myself before going to university. What it did teach was the why's and how's of computing without which I would be just a code monkey churning code without having a better understanding. It is the same difference between someone who make an course learning how to repair electrical appliances and electronics and the engineer who designs them.
- fishmaster 7y agoGo and nimble? Jesus christ, you can't be serious.
- kdtsh 7y agoI really want to know what other languages large enterprises are using that have, or are on the track to getting, the kind of volume Java has. Especially languages that don't run on the JVM.
- atomicpuffin 7y agoJava is great for exactly that reason. It gives students an introduction to compilation, runtimes, stacks and heaps etc. Perhaps you had a poor learning experience due to who/what was teaching you rather than Java? My second comp sci course in college (first if you count high school AP credits), taught me all of this, and prepared me for the "full details" of MIPS and C.
- 0_gravitas 7y agoLearning C first would also introduce students to all of that as well, outside of the magic shell of Java and its tooling; get your compiler, get your text editor, and you are so much closer to the action. If I could have chosen what I started with I would likely have picked C, or possibly a LISP as well.
- DeathArrow 7y agoI went through Basic - > Pascal - > C - > C++ - > many other kinds of languages. Thanks to C and C++ I did understand the most important bases of programming, how a program runs, how hardware works and the most important algorithms and data structures. I think it's important to learn something that doesn't do too many abstraction but it isn't too low level like the assembly language.
- mumblemumble 7y agoMy main complaint about Java as a pedagogical language is that it's just so big, with so many complexities around semantics, compilation, runtimes, etc. So my fear is you end up spending as much time learning Java as you do learning how to build software. I wouldn't choose C# or C++, either. My sense, from working with others who came out of CS programs that relied on Java, is that they end up only really knowing how to work in Java, and therefore only really knowing their way around the ways of solving problems that come most naturally in Java. It could be my chauvinism speaking. I'll admit to having some. My CS program taught us three relatively small programming languages (Scheme first, followed by C, and then MIPS assembly) in the first year before introducing OOP in the second year. So we ended up getting exposure to a variety of programming paradigms and environments, and came away with a lot of tools in our belt, and a fairly deep understanding of programming language theory and paradigms. And I did eventually find myself settled in a Java shop. When I did, I found that within only a couple months I had already developed a deeper understanding of the language than colleagues who had spent their entire careers working in it. And I believe a lot of that is because I had enough background knowledge to distinguish between, "This is how programming is done," and, "This is how programming is done in Java."
- matwood 7y agoSeems like your complaint is against using IDEs early on and not Java. It's been awhile since my undergrad, but we used Java and text editor. We compiled with javac and ran the jars from the CLI.
- 0_gravitas 7y agoI consider the IDE's harmful magic don't get me wrong, and perhaps you were taught better than I was, but you still have classes and related incantations out of the gate (I would prefer a non-imperative language as an ideal starter, but I'd settle for a procedural over an OO)
- grecy 7y agoSame. It wasn't until the final year of my 4 year Software Engineering degree I used an IDE for the first time (Eclipse, actually) and I was totally disoriented, not understanding how all the magic was happening.
- kdtsh 7y agoLikewise. It hasn't been that long since I finished my undergrad (<5 years), and if I remember correctly, we didn't start using Eclipse until second year, and even then it was considered 'optional', i.e. as long as your code compiles and passes the test cases, it doesn't matter whether you use Eclipse, vim, Notepad, etc. The upshot of this was that I didn't have a clue what Maven was until I started working, but you can learn tooling on the job.
- deleted 7y ago[deleted]
- kyriakos 7y agoI disagree with this as much as I dislike java I believe its a great language to teach someone object oriented programming. And you don't really need and ide at all, any text editor will do and will probably take away the complexity of learning the UI and help concentrate on what actual programming is. An IDE is really not needed to write your first algorithms as a student.
- DeathArrow 7y agoBut object oriented programming is gradually considered an antipattern by more and more people.
- kyriakos 7y agoso is the problem that Java is not good as a programming language or that OO is no longer considered cool?
- fishmaster 7y agoBoth.
- DeathArrow 7y agoJava forces OO design on you. Everything is an object and you can't have free functions.
- fishmaster 7y agoWe're talking about computer science and not about enterprise programming. Object oriented programming is not the focus here.
- kabacha 7y agoHere's an anecdote - Java almost made me drop out. My university was teaching Java and it was absolutely awful experience. Me with my web 1.0 html/css and turbo pascal experience was blown away how awful "professional" programming was. Then I found this new kid on the block Python and it was a completely different story. I fell in love with programming and hacking in general and finally at the end of the study I knew enough of python to bootstrap myself with Java which I still think is an abomination.
- mekster 7y agoNot to mention those classes would make good programmer candidates start hate programming. I can't imagine why people start teaching teens from C and Java and make them think programming is boring and annoying. Absolutely worse than not taking the class.
- DeathArrow 7y agoWhat is boring and annoying in C? The only thing simpler than C is Basic.
- fishmaster 7y agoManual memory management, no real type system to speak of, extremely easy to shoot off your foot for no good reason,...
- mekster 7y agoWhat do you ask teens to accomplish with C? And all the memory management and pointers? The worst way to enter programming. It needs to be taught with what is meant to be fun by doing it.
- lazulicurio 7y agoA lot of hate for Java in this thread. Just want to try to counterbalance it with some things that I, personally, like about Java. 1. Java enums 2. Java's generics, especially covariance/contravariance with wildcards (erasure really isn't as bad as people make it out to be) 3. Java's standard collections library 4. Java's method override rules (lets you extend return types on derived classes) 5. Default interface methods (.Net has them too now, but Java was first) 6. @Functional interfaces. They may seem a bit funny at first, but they are very useful (especially when combined with default interface methods)
- 29athrowaway 7y agoWhen you are teaching programming from first principles... - portability is not a high priority. - garbage collection is not a high priority. Those are 2 reasons why you don't want to start with Java. You can teach it later, sure. But it's not a good start.
- tsimionescu 7y ago> garbage collection is not a high priority Here I disagree. I would not start teaching programming in a manual memory language (though that is how I started) because memory corruption is really hard to deal with and completely inconsequential to the basics of programming. I do think it's important that every programmer should know how to work with raw memory and pointers, but it is a good subject for an intermediate class, after you have the basics of what you are supposed to do while programming.
- 29athrowaway 7y agoIn the context of higher education it is OK.
- tsimionescu 7y agoI was thinking of higher education. I think it's far more useful to teach algorithm design first and the nitty gritty of computer implementation later. This is, after all, how the field actually evolved. We had algorithms and programs far before we had the first computer.
- cs02rm0 7y agoMy undergrad was a while ago, but we also did assembly and prolog first. The lecturer basically said assembler was almost to shock us into seeing how preferably the magic was. I still don't understand why prolog. I struggled with the Java, but got my teeth into it on my own time to the detriment of my marks in other modules. Eventually it clicked enough, I got a degree and walked into a career where my skills have been in demand for 15 years. I'm pretty happy with that, I'd go so far as to say Java was by far the best part of the course for me.
- DeathArrow 7y agoWhen I become a student in 1998 we used C and C++ for CS courses. C is simple enough of a language and low level enough to understand what your code does when running on the hardware. Fast forward to 2 years ago, I did MsC at the same University and most courses were done using Java. I guess that's due to the long arm of Sillicon Valley. Although Java was used for teaching material, the teachers allowed assignments in your language of your choice if the problem permitted. I did most of the assignments in C#. One I did in Java because I needed a powerful search tool and C# version of Apache Lucene was old. Other people used Java for assignments, one guy was using Python. I have nothing against Java or using Java for teaching. I think it's better to use Java than Python since it has strong typing, enables parallel computing and it's faster being a compiled language. However, I dread Java and I avoid it as much as I can. It feels verbose, boilerplate code is too much, it lacks some features. C# feels a lot cleaner. Even if it does have many libraries and enables you to target anything and do all kind of programming, it lacks the massive ecosystem of Java. If someone would force me to choose between C++ and Java, I'd happily choose C++ if the task permits (i.e. I won't use C++ for web). And that says a lot since I am not very fond of solving the kind of bugs C++ almost guarantees you will have if the code is large enough. I'd rather solve C++ bugs than deal with the boilerplate and bloat and verbosity of Java. That being said, I don't blame Java or people who designed Java and Java libraries. Allmost all old systems have their share of problems and Java is kind of old now. Never programming languages and their ecosystems are solving some of Java's problems but if they will still exist in 20 years, we'll see they will bring their own baggage of problems. I guess a perfect programming language is like an unicorn: we strive to catch it even if we know it doesn't exist. What matters to me most these days is productivity, the speed something decent can be brought to market. By decent I mean something somewhat testable, somehow easy to understand in the future, somehow extendable and somehow maintainable. There will always going to be trade-offs, making the right trade-offs based on the particular problem and resources is an art.
- cygned 7y agoI teach Java to first-semester students and I tried a couple of times to switch to another language because I think it’s not a good language to start with and because the students don’t like it either. However, the business (and we are a private university driven by businesses sending students) builds on two primary technologies: Java and COBOL. So even if I did teach another language, I would fail to prepare them for their careers in engineering. What I do instead, though, talk about the architecture and backgrounds, show different ways and let them make the mistakes that help learn to solve problems.
- topranks 7y agoThat’s not necessarily true though. I was thought through Java but it was all command-line and jacvac. I did once sort a much better programmers final year project for him though - years later that I worked with - cos he had a CLASSPATH issue. That did make me realise there are people thought the way you say that miss some of the basics.