4 ms·
Anecdotally when I've had to show developers how to start with .NET Core the problem isn't the SDK (install dot.net at the website) or which template to use (i.
by akra 5y ago
Anecdotally when I've had to show developers how to start with .NET Core the problem isn't the SDK (install dot.net at the website) or which template to use (i.e. just tell them to pick that one) its C#. This is especially true if they come from a JS, Python or Go background. I say this as someone who does doesn't mind C# and thinks its pretty capable once the learning curve has passed.
At one stage I had a JS developer just try the F# template instead and the difference was stark. Explained to them Async F# - Promise JS, Module F# - Module JS, showed them a unit test example and they were writing production code in two weeks to a month. It made me realise that over the years there is a lot of knowledge I just take for granted that many beginners just don't have especially now when there are much friendlier languages for beginners. Things like dependency injection, how it resolves based on types, and which framework to use and why, mocking framework choice (vs simple stub functions), can only mock interfaces and why, the class structure and how you should group functions into appropriate classes, abstract classes vs interface default methods, LINQ vs OO style coding, nullability annotations all over the place, OO design patterns, the need for Resharper or equivalent unless you can write C# syntax from scratch, the list goes on and on. With most C# apps there is a lot of knowledge assumed and baked in which can be daunting for a newcomer. C# is not alone here I understand that - the same thing can be said for other languages too. But it has made it harder than it needs to be especially when it is actually a good platform but C# scares many developers away especially as it adds more and more features on top.
Litmus test for a language to me: Does it need an IDE and tooling to be productive in? The more tooling it needs the more complex IMO the underlying language is in syntax and complexity. Complicated refactoring tools? If so its probably too complex for a beginner especially now that the language space has quite a bit of competition. As an example watching a developer do this in a previous role in F# you just create a new file and cut and paste the functions around; in C# the dev's I've had usually resort to Resharper and a full blown IDE to extract variables/methods, do code generation, and basic refactorings unless they want a lot of manual work.
- kaba0 5y agoI think your comparison is not fair. Maybe your vision of beginner C# is just much much higher than on F#? Like, dependency injection, mocking and the like are not at all beginner concepts, and are not made particularly easier with more modern languages.
- akra 5y agoI'm just stating the experience I had, and the observations I encountered in that job that formed that opinion. To clarify I'm talking about a beginner that needs to be productive quite quickly to earn their paycheck so their code has to somewhat scale to a medium sized solution and get accepted by a senior dev in a PR process. If they aren't beginner concepts as you state why are they in most "Getting Started" templates and their use is mandatory? As an example many of the common app types use a DI framework straight away following its own standard (e.g. ASP.NET, Spectre.Console, etc) and while an experienced person picks this up quickly someone new to the language from what I've seen struggles. These are concepts I had to explain to a beginner I had to mentor at the time pretty quickly. Most F# code bases I've seen that make it to prod don't use frameworks for those concepts even as they scale; basic functional patterns seem to scale up to reasonable sized solutions. If they do use mocking/di/etc its only to make the code more C# consumable at the edge for some other C# framework they are required to use. I'm not talking about toy projects here. My point was more that at some point with C# you will need to learn these things quite quickly even for basic use cases or find yourself writing clunky boilerplate (which most new developers will default to - the you don't know what you don't know problem). However with some other languages you may never need to until much later in the learning cycle - I was working for a very successful large business that built the whole stack without ever using some of these things. If you want to encourage people onto your platform these are some of the people you need to win. IMO It just seemed the standard to get nice code that was prod ready in F#, even JS or Go, doesn't require as much learning's as a C# app. It's not just a C# problem mind you but from what I've experienced first hand it has scared developers away.
- kaba0 5y agoBut that’s a problem with a specific framework, not C#. It’s true that some frameworks are quite hard to avoid using, but you could just as well create a lean vanilla project (which I gather the F# one was closer to), and you can choose not to use DI. I doubt F# would be all that much more expressive than C#, that you could not recreate whatever you did there.
- 5y ago