I was invited by JetBrains to talk about OOP and FP and how C# and F# support these paradigms.
Here, you can find the Recording.
And here are the slides.
Happy combining of OOP and FP in your code!
Sometimes when I talk to C# developers about F#, they say they don’t want to switch to a functional programming language. When I reply that F# is my favourite object-oriented programming language, they look a bit puzzled. They typically think that F# is for functional programming, while C# is for object-oriented programming. And this is wrong!
There are many libraries for JSON serialization in the .Net realm. The best known are probably Newtonsoft’s Json.NET and System.Text.Json. Both can’t handle F# discriminated unions very well. There are also a couple of F# JSON libraries available like Thoth.Json or FSharp.Json. They are all great libraries, and choosing one is about making trade-offs. However, our case is a bit complicated because we have a mix of C# and F# code. This results in object/value graphs that consist of a...
This is part 5 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together...
This is part 4 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together Be...
This is part 3 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together Be...
This is part 2 of the series about how we generate code from .Net for TypeScript:
Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together
A little while ago, I asked on Twitter whether someone would be interested in reading about how we generate types from our .Net backend to be used in our TypeScript client. So, here we are. I’ll cover the following topics: Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi...
I dared to ask two questions on twitter:
What makes your daily developer life easier in F# compared to C#?What is better in C# than F#?
This post summarizes the answers and my own opinion on where C# and F# shine.
In C# the class Enum is often used. Some geek’s argue that the Enum’s “improve code clarity and and reduce the probability of invalid values. … Enum’s are self-documenting.
Enum’s should be used with caution, since some things are not straight-forward. The following article will show you where to be cautious.