The document discusses using F# for building a .NET client library for Apache Pulsar. It highlights features of F# like null safety, immutability, and builders that help create concise and safe code. It also presents solutions in F# for common problems like implementing connection state, using identifiers safely, and testing without mocks. Overall it argues that F# is well-suited for enterprise applications due to its functional programming principles.
26. Problem: implement connection state
● Possible statuses: Ready, Connecting, Closing, Closed, Terminated,
Failed, Uninitialized
● If Ready, then ClientCnx object is available for usage, otherwise
unavailable
● Any thread might Read/Update connection state
36. Drawbacks
● Increased coupling.
AcksTracker depends on Consumer (or IConsumer)
● Increased test run time
● Mocking is a code smell
https://medium.com/javascript-scene/mocking-is-a-code-smell-944a70c90a6a
40. Conclusion
● No boilerplate
● No nulls
● No locks
● Concise and safe code
https://fsharpforfunandprofit.com/posts/fsharp-is-the-best-enterprise-language/