TIL: Objects in Nim

Objects in Nim use the type constructor:

Type Definition type MusicTrack = object index: int title: string # (Mutable) Value var summer = MusicTrack(index: 1, title: "Summer in the City") That reminds me of Records in Reason:

/* Type definition */ type musicTrack = {index: int, title: string} /* Value */ let summerInTheCity = {index: 1, title: "Summer in the City"} In Nim, “An object is a value type, which means that when an object is assigned to a new variable all its components are copied as well.

Read more →

TIL: Typescript Still Coerces Types

Here's a simple TypeScript function: function f() { const a = 2 const b = 'a string' return a + b } What I expected: TypeScript can infer types. It will recognize that a is of type number and b is of type string. I expected a type error, because I try to add a string to a number. You can also be more explicit and tell TypeScript the types. Like so:
Read more →

Friday Picks 030

Read more →

Write Type Safe Applications With Reason

Read more →

Friday Picks 029

Read more →

First Thoughts About ReasonML vs TypeScript

Today I finished my first TypeScript experiment with React. Here are some thoughts after using ReasonReact first, and now TypeScript second. Setup Is Not Better Than ReasonReact I used Create React App to bootstrap the app. npx create-react-app <project-name> –typescript But then I had to setup ESLint and Prettier with TypeScript. ReasonML & BuckleScript: npm install -g bs-platform bsb -init <project-name> -theme react-hooks After that you're done. It's JavaScript
Read more →

Preparing For My First Tech Talk: TypeScript Experiments

A few days ago I started preparing for my first tech talk. One of the common questions about ReasonML and ReasonReact is: Why not TypeScript? If you're looking for a statically typed alternative for JavaScript, TypeScript seems like the obvious choice. I did a TypeScript workshop with FrontEnd Masters (online) a while ago, but I have to admit that I didn't use TypeScript in practice. The last few days I started creating a simple TypeScript React app.
Read more →

Check For Equality in Reason vs JavaScript

Reason and JavaScript are not the same languages, although the syntax looks similar. That's intentional, but sometimes hides fundamental differences of those languages. Comparing values is a common task in programming. Let's look at the equality operators. Checking For Equality in JavaScript Here's what MDN has to say: Equality (==) The equality operator converts the operands if they are not of the same type, then applies strict comparison. If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.
Read more →

Preparing For My First Tech Talk

I'm not sure how it happened. But a while ago, I agreed to hold a tech talk. 😱 Today, I was able to prepare for the talk. I woefully underestimated the amount of work! I now have a new appreciation for all the speakers. Tools I decided to use Remark.js to create slides from a Markdown file. With the CLI tool backslide you can easily automate the process. I found it painless to create decent-looking slides with minimal effort.
Read more →

Learning Update End of October 2019

Read more →