5 ms·
The thing I find most interesting about a lot of C# developers I've worked with, trained, etc. is their understanding of "Object Oriented" programming. I have
by kemiller2002 7y ago
The thing I find most interesting about a lot of C# developers I've worked with, trained, etc. is their understanding of "Object Oriented" programming. I have the same discussion over and over again.
"Have you looked at F# even to just to see how it works?"
"I won't ever use it. I'm an OO programmer, and it suits me just fine!"
"Do you use LINQ, and understand you can pass functions into methods etc.?"
"Yeah, it makes things so much easier. I don't understand why people wouldn't use it."
"That's really more like functional programming"
"...."
Edit:formatting
- bunderbunder 7y agoIt's almost to the point where the deciding factors in choosing between (C#-style) OOP and (F#-style) FP are: - Do you want your data types in one line or 20? - Pattern matching, or large concretions of if-statements? - Race conditions: Quality problem, or fun puzzle?
- mfatica 7y agoC# has most of the same pattern matching functionality at this point
- McWobbleston 7y agoThere's no compiler warning for incomplete matches, and without discriminated unions it's pretty verbose to write pattern-match friendly types C# has support for most F# features, they're just often awkward to use
- macca321 7y agoYou can get a pretty reasonable facsimile using some libraries I made: Discriminated unions: https://github.com/mcintyre321/OneOf https://github.com/mcintyre321/OneOf and One line value objects: https://github.com/mcintyre321/ValueOf https://github.com/mcintyre321/ValueOf
- McWobbleston 7y agoI'm constantly impressed by ways people manage to extend C# like this. I'll have to try this out :)
- coldacid 7y agoI haven't had a need for ValueOf yet, but OneOf has saved my ass now more times than I can count. Thank you so very much for it!
- seanmcdirmid 7y agoThere are C# programmers like that I suppose. There are also many C# programmers who buy into multi paradigmism, they fee no ideological conflict between using OO or FP as needed. C# supports FP well enough, and gets better every release (eg pattern matching). It’s difficult to compete with C#, especially when F# is feeding features into it.
- dvlsg 7y agoHopefully F# feeds the ability to have functions at the root of a module into C#. It's a small thing, but needing to put pure functions on static classes gets old after a while. I know local functions are a recent ish addition to C#. Hoping they keep going down that road.
- seanmcdirmid 7y agoC# has a set of design constraints that can be annoying, but they make the language consistent and extremely resilient. It isn't up to the whimsies of the designers either, Anders and company went one way with C# and a completely different way with TypeScript (given its need to fit in with Javascript). They can be annoying, I guess, but once you are used to it you don't really notice they are missing. It is annoying if you have to switch languages often, I'm pretty sure I would need a few weeks to get re-acclimated if I had to go back to C# from using TypeScript for so long.