Software Design X-Rays

I have started studying this book.

To make life easier here is the link to the examples:

http://www.adamtornhill.com/code/xrayexercises.html

So far I agree with the analysis. One minor niggle is the claim that small config files don’t need tests. That’s not true for say package.json.

My dependabot usage results in dependabot making 60 times as many commits as the next user. You really need a unit test for every feature that you use in a dependency. In the node world that can be painful.

First Looks at Tailwind CSS

I am working through the book Modern CSS with Tailwind.

Tailwind is a css framework for styling a website.
It is strongly opinionated on certain things.
To start with it includes a complete reset library that removes all browser default styling for all HTML elements.
The markup is effect describing rather than semantic:

text-gray-300 hover:text-gray-700

This is intended to make the markup very easy to understand, at the price of being verbose.

Tailwind CSS 2.0 has taken the decision not to support Internet Explorer 11. This will allow a lot of modern (or technically by now non-ancient) CSS techniques to be used. This would prevent me from using it on my current client who still has a 1/6 of the users reporting as ie 11.

Microsoft have made some announcements about their support for IE11: https://techcommunity.microsoft.com/t5/microsoft-365-blog/microsoft-365-apps-say-farewell-to-internet-explorer-11-and/ba-p/1591666

Microsoft teams has already stopped supporting IE11 as of November 2020.
Microsoft 365 (the current name for the online office suite) will drop IE11 support in August 2021.
It will be interesting to see how quickly the big corporates drop IE11 support.

Concurrent Data Processing In Elixir (B2)

This book works you through the various concurrent programming techniques available to Elixir.

This is still in Beta, so not yet finished (and has the last few typos to be fixed), but is a great introduction.
It even covers some of the recently added features of the venerable GenServer so you get to see how to use handle_continue which is great technique that allows a genserver to return and still carry on working on a problem.

It starts with Tasks, introduces GenServers.
Then it moves onto GenStage (a system for using Backpressure to control the flow of data through an application.
Flow adds wrappers around GenStage to simplify the usage (it’s almost as easy as Streams).

The examples are mostly contained within individual chapters which makes picking up a topic much easier than other PragProg books that I have worked through.

Awaiting the B3 release!

Heisenberg And Death March Projects

A simple explanation of the Heisenberg Uncertainty Principle goes as follows:

You have a particle that you are trying to find out where it is an how fast it is moving. You are taking measurements by shining a laser onto it. If you want more accuracy on the location then you can shine a brighter laser. However this changes the velocity. If you want a more precise velocity then you need to use a dimmer laser. There is a finite limit to the combined accuracy or position and velocity.

There is a similar problem with projects that are deemed late. Frequently the solution is to add more frequent and intensive status reports. The problem is the addition of the status report takes away time that could be spent working so it will actually delay the result. In extreme cases the project will then never be finished as all time is taken up by reporting.

Learning Go

Later this week I am going to be assessing a developer on a Pair Programming TDD Programing Exercise in Go.
The problem is that I currently don’t know Go.

I do own the book Introducing Go from a Humble Bundle.

These are the notes that I have from working through the first few chapters.
I am basing the analysis upon the 7 Languages in 7 Weeks pattern.

Go is strongly typed.

Bracket style is K + R (opening bracket stays with the function declaration)

Integer size is machine (platform dependent)
Method names seem to use PascalCase.
Variable names use camelCase.

Variables can only be defined once per scope.
Variables are mutable.

Declared by var
The type follows the name if required:

var x string

I have not seen this in recent languages (this is a Pascal idea rather that the C style of type name)
Types can be implied by assigning with := (but only inside a function).

const allows the creation of things that cannot be reassigned.

Backticks allow for multiline strings.

Compiler warns about unused variables.

Variable names can be redefined at a different scope.

No implicit returns from functions. (Which is unusual for a modern language).
You can name the return variable, assign it and then call return.

You can return tuples from a function.

Does not handle overflows well.

func factorial(x uint) uint {  
    if x == 0 {  
       return 1  
    }  
    return x * factorial(x-1)
}

This fails on 100, and will return 0

It appears that a function cannot be overloaded.

Interfaces are implicit. You don’t need to state that you are using it.

The early versions of Go were really weak at package management. It requires you to have your code in a sub folder of the GOPATH called src. This completely insane! The language should not define the name of the folder structure.

Tests need to be named Test* and have a parameter of t *testing.T

I think I now know enough for the Pairing Interview.