Hacker News new | ask | show | jobs
by edwinnathaniel 4569 days ago
Your package system is inspired by Maven, minus a good build system and other functionalities.

Try building a large C# projects with running unit-tests, integration-tests, packaging, code-coverage, code style baked into it, and a bunch of other plugins for your build systems without pulling your hair.

Your DateTime library ain't there yet sir so you're pretty much at the same situation with Java (although both ecosystems have NODA/JODA lib).

C# is just Java with 10% syntax improvement and -30% to -40% productivity lost when it comes to everything else.

3 comments

C# is Java with perhaps 200% syntax improvement. The things I use most often with e.g. Ruby - monadic collection operations like map, select, etc. - is there in the form of Linq, with select, where, etc. A concise, type-inferred lambda expression goes a long, long way.

The .net ecosystem isn't as evolved as Java, for sure. But I don't think maven is a good implementation of a dependency management system either, nor is it particularly good as a build system.

I still don't see any C# developers that are 200% more productive than Java developers due to limited infrastructure around the C# ecosystems.

Say anything about Maven but the recent discussion about embedding Bundler to Gem is just one step closer to be like Maven (now if they merged Rake+Gem+Bundler then Maven is). Even if Maven is not "good enough", .NET is thousand miles behind Java when it comes to dependency management and build system.

Google-Guava, as ugly as the syntax is, is good enough for most of us. Java 8 is around the corner so meh.

Huh? C#'s had Nuget quite a while ago now.

Why are Java developers always like 5 years behind on C# improvements?

And build systems are something g you set up one afternoon, why are you so fixated on a tiny part of the programming process?

... And Nuget is always behind Maven.

... And C# devs always borrow patterns and best practices from the Java ecosystem, so I think it's you guys who are always 5 years behind us.

... If you're using MSBuild or Nant and can set up an adequate build system in one afternoon, either your project is super simple crud, or you're not using enough tools to ensure proper engineering/verification, or you're the top 5-10% people who can bent .net build tools according to your needs, or you're exaggerating.

If you think that we shouldn't sweat over build scripts then that seems to be a hint that you have not dealt with large projects.

>monadic collection operations like map, select, etc

There is nothing 'monadic' about select. SelectMany yes, but not Select. That's equivalent to map in other languages.

Sure there is! Monads generate liftM, so if you live in a place so bereft of explicit semantics as to call major parts of your standard library "monadic" without specifying which monadic context to which you refer... Then you may as well drag functor and Applicative along with you.

The weakening of the concept is inevitable now that everyone has been taught to not be afraid of it even if they have no clue why it exists.

Any language today that still requires to mark end of line with a semi colon, has in my opinion outdated syntax. Most people put one statement per line, so why is it required and not optional?
just guessing but if all statements are terminated with a ; instead of a newline it allows statements to be split up into multiple lines?
What about the counter case of one statement needing more than one line?
1) Line length is arbitrary, and there is no finite limit 2) You can have an escape sequence for a new line

With that said, I disagree that having to mark the end of a statement with a semi-colon is obsolete syntax. Statements and lines should not have to be 1-to-1, even if most code is written as such.

And some languages don't check types for you before running the code and it's almost 2014 now, can you imagine?
Ruby, Python, even PHP checks the types of values before executing operations on the values.
That's not true, at least with Python. It uses duck typing, there is no type check before execution. It just runs the code you give it, if you try to call a method that doesn't exist (split on a integer), it will just give an error.
Exactly. They check the types. They don't burden the programmer with such tasks.
We build those kind of projects and our team is successful with C#. Perhaps we just know a thing or two about decoupling on all levels. ะก# comes from the world that brought us Reactive Extensions and TPL. If you call runtime generics, continuations, dynamic typing and value types 10% syntax improvement, then perhaps you should grab a book or two and catch up a bit?
"Runtime generics" (they are called reified generics btw) is one of the things that keeps the CLR from being a multi-language VM like it was advertised, as at the bytecode level they are very hard to work around. That's one of the reasons for why dynamic languages on the CLR never took off and that's why F# has two generics systems in the same language. I'm much happier with the generics type system provided by Scala - it's more flexible, allows for more type safety (so there are far, far less instances in which one needs to do isInstanceOf checks), you also get reification by receiving TypeTags and Scala can also specialize the implementation for primitives if you want it. You get most of the benefits and more, without butchering the runtime. The easiness with which you can generate bytecode on the JVM has been one of the reason for why the JVM has been preferred by language designers.

Reactive Extensions are very nice. I'm experimenting with the Java port, RxJava. Actually I use RxScala, the Scala interface. However, for me they are of limited utility for my current usecase, because in comparison with Iteratees (a concept coming from Haskell, borrowed by Scala and championed in Play2), Rx Observables are very error prone to issues such as backpressure, whereas Iteratees are safe by design. So on one hand, Iteratees are better for handling streams, such as http requests/responses, handling big files and so on, while Rx Observables are better for publishing events to event listeners. I can see myself using Observables though. Erik Meijer is now contributing to RxJava btw.

The C# continuations are delimited continuations, or partial continuations. They are pretty cool, not arguing about it. But in Scala, the API for the standard Future, is much, much nicer than the API of Tasks in C#, therefore working with Futures directly is more comfortable. Plus, Scala's philosophy is to empower the developer to build on the same "magic" that the compiler uses, therefore instead of introducing LINQ or Async, Scala 2.10 introduced Macros. As a result, LINQ and Async are now possible as libraries. Here's DB LINQ (see the direct embedding tab): http://slick.typesafe.com/ ; and here's Async, which will be included in the standard library, but it's just a library based on macros: https://github.com/scala/async

On Value Types, there's nothing ground-breaking about it. On one hand they are great and it would have been cool to have value types on the JVM. There are proposals to include value types that people experiment with in OpenJDK. On the other hand, the JVM being more restrictive about managing memory, gave birth to the most advanced garbage collectors in mainstream usage. C#/CLR is great when a low overhead is required, such as on mobile devices, but in a server-side context no GC-enabled language can beat the JVM.

On syntax, it's true that Java is an abomination. However this gave birth to multiple languages that are flourishing and you can't say the same thing about .NET ... Scala, Clojure, JRuby, Jython, Groovy and Rhino are examples with flourishing communities and ecosystems. Similar efforts have been happening for the CLR, but they never made it or are moribund, except maybe F#.

I did want to use C# several times, as I view it as a mixed-bag language, as in a language with comfortable high-level features that also has some low-level stuff, which is pretty cool on top of resource constrained devices. And I definitely prefer C# over Java (thank God for Scala and Clojure). Unfortunately the platforms I build upon are mostly Unix and I prefer to build on top of open-source as I'm the kind of developer that likes being in control. And in spite of the best efforts of those people from Xamarin, or the recent moves from Microsoft to open-source some stuff, .NET doesn't really have an open-source community and it's very Windows/Microsoft oriented.

It's a pity because it could have been much more than it currently is. And maybe it will, as I'm seeing some encouraging signs, like Microsoft partnering with Xamarin.

We tend to treat languages like they are football teams. We really need to learn from each other and build on top of each other ideas. Cross-pollination is healthy. Conservatism is not. If we jumped between platforms more often, we wouldn't be separate communities.

> that's why F# has two generics systems in the same language.

For real? Do you have any reading I can do on this? It sounds... interesting

What? We do all those things and have hardly a problem. What ci / build server do you use?
In the past, I had the misfortune to work with MSBuild to setup a fairly large .Net project. This was before NuGet exist. NuGet helped a bit these days but integrating FxCop, FxStyle, auto run NUnit, generate the docs, and running code coverage as part of the build is very painful and a manual process from downloading the proper assemblies up to setting up paths and results. Not to mention packaging the whole things up and possibly deploying to local IIS all through the build script.

Preparing dev workspace means to include csproj in your repo which may contain hardcoded paths. Is that portable across to Mono? In Java, all you need is a Maven pom.xml file and the code. Any modern IDE can read pom.xml file and prepare the project consistently cross platforms.

CI server is the easy part.