Paweł Iżycki

.NET developer, fan of automation and backend world.


DevoWeek - 2017/12/03

03 Dec 2017 » DevoWeek, VisualStudio, LINQ, FP, MediatR

This week:

News

  • Memeful Comments - Extension that will display linked images inside your methods (also tests!) describtion. You can finaly insert image of dragons into your tangled code. Great stuff!
  • Moving CodePlex to read-only - CodePlex dies slowly and user will no longer can add new code.
  • The simplest .Aggregate() example - In my production code I only once used this LINQ method in the code that actualy finished in codebase. Reading ploehs article about semigroups I stumbled on the most practical and readable example of using .Aggregate (in Func. Prog. known widely as fold). Here it is
    var a = new[] { 1, 0, 1337, -10, 42 }.Aggregate(Math.Min);
    

    Trivial, yet much more sexy than ordinary .Aggregate((a, b) => a < b ? a : b). And lovely presents idea of Strategy Design Pattern Higher-order function.

  • Things planned for C#8

    My super quick comment on this is as follows:

    • Nullable Reference Types: cool
    • Records: yes!
    • Async Streams and Async Dispose: nice
    • Default Interface Implementations: super
    • Extension Everything: wtf..
  • MediatR 4.0 Released - I’m big fan of splitting actions to simple objects and segregating queries (read) and commands (create/update/delete). I really liked MediatR 2.x, but haven’t much to do with 3.x. I’m glad to hear that the MetdiatR API was simplified and went back to well defined pattern from 2.x version. Hopefuly I’ll find the use case to play a little with MediatR once again.

DevoWeek (the project)

As mentioned in last post, I focused on automatition of bootstrapping branches for new DevoWeek posts. At first I tried doing this with Azure Logic Apps, but find out that GitHub integration API is very limitted (just creating/reacting to new issues).

I searched on Google looking for some example how can I create new branch on GitHub using its web API. Found this gist, tried it and it worked, so, the second stateless option, Azure Functions.

And failure again as I found out that there is no way (except via Nuget package) to reference Azure Function project to .NET Class Library. Neither to unit test. That’s sad.

I started to doubt if I really need to automate it that much. Maybe I can stick to simple script that I can run manualy? Maybe I could finaly use F# to do that?

I liked that idea. I started coding using the gist above. I even succeded to get master reference SHA with help of JSON Data Provider. I gotta say, it’s super awesome :P You can check it at this commit.

Then I started working on remotely creating new branch in repository. And I found out about octokit .NET, official .NET API client.

So, there are probably changes comming to the approach taken creating DevoWeek project :)