Hjertnes.blog

#

June 06, 2018

Let’s test out Safari Technology Preview for a while.

Reason React

June 06, 2018

I obviously think that React is awesome. But I have been looking for a strongly typed language to use together with React for a while now.

The best option I have found is Reason. When you use a language like JavaScript, that isn’t strongly typed. You are either hoping for the best or you end up writing a lot of code making sure that what is passed to this function really is a number and not a object or a string. Or that a object have the expected elements and so on. This is something you can avoid with a strongly typed language. Because all of the checks are done when you build it, and then there are much fewer things that can go wrong in run time.

You probably don’t want a strongly typed language for smaller projects, because it takes more time to work with them. The idea is that you do a lot of “convert this string to a JSX element” etc.

Reason React is pretty awesome. You can use it almost like you would use React with some differences. One of them are that you only can have one component per file. And you do have something like Redux, but it is more like a combination of the default react state management and Redux; which unfortunately means that you don’t get something like the Connect HOC.

I’m going to use Reason for some of my side projects for now. And I think I would use it for work projects if I started them today.

Check it out if you like React, but would like something strongly typed.

The introduction of a type system makes it less elegant though. So stick with React if you want the tool that lets you build stuff as fast as possible. But it is excellent if you want something that limits the number of places with runtime errors.

Getting started with ClojureScript.

June 06, 2018

I have been playing around with ClojureScript a lot the last few months. A lot of it together with React. No matter what you do, use the “official” fighwheel lein template. I used a reagent specific one for a while, and it caused me a lot of grief. Pick either Reagent or Om(the two most popular ClojureScript wrappers for React. I personally prefer Reagent because it feels the closes to regular React.

The official figwheel template works great, no issues with it at all. I just picked another one because I didn’t know what I was doing. It compiles down to a single JS file. And you can run it through webpack or other build tools if you want to.

#

June 05, 2018

The only thing I’m excited about after the WWDC keynote is the dark mode and the anti tracking stuff in Safari.

Chrome vs Firefox

June 05, 2018

So, I have changed all my daily browsing activities over from Chrome to Firefox, because I think it is just much faster. But I still use Chrome for some stuff: 1Password X on Linux and web development. The reason I still use Chrome for web development is not because the dev tools are better, but because I like them better. Part of it is probably because I have used them since 2009, and know them in and out. And because I prefer having them on the right side of the screen instead of the bottom, the Chrome dev tools are much more adaptive to how wide they are than the Firefox are. It will probably be better and the future. But I’m going to stick to Chrome for web development.

This is very important actually. If web developers are using browser X for development, because they think the tools are better, then that app will probably work better there, because the developers spend more time using their web app there.

#

June 04, 2018

I’d probably be running towards gitlab if this was the Ballmer or Gates Microsoft; but it isn’t.

#

June 04, 2018

WWDC Keynote iOS Wishlist:

  • Terminal.app
  • Emacs.app
  • Homebrew

Autojump

June 04, 2018

I just installed autojump, and I have no idea why I haven’t done this before. The pitch is that it looks at your history of commands using “cd” and tries to guess where you want to do when you hit “j foobar”. Just install it, configure it, and leave it for a few days or weeks and then try to use it. It is awesome.

#

June 01, 2018

Three notebooks open at my desk, a Blackwing 602, a Vanishing Point and a KUM Masterpiece.

Let’s get some shit done.