3 ms·
I only used C# for a few months, a few years ago, but I immediately loved the language. I wasn't thrilled about the documentation (Why aren't return types liste
by jimktrains2 11y ago
I only used C# for a few months, a few years ago, but I immediately loved the language. I wasn't thrilled about the documentation (Why aren't return types listed in [1]?), VS (OK, vim key bindings made more bearable), or just dealing with the MS ecosystem in general, but I loved the language.
It felt like everything Java was suppose to be, but is failing at.
[1] https://msdn.microsoft.com/en-us/library/system.string%28v=vs.110%29.aspx https://msdn.microsoft.com/en-us/library/system.string%28v=v...
- mattmanser 11y agoBecause it's a statically typed language it's all in the IDE. Almost everyone who uses C# doesn't need to check the documentation for that kind of information, it comes up when you're typing, or it's an ctrl-space away if your caret is on a method, or you can right-click go to definition. You can pretty much right click on anything and go to definition, which will show you all the method signatures and return types of everything. My only beef with the documentation is that they show examples of the code in use, but annoyingly never the output. So, for example, it's never clear even from the examples in the documentation whether a directory path or a URL includes a trailing slash or not. And because there's no REPL, you have to either build/compile/run or use an external program (I used to use some LINQ tester program that was basically a REPL, but it's contextually almost as expensive as simply trying it in an existing program).
- Locke1689 11y ago> And because there's no REPL Working on it -- you can expect a public pre-release soon. The code is in master right now: https://github.com/dotnet/roslyn/tree/master/src/InteractiveWindow https://github.com/dotnet/roslyn/tree/master/src/Interactive.... I'll have to check with the dev to see how installing it is supposed to work, but he demo'd it on Friday and it looked very slick.
- mattmanser 11y agoThat will be a wonderful addition!
- jimktrains2 11y ago> Because it's a statically typed language it's all in the IDE. What if you don't want to use VS directly? Also, if it's "all in the IDE" why have it online at all? And if it is on line, why not just include the return type?
- MichaelGG 11y agoMy guess is that they only include the types of the parameters to disambiguate between overloads. Since you can't overload based on the return type they don't include it. C# is fantastic compared to Java and seems to avoid a lot of the crap. But F# trumps C# in just about every aspect, apart from having lots of funds for tooling.
- thomasz 11y agoF# has downsides too. It's a way more complicated language with way more magic (type providers, custom computation expressions etc.) compared to c#.
- MichaelGG 11y agoC# has "computation expressions", except they are hard-coded into the compiler. It has duck typing, but it's hard-coded into the compiler. So instead of understanding a general concept, you learn specific instances. That's certainly less elegant, and I'd guess just as complicated - but I'd say that's more magic on C#'s side since in F# it's just simple concepts repeated. I don't know if type providers are more complicated than partial classes, and they probably should have been some generic macro system instead of just type generators. I don't have a good definition for complicated, but I'd be surprised if C# is actually less complicated. (Something number of core concepts and interactions.) Certainly if we take expressiveness/complication F# come out far ahead.