Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Generics are wildly, WILDLY popular in functional programming - far more so than in imperative flavours of OOP, really. Basically every functional data structure is full of things like List[A].map(func: A => B): List[B]

Also, it’s really not “OOP or functional”, there are tonnes of languages mixing OOP and functional very effectively (Scala is both very functional and very object oriented, but honestly most languages are a mix to some degree). Functional vs. imperative is more of a divide.



And yet, FP remains less popular overall than OOP (personally, I love love FP :).

Many of the people targeting the most popular FP language of all time aren't writing the Javascripts because it's their first choice. Just look at the pretty WILD popularity of Typescript, an OOP bolt-on language which transpiles to Javascript.

The simpler (in some ways) imperative programming model still dominates developer mindset.


TypeScript bringing a half decent type system to JavaScript is orthogonal to OOP

JavaScript is OOP already. TypeScript just provides better typing like what you would find in Haskell, Ocaml or other functional languages


You are technically 100% correct, however the bultin object system in Javascript is so bad that a reasonable argument can be made that it's not particularly accessible or ergonomic to many of the folks who actually write it for a living.

I know lots of folks here on HN are super highly competent, and this contrasts with my IRL experience with colleagues who are less passionate about programming and just want to do their job- these folks aren't going to be teaching lessons in proper usage of objects in JS.


It’s hard to tell, but are you referring to prototypical object inheritance here? If so, JavaScript has long since implemented more traditional class definition ergonomics, such that explicit prototyping is almost largely unused in modern codebases.

In truth, even classes are becoming increasingly uncommon in JavaScript codebases, and most object usage in JS these days is struct-like, where the ergonomics are pretty similar (or identical) to other languages.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: