Sunday, December 8, 2019

Composable Code - From SLC .NET

Joel Richman gave a presentation on composable code, including using a library.
https://www.pluralsight.com/courses/csharp-applying-functional-principles pluralsight course given by Vladimir Khorikov

https://github.com/vkhorikov/CSharpFunctionalExtensions Vladimir Khorikov github with source code and links to his blog posts.


Main bullet points -
  • Lots of way to handle error handling.
  • Exceptions (try/catch).
  • Error codes and messages.
  • Nulls can be tricky...passing around...nothing (but a still valid value), null checks everywhere.
Functional Design can help!
  1. Get rid of primitive obsession. (And validation logic everywhere).
  2. Chain operations, handle input and errors. (Don't Repeat Yourself with input and error handling...makes chaining common functionality easy to read.)
  3. Make nulls explicit with maybe type. 
Screenshot of Readme of repo is worth a thousand words!


No comments:

Post a Comment