History of how I ported https://github.com/Oaxoa/fp-filters to csharp
This is my first attempt to utilize AI to translate from a programming language to another . To be easy, I choose the npm package https://github.com/Oaxoa/fp-filters to be translated to C# nuget package . It could bring some benefits to C# programmer to replace
var numbers = new[] { 1, 2, 3, 4 };
var evenNumbers = numbers.Where(it=>it % 2== 0);
with
var numbers = new[] { 1, 2, 3, 4 };
var evenNumbers = numbers.Where(FpFilters.NumberFilters.IsEven);
( BTW, https://www.npmjs.com/package/is-odd has 30M downloads ….)
So in the next blog posts I will detail how I did that with AI – begin picky about correctness – and deploy to Nuget at https://www.nuget.org/packages/FPFilters
- Step 01: I describe my initial steps porting fp-filters to C#, including how I set up the project, chose a translation strategy, and made iterative progress.
- Step 02: I detail how I converted tests to BDD style using LightBDD, with examples and discussion about adapting test logic for C#.
- Step 03: I cover my efforts to generate test reports in HTML/Markdown/XML formats using LightBDD, including configuration challenges and solutions.
- Step 04: I explain how I consolidated using directives into global.cs files for both code and test projects, improving project structure and compilation.
- Step 05: I focus on automating code coverage reporting using Coverlet and ReportGenerator, including scripting and workflow integration.
- Step 06: I chronicle my journey to achieve 100% code coverage, with strategies for incremental improvements, test targeting, and handling edge cases.
- Step 07: I discuss adding LINQ-friendly overloads and BDD tests for filter functions, ensuring compatibility and comprehensive test coverage.
- Step 08: I document the addition of StringComparison overloads to string filter functions and corresponding BDD tests, including feedback from code review tools.
- Step 09: I detail how I added XML documentation comments to all functions (excluding tests) and explored options for generating API documentation sites.
- Step 10: I describe namespace refactoring to avoid redundancy, troubleshooting compilation issues, and resolving missing method errors.
- Step 11: I outline the steps I took to deploy the project to NuGet, including automation via GitHub Actions and requirements for secure publishing.
- Step 11: Outlines steps for deploying the project to NuGet, including automation via GitHub Actions and requirements for secure publishing.