Hacker News new | past | comments | ask | show | jobs | submit login

Honestly, I thinks it's because a lot of OOP is awkward and forced. When it was the craze, object orientation became an ends instead of a means, and so it taken past the point of being clean and useful. Why do c# and java require every function, including main, be in a class? Why do we need static classes, which are really just a namespace for functions? There's no benefit to the programmer, it only serves the "everything is an object" paradigm. Certain OOP patterns, like the visitor pattern, are really just hacks to make OOP work like functional.

I use c# everyday at work and for the most part love it, but there are certain problem domains (anything with significant multithreading) where forced OOP thinking just makes everything harder than it needs to be.




Curious, can you explain how the visitor pattern is like functional programming? What is it analogous to in FP?

It's not a pattern I have ever really wrapped my head around fully, but perhaps there is some structure in functional programming that if I view it through that lens it will make much more sense?




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

Search: