Live data from Hacker News

Ask HN: Why do new(ish) programming languages eschew OOP features?

news.ycombinator.com

231–234 of 234 posts

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#231
post #228

Earlier quoted context omitted.

Game engines tend to model real life and they are usually very OOP.

According to John Carmack, the acclaimed expert in the field of game programming, "Functional Programming is the Future" - https://www.youtube.com/watch?v=1PhArSujR_A

Yes, I know, Tim Sweeney has also got an interest in PL theory.

Nonetheless, that was in 2013, it's now 2019, video games are still written in C++ and not any FP language. FP has been "the future" for as long as I've been alive and I don't think it'll ever happen.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#232

Rust, Go, Julia, Nim are all cruly braced, procedural, mutable, object oriented languages. I think we need languages that bring new paradigms. All that you quoted fail in this respect. https://www.youtube.com/watch?v=0fpDlAEQio4

Nim is not curly braced, it uses Python-like indentation.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#233
post #226

Earlier quoted context omitted.

That's basically true. Languages that use interfaces with structural typing are significantly easier to work with though. You can "implement" an interface implicitly by just having matching fields

This means you can't use interfaces as tags, which is a very important feature (e.g. see how it's used in Rust). It also means that you have several different types implementing your interface "by coincidence", making it difficult to use an IDE to find out the types of interest, not to mention what sorts of bugs might result because of this. There are better solutions like what Kotlin and Scala use (and potentially C…

JS solves the tagging issue using "symbols". They're extremely weird at first look but they're basically around for that reason.

Re: Ask HN: Why do new(ish) programming languages eschew OOP features?

#234

IMO they just expose more of how OOP really works, giving you flexibility. Take Rust. Just because I like their pragmatic approach. They represent objects as structs with functions attached that have access to the struct data. In C++, Java, etc this is roughly how objects actually work underneath. They eliminate inheritance, replacing it with interfaces. Exposing the objects for what they really are, structs with fun…

> Because who really cares what you name your ducks or which ducks they inherit from. Who cares if it's an employee or a gun, as long as I can fire it.

Underrated comment
Post reply on HN