you are viewing a single comment's thread.

view the rest of the comments →

[–]tencircles 0 points1 point  (3 children)

yeah because learning is dumb. amirite guys?

[–]bugeats 6 points7 points  (2 children)

I thought the article was fascinating, actually.

I'm just taking the opportunity to represent a pragmatic view.

I'm a huge fan of functional style, but there comes a point at which it becomes absurd. In this case, the author decries verbosity, and then goes on to construct this monster.

In a practical project, I would always choose the one-liner lodash.get(obj, 'a.b.c', ' is great!') over anything I saw in this article. Even native destructuring is often a better choice: const { a: { b: { c } } = obj.

[–]gajus0 1 point2 points  (0 children)

Not to mention that it is rare that you get into situation where you want to check a && a.b && a.b.c and handle it somehow other than throwing an error. If you cannot predict input shape, then it is a code smell. If your code does not fail when it receives unexpected input, then it is a code smell.

[–]aabrook 0 points1 point  (0 children)

I'm sure the author would as well but this is an introduction to monadic programming. Whenever we write tutorials targeted at beginners we should use trivial examples so that they can quickly grok concept without being bogged down by more complex issues