DEV Community

Discussion on: "Elm Has Me Leaping For Joy"

yossarian profile image

Nice article. Not sure about the refactoring though. With rem and xor additions readability decreased. Not sure why it make it better, especially with the former?

As Martin Fowler once said 'Good programmers write code that humans can understand.'

vincecampanale profile image
Vince Campanale Author

I actually find the refactor more readable, but one man's variable is another man's constant I guess. To me, rem looks like remainder and xor is reminiscent of "except". The former is simpler and more traditional, but less semantic. At the end of the day though, it's a very simple exercise so I would have felt like I missed an opportunity to improve if I just solved it quick and moved on :)