News for hackers. Stuff that matters.

boyswan

Re:With React 16.8, React Hooks are available in a stable release on Wednesday February 06, 2019 @12:58PM (#19097686)
reasonml <3
Re:ReasonML – React as first intended on Friday May 25, 2018 @07:06AM (#17152386)
I'm only guessing that's because you have prior experience with Ember and are only starting to use react now.

I find code written in ReasonML is 100x more maintainable than anything written in javascript, whether it's react or ember

Re:ReasonML – React as first intended on Thursday May 24, 2018 @12:11PM (#17145392)
Similar to flow. JS interop is great, so you can literally change bit by bit and refactor from the inside out.
Re:ReasonML – React as first intended on Thursday May 24, 2018 @12:01PM (#17145277)
Also for your issue with deeply nested options, have a look at this

https://medium.com/w3reality/working-with-option-using-maybe...

Re:ReasonML – React as first intended on Thursday May 24, 2018 @11:58AM (#17145245)
Since moving from javascript to reason/ocaml, i'm genuinely nervous about refactoring Js now. Helpful compiler errors are literally life changing, and being able to handle options with Some/None means no more nasty undefined bugs.

You can do a lot of funky things with javascript, and it's easy to convince yourself that because you can do it, you should do it. With reason I've found I can achieve pretty much anything with a far more concise set of tools, and I can't hack my way around problems - I'm forced to deal with them the correct way.

Being forced to do things in a certain way has a massive benefit, and encourages consistency. You can look at 5 different javascript projects and each one of them will most likely be completely different.

Re:ReasonML – React as first intended on Thursday May 24, 2018 @11:51AM (#17145176)
You forgot the best bit... variants and pattern matching!
Re:ReasonML – React as first intended on Thursday May 24, 2018 @11:29AM (#17144958)
I thought this and was put off at first, but have come to the conclusion that you really don't need redux (I've used it thoroughly for years).

We've been converting a large JS react app to Reason, and strongly typed props solves a lot of problems. Passing props down multiple children is no longer a burden, and you'll never have that "prop spreading madness". For anything that reaaally requires some sort of global state, you can use the new react context api.

The only danger of writing in reasonml is spoiling javascript for yourself