Given that most programmers begin by doing theObject. and waiting for their IDE to suggest methods, the C# approach is quite useful. The Java 8 approach has some advantages, but it does lose the ability to add methods to a third party/core type without being that third party or Oracle, and in a static and scoped way so it doesn't have the problems Ruby's monkeypatching does.
C#, much more than Java, is designed with autocompletion in mind, even down to the order of the clauses in LINQ. E.g., SQL-style select foo from people p where p.age..., the IDE wouldn't have enough context to complete foo, so instead you write: from p in people select p.foo where p.age > ... It also caters to a school of [non?]-thought whereby it's OO or otherwise natural if it goes x.y(z) instead of y(x, z). Scala's implicit conversions are almost always used to achieve the same effect. On Mon, Oct 29, 2012 at 12:35 PM, clay <[email protected]> wrote: > C# Extension methods are mere syntactic sugar to convert this: > foo(o, args); > into this: > o.foo(args); > > So what? I'm only interested in language/api features that have a basis in > serious logical reason and purpose. > > Every Scala feature I listed earlier can be supported by reason and logic, > not merely subjective taste and opinion. > > On Sunday, October 28, 2012 10:13:04 PM UTC-5, Ricky Clarkson wrote: >> >> Sure, they don't let me add methods to types I don't control, i.e., >> they're not extension methods a la C#. I think they solve what >> they're intended to solve reasonably well though. >> >> On Sun, Oct 28, 2012 at 10:47 PM, clay <[email protected]> wrote: >> > Is there a legitimate complaint about the Java 8 virtual defender >> > methods? >> > That seems like a great enhancement. I haven't heard any objections. >> > >> > I understand that people will complain about everything. But with the >> > Option/flatMap/iteration issue, there is a very specific, technical, >> > articulate, well reasoned and widespread objection. That makes it quite >> > different. >> > >> > Sure, there is choice in languages, but that is a lame response. If >> > there is >> > still a community that cares, they should speak up. I will probably >> > migrate >> > from Java towards Scala whether they fix small ticket items like this or >> > not. I would still like to see the flagship JVM language move in the >> > right >> > direction. >> > >> > On Sunday, October 28, 2012 8:39:21 AM UTC-5, Simon Ochsenreither wrote: >> >> >> >> We can only assume that they already considered it, looked at >> >> code-examples and maybe decided that this is not the way they want >> >> people to >> >> write code (similar to Guava). >> >> >> >> This wouldn't be too bad in many languages, but even Java's planned >> >> extension methods are designed in a way which prevents people who >> >> disagree >> >> from fixing it. >> >> >> >> In the end, different languages have different attitudes towards their >> >> users, which can range from “They are stupid and need constant >> >> shepherding” >> >> to “They know what they are doing, get out of their way”. >> >> Thankfully, there are plenty of languages to choose from. >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups >> > "Java Posse" group. >> > To view this discussion on the web visit >> > https://groups.google.com/d/msg/javaposse/-/ZNq_cgjE_UgJ. >> > >> > To post to this group, send email to [email protected]. >> > To unsubscribe from this group, send email to >> > [email protected]. >> > For more options, visit this group at >> > http://groups.google.com/group/javaposse?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Java Posse" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/javaposse/-/Q84leqqf0tQJ. > > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/javaposse?hl=en. -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
