4 ms·
A 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 gen
by lazulicurio 7y ago
A 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.
- pas 7y agoFor a good "what's programming really is" class mobile app development and some web dev would be great. First a mobile hello world. Kotlin preferably. Then they can whip up a very basic backend (it just spews out rows from a DB), again in Kotlin. And then they can slap an admin UI on top in HTML. And then over the next few years it would be great to dissect this. CPU, ALU, ASM, raw memory, network basics, IP (BGP ~ distance vector routing), TCP, buffers, syscalls. RDBMS, MVCC, B-trees, merge sort, heap sort, and so on. Oh well, one can dream. But usually students are just bombarded with completely disconnected courses.
- DeathArrow 7y agoI still feel like C# is a better Java. It has most of Java features, has other features, implemented important features before Java and it doesn't reach Java level of verbosity and bloatness.
- lazulicurio 7y agoI used to feel that way a few years ago, but my opinion has shifted over time. C# has its own issues with verbosity and bloat. For example, although I appreciate the readability increase from overloaded comparison operators, it's a lot of boilerplate to write a class that implements IEquatable<T> and IComparable<T> and overloads all of the related operators.
- sullyj3 7y agoCheck out Rust and Haskell, both have the ability to derive the interfaces/traits/typeclasses for equality and comparison automatically.
- lazulicurio 7y agoDiscovering Rust is actually one of the stepping stones that led me to my "this shouldn't be this hard" moment!