My Sunday Reading List

Declarative vs Imperative

https://en.wikipedia.org/wiki/Declarative_programming
https://en.wikipedia.org/wiki/Imperative_programming

This is probably your interview questions, even though not many company I came across has asked these. Declarative programming vs imperative programming, is basically, in its very simple form, like functional programming vs object-oriented programming.


6 Key Concepts in Andrew Ng’s “Machine Learning Yearning”

If you want to learn Machine Learning, Andrew Ng is the man you need to listen to. There’s so much more to cover beyond this article, but it lays out 6 basic concepts in Machine Learning.


Using the Microsoft Graph API with PowerShell

A detail walkthrough on how to query Microsoft Graph API, which is a service to manage all most aspects of Azure AD and Office 365, with Powershell. From setting up secrets, certificate, application permission to access token, all covered here.


Why our team cancelled our move to microservices

Sometime you have to know when to back out as in this story of Steven’s team backing out from implementing microservices. What’s even more awesome is, he documented the lesson-learned from his team on what to consider when implementing microservices.


How you can build a Serverless API using GraphQL .Net Core, C# and VS Code

A step-by-step walkthrough on how to build GraphQL-based API with .Net Core, C# and Azure Functions.


Advertisements

What I’m Reading This Week.

“Maybe” monad through async/await in C# (No Tasks!)

https://habr.com/en/post/458692/

Dmitry Tikhonov outlines how to create `Maybe` object in C# that carries 2 states (think about success and failure object) in a monad way. The implementation includes code sample and usage in async / await.

 

Functional Programming In Object-Oriented Programming In C#

https://www.codeproject.com/Articles/5162828/Functional-Programming-in-Object-Oriented-Programm

Emulate functional programming in an object oriented programming world. Yes it is possible. I do feel a basic understanding of functional programming is needed.

 

2019 State of Testing Report

https://www.infoq.com/articles/2019-state-testing-report/

Worth your time to read if you are involved a lot in testing. At least, read the “Key Takeaways”. This report covers what’s going on around global testing community as it surveys 1000 participants from around 80 countries.

 

Clancey’s HotUI

https://github.com/Clancey/HotUI

A MVU (Model View Update) way of building UI. Platform supported includes: iOS, Android, UWP, WPF, Mac OS, Xamarin.Forms, Blazor. And it support hot reload! It’s still proof of concept though, definitely don’t use it in production.

 

Jason Livesay’s NoScriptWeb

https://github.com/runvnc/noscriptweb

I thought this is a very cool concept. The idea is to build all pages in a website from markdown. 100% JavaScript free. That means, no ads, secure, fast browsing. Still work in progress, but promising.

BuzzWord: Functional Programming Short Guides

This is summary of: Anjana Vakil’s video

1. Do everything with functions. Function take input and return output.
Non functional

var name = “Anjana”;
var greeting = “Hi, I’m ”;
console.log(greeting + name);
// Output: “Hi, I’m Anjana”

Functional

function greet(name) {
    return “Hi, I’m ” + name;
}
greet(“Anjana”);
// Output: “Hi, I’m Anjana”

2. Avoid side effects. Function should only process input it is given and return output, everything else is distractions (ie: process global variables, run command not intended to process input, etc). This is pure functions.
Not pure

var name = “Anjana”;
function greet() {
    console.log(“Hi, I’m ” + name);
}

Pure

function greet(name) {
    return “Hi, I’m ” + name;
}

3. Could have higher-order functions. Inputs and outputs can be functions.

function makeAdjectifier(adjective) {
    return function (string) {
        return adjective + “ ” + string;
    };
}

var coolifier = makeAdjectifier(“cool”);
coolifier(“conference”);
// Output: "cool conference"

4. Don’t iterate. Instead of iterate, use functions (map, reduce, filter).
Iterate

var fruits = ["apple", "orange", "banana"];
var goodFruits = [];
for (var i = 0; i  fruit + " great");
// Output: ["apple great", "orange great", "banana great"]

5. Avoid mutability objects. Unintended changes to objects could cause confusion and introduce bugs. Instead, use immutable objects.
Mutable

var rooms = [“H1”, “H2”, “H3”];
rooms[2] = “H4”;
// Output: ["H1", "H2", "H4"]

Immutable objects with function

var rooms = [“H1”, “H2”, “H3”];
var newRooms = rooms.map(function (rm) {
    if (rm == “H3”) {
        return “H4”;
    } else {
        return rm;
    }
});
// Output: rooms => ["H1", "H2", "H3"]
// Output: newRooms => ["H1", "H2", "H4"]

6. Persistent data structure for efficient immutability.
Instead of copying immutable objects which take time and memory (space) for every single copy, use persistent data structure that treat object as nodes and connect them in tree structure, changes of objects will only affect certain nodes, not entire object. This can be achieved with third party framework such as Mori or Immutable.js