Hacker News new | ask | show | jobs
by retrac 21 days ago
> I could a bit biased because I do have prior experience with SML

You're probably under-weighing this factor.

The average programmer looks at SML syntax and cannot make, pardon the expression if you will, heads or tails of it.

Indeed, I'd argue the average programmer still considers recursion an advanced topic.

2 comments

Recursion. Very interesting. My daughter didn’t know much about programming, then started CS. The first semester language was Ocaml and they of course used recursion quite heavily and she’d didn’t know it was supposed to be complicated. The second semester had assembly, C and Java and suddenly it was a problem. I had to remind her that she’s had already done it in the first semester.
My CS degree started first semester with Haskell, with a few weeks of Java tacked on the end. It was interesting to see some of the students who had prior programming experience have to work a bit to adapt their way of thinking to Haskell, while some of the students with no programming background at all were perfectly happy writing code in a language that made reasonable sense if you were good at maths, then had to work harder once we swapped to Java.
Sounds like a sick CS department. We had to do Java. The whole first year was just OOP day in and day out. If I’d never seen python I really would have thought all programming is OOP, and probably would’ve dropped it for good
> If I’d never seen python I really would have thought all programming is OOP

But isn't Python object-oriented? I mean, it's arguably more object-oriented than Java, since unlike Java, everything in Python is an object and it supports multiple inheritance. It's totally fair to not like Java, but if you like Python, then I doubt that OOP itself is what made you dislike Java.

Python is an object-oriented language in the broader meaning, but object-oriented programming is a particular style that java pushes you into, that python doesn't. It doesn't just mean "everything is an object", it's more like "everything is done in terms of objects that contain data and functions (methods)". Python has objects and could be done in that way, but a more basic imperative style with functional programming elements is more common, where objects are just one component instead of the driving force.
Java has better support for non-OOP paradigms than Python does. Map, filter, and reduce are built into the language rather than exiled to an external library. It supports multiline anonymous functions, and it has block scoping, so there are fewer surprises when using them. Java also has record types, exhaustiveness checks in pattern matches via sealed interfaces, built-in types for managing effects and errors (Optional<>, Try<>, Result<>), and type inference. It also has excellent interop with multiple programming languages where pure functional programming is idiomatic. It's a way more comfortable language in which to do FP than Python is.
After spending years on end doing functional programming I used to stumble when looking at for loops until I got used to thinking that way again. It's funny how different the skills are.