Cookie Consent by Free Privacy Policy Generator

[n]

w33 thoughts

a post after the long break

types

Open Source

After a long break, I developed internal peace and energy started to fontain inside of me. I invested some time into my small npm package. The the package is a library that dereministically generates name and date of birth. It can be handy to those who want to fill data with fake personal data.

I "rewrote" the package to make use of TypeScript. I learned how to setup linter. (Though I still do not get why a separate formatter is needed apart from a linter.) I also getup continuous integration and continuous delivery. I used GitHub Actions and spend extra couple of hours because the documentation misses one line. 🤷‍♀️

In general this is not the first time and I think I enjoy the process and with every setup or iteration it is in general easier because more concepts are familiar and more common issues are expected. Concepts of actions/steps/stages/jobs and triggers are main elements of pipelines. Common issues are version mismatch between the node version and project packages or visibility of environment variables.

Books

Riscutia, V., (2020). Programming with Types Shelter Island: Manning

My mentor, Stefan Reichel, is a type wizard. He was quite into type system and showed a number of tricks for TypeScript. Here is one example of how optionality can be better typed:

type Maybe<T> = T | undefined;

One of Reichel's recommendations was to have a look at "Programming with Types". Riscutia gives in-depth example of the Mars Climate Orbiter that illustrates how deadly could carelessness to types be. He shows how unique symbol can overcome TypeScript structural subtyping. I found this charming.

I plan to invest a bit more time to complete the challenging exercises and see how can the author's examples live in different cases. My experiments can be found here. I particularly like iterators and want to learn more about this nice language construct/pattern.

Send
Share
Send
Share