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

"Scala is the only language that I know of that marries the world of FP and OO"

You can do that in C#/F# too. There's nothing special about Scala from this point of view.




OCaml was doing that before any of them.


Although I find it interesting how Ocamlers only rarely reach for the OOP bits of the language. I think that this is in part due to the powerful module system that language has.


Indeed. Also, the object system doesn't have the reputation of being very fast. That said, it lets you use structural typing, which is extremely handy once in a while.


C# and F# are different languages..

Last I checked you could not mix the two easily [0]

[0]: http://stackoverflow.com/questions/14280001/why-cant-we-use-...


I think the poster means that c# has many functional features and F#, while being functional language at heart has lots of OO features integrated in it.

PS And the linked question only describes the limitations of Visual Studio where you can have only one language in a given project.


> I think the poster means that c# has many functional features

Yeah just like C++ or Java now have "functional features". That doesn't make them functional languages, they don't promote functional programming to the extent that Scala does.

Aside from that, their type systems are much too unexpressive to allow for the style functional programmers are used to, not to mention they promote mutability.


Nope. Scala allows for and promotes for functional programming with higher order functions all over the place, its more powerful type system, immutability, practices, standard library, and much more.

Having lambdas makes you about as functional as C++ these days.

Functional/non-functional is a fuzzy distinction but C# is definitely not a functional language.


There be no true Scottsmen here. Scala is also great as an imperative language and an OO language. In fact, I would say Scala has one of the most powerful natively supported object systems out there (mostly because the rest of the statically typed language world can't be bothered to support mixins, grr...).

If it wasn't for nerfed imperative collection classes (to encourage functional solutions) in the standard library, you could totally just ignore the fact that Scala was a functional language at all; it is not in your face about it like Haskell.

It would probably be more correct to say that "Scala is the only language that does both FP and OOP very well." On marrying the paradigms....why not just use both as needed anyways? That is completely doable in C# as well, just not as well as in Scala.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: