2 ms·
I don't know much about the other languages you mentioned, but C# is multi-paradigm, allowing certain functional and declarative programming practices that Java
by kyllo 13y ago
I don't know much about the other languages you mentioned, but C# is multi-paradigm, allowing certain functional and declarative programming practices that Java does not. It's much more expressive than Java.
- pjmlp 13y agoHow do you write pure functions and procedures outside classes in C#?
- kyllo 13y agoYeah, I don't use C# and I don't know if you can do that, I think you have to create a class and declare them as methods like Java. But C# does have closures and lambdas, and lets you use functions as arguments and return values. Java doesn't have any of those yet, although they're supposed to be coming in 1.8.
- pjmlp 13y agoStill it makes it fundamentally an OO language, because C# closures and lambdas are mapped to System.Delegate class. All primitive types are actually alias for classes and structs that live in the System namespace. My point was basically from a point of view of someone with compiler development background, if one bashes Java for being OO based, there are lots of other languages to bash for the same sin, which for whatever reason people like to forget.
- kyllo 13y agoWell, Ruby is OO too, even moreso than Java because there are no primitives in Ruby. Even the "integers" in Ruby are not ints but objects with lots of methods. But Ruby has a lot of powerful, functional, expressive, declarative, and meta language features that Java lacks. Java is like an OOP straightjacket, that's why it gets so much hate.
- pjmlp 13y agoCorrect, the main issue is that many seem to mistake Java's OO model with OOP in general. Most modern languages are all OO based in some form, while being more flexible, like your example. Java 8 will probably improve the situation. At least on the enterprise level, I don't see it moving away from Java and .NET anytime soon.