5 ms·
"WinForms" is "language tooling"? "XAML" is "language tooling"? By what definition? I can write server-side C# in vim (without omnisharp) just fine, actually.
by colemickens 10y ago
"WinForms" is "language tooling"? "XAML" is "language tooling"? By what definition?
I can write server-side C# in vim (without omnisharp) just fine, actually.
Maybe the tools became "indispensable" because they add value? I refactor my code in vim but it would probably be faster in VSCode. That doesn't make C# a bad language.
- addicted 10y agoC# has (had? I'm still a couple of versions behind) so much syntactical overhead that writing code without a visual studio seems painful at the very least. The var keyword was the first time it was even possible to write C# without tooling. It has definitely made it possible for me to use Vim for editing C# code. Newer features, such as lambda expressions, and some of the much nicer property syntax makes me feel that it may actually be fun to write C# from scratch without Visuak Studio looking over it.
- deleted 10y ago[deleted]
- brusch64 10y agoCompared to what languages ? I always thought of C# as the improved, less verbous Java. I wouldn't compare it with Python or other dynamic languages, but I prefer it to most compiled languages (especially at the times it was created)
- lgessler 10y agoWhen I read their comment I thought of how much annotation of static types you have to do that compilers in other languages are smart enough to figure out on their own. Consider the following snippet in C#: public static IList<Ephraimite> FindEphraimitesToKill(IList<Ephraimite> ephraimites) { IList<Ephraimite> ephraimitesToKill = new List<Ephraimite>(); foreach (Ephraimite ephraimite in ephraimites) { if (ephraimite.Speak("shibboleth") == "sibboleth") { ephraimitesToKill.Add(ephraimite); } } return ephraimitesToKill; } Now, the same in (imperative-style) OCaml: let findEphraimitesToKill ephraimites = let ephraimitesToKill = ref [] in List.iter (fun (ephraimite) -> begin if speak(ephraimite, "shibboleth") = "sibboleth" then ephraimitesToKill := !ephraimitesToKill @ [ephraimite] end) ephraimites ; ephraimitesToKill;; See how much less we had to specify the type of what we're handling here? And things would have gotten easier if we used functional-style OCaml, but that's not entirely a fair comparison. So hypothetically it should be possible to write a C# compiler that would, if type annotations were omitted in some places, be confident enough to assign a sensible default, which is why we call the current version verbose. Although I suppose it's slightly more complicated than that. (Interfaces, if we want to have them, need to be explicitly declared as there are potentially many interfaces that could be used for a given object, and the rigidity imposed by redundant type declarations could help with the health of large and long-lived codebases.)
- minork 10y agoI'm probably missing your point, but public static IList<Ephraimite> FindEphraimitesToKill(IList<Ephraimite> ephraimites) { var ephraimitesToKill = new List<Ephraimite>(); foreach (var ephraimite in ephraimites) if (ephraimite.Speak("shibboleth") == "sibboleth") ephraimitesToKill.Add(ephraimite); return ephraimitesToKill; } or: public static IList<Ephraimite> FindEphraimitesToKill(IList<Ephraimite> ephraimites) { return ephraimites.Where(e => e.Speak("shibboleth") == "sibboleth").ToList() } is not that verbose.
- lgessler 10y agoThe thing is, though, would those be allowed by style guides at the enterprise companies where C# is most common? The C# style guide of a former employer of mine (an enterprise C# user) forbids both of these snippets because of the unbraced statements in the former and the LINQ and lambdas in the latter. But admittedly I don't know what's common among C# users, so maybe they were in the minority.
- briHass 10y agoThe brackets, maybe. Preferences for brackets for single lines vary. I personally don't like them, but many code style guides (including MS's) recommend them. The LINQ version should be allowed almost everywhere that has a good development group. Sometimes LINQ queries can get hairier than the equivalent foreach, but I've never worked anywhere that would frown upon the shorter/cleaner LINQ.
- JamesBarney 10y ago5-6 years ago enterprise guidelines preventing LINQ/lambda's were more common. Current C# practices for enterprise companies(familiar with 6+ fortune 500's, have not seen or heard of them being banned in the last 4 years) definitely allow lambdas and LINQ. The "required brackets" is more common but I think it's a good rule :). Readability is only slightly hindered by the extra brackets, but I've seen quite a few errors from if(shibboleth) DoSomething(); DoSomethingElse();
- caseymarquis 10y agoSecond time I'm going to mention VsVim here. You still have to wait a month for VS to start, but you get enough of Vim to be pretty productive.