Hacker News new | ask | show | jobs
by Pxtl 3504 days ago
While I prefer C#'s delegates/lambdas, there has been an occasional time I've wished for the ability to construct a full instanced object in that case - Java's anonymous inner classes are brilliant at this.

Likewise Java's OOP enums (basically singletons) are something I miss too.

That's a few small features I notice missing when I switch to C#.

Plus, in general I find there's a difference in style. C# libraries tend to be more pragmatic, following on Microsoft's heavy use of reflection and stringly-typed stuff. Not much OOP navel-gazing.

Java, on the other hand, celebrates OOP to a ludicrous extreme.

Also on the community, C# has been working very hard to develop the kind of bazaar that Java has, but they're coming from far behind on that front - far more C# developers restrict them to the first-party tools compared to the Java ones.

3 comments

Maven, Ant, and Gradle are also in a class of their own. They help making building Java apps universally extremely easy. C# has an annoying amount of complexity in this area, with a lot of things being built into Visual Studio, and therefore Windows only. “Visual Studio” isn’t a fun build system if you’re not on Windows. And compiling people’s libraries from random repositories over github, bitbucket, etc., only to find that it won’t compile because it relies on some old version of a library that you can’t find online and the newer versions aren’t compatible.
Nuget solves the dependency issue. MSBuild has switching from part of the framework to VS to framework to open source. On other platforms there was always csc to compile programs (which is dramatically faster), something missing from the new dotnetcore.

There was also nant and a number of build tools, plus good old make.

Ms is working on this, but it's been slowed by politics. There was an alternative msbuild file called json.project that was happening, but it's since been deprecated in favour of strippinh down the old . csproj format to its bare minimum and cleaning it up for sanity.
They also open sourced MSBuild
> Likewise Java's OOP enums (basically singletons) are something I miss too.

C# guys are working on adding full-fledged pattern matching to the language:

https://github.com/dotnet/roslyn/blob/features/patterns/docs...

and there's a concurrent proposal for ADTs:

https://github.com/dotnet/roslyn/issues/6739

Given the velocity of adding new features in C# these days, these will come sooner rather than later (indeed, some basic pattern matching is already in C# 7).

You might like F#'s object expressions for the cases where a lambda won't do.