I already have problems reading arrow/inline functions... for example where a method is called with a function that returns a function... if there is one more (async) call in there my brain starts smoking.
Stages of Denial
51–60 of 119 posts
Re: Stages of Denial
#52I think the article tries to make it sound more mysterious and groundbreaking than it really is.
Re: Stages of Denial
#53Earlier quoted context omitted.
Not quite. + isn’t the last thing done (which it would be in Polish notation). Instead it’s done during the / operation. Polish notation would be lisp (or the notion most people have for lisp, special forms and macros break it up a bit).
Lisp is polish notation for trees of variable arity. hence all the parens - you need some way to group them. So in some K flavoured LISP I think it would be ((/ +) (! 100))
(->> 100 range (reduce +))
which is equivalent to this, without the macro (reduce + (range 100))Re: Stages of Denial
#54I recently started using rust-analyzer with vscode. One common sight is this: thing .stuff() .other() .whatevs() Each of the calls returns a different type. Rust-analyzer displays the return type of each call to the right of it. I imagine something similar could reconcile the benefits of terseness with readability and discoverabilty. The blog post already has the prototype: + / ! 100 plus reduce range 100 Imagine the…
So what would be the benefit compared to just writing `plus reduce range 100`?
Re: Stages of Denial
#55Re: Stages of Denial
#56This is a category of cursed knowledge which causes psychic damage to the reader. When you go down certain rabbit holes you develop a fascination with obscure forms of programming and start to realize it has some powerful benefits of which you can never take advantage because it isn't widely adopted. To free yourself from this curse write ten regular for-loops in C and say a prayer to K&R while tighly holding your co…
Re: Stages of Denial
#57{x#x{x,+/-2#x}/0 1} I'm sure if you used K for a year or so, that would be obvious and understandable at a single glance. But all I can think of is that I used to see that in my terminal session right after my modem got disconnected.
I think the same problem applies. If you don't remember the specific of a symbol it becomes difficult to understand what the symbol might be without context.
Re: Stages of Denial
#58Earlier quoted context omitted.
Huh, I had no idea that function had variable arity. Thanks.
Funnily enough, that variable arity is mentioned in the article as a nuisance: > ... wincing slightly at the lambda notation you need to avoid running afoul of JavaScript’s variadic Math.max()...
list.reduce((x,y)=>Math.max(x,y))
To get the max number in a list. And he is "winching" because he can't write: list.reduce(Math.max)
Because the variable arity of max does not play well with reduce. But because of the variable arity he can write: Math.max(...list)
Which is even simpler.So he deliberately writes overly complex JavaScript code to show how the other language is more concise.
Re: Stages of Denial
#59Earlier quoted context omitted.
Funnily enough, that variable arity is mentioned in the article as a nuisance: > ... wincing slightly at the lambda notation you need to avoid running afoul of JavaScript’s variadic Math.max()...
It is a typical language-comparison strawman. He is writing list.reduce((x,y)=>Math.max(x,y)) To get the max number in a list. And he is "winching" because he can't write: list.reduce(Math.max) Because the variable arity of max does not play well with reduce. But because of the variable arity he can write: Math.max(...list) Which is even simpler. So he deliberately writes overly complex JavaScript code to show how th…
So worthwhile keeping in mind that the nice JS code falls apart.
Re: Stages of Denial
#60I'm torn. Not about the conciseness of the language overall, but about using symbols vs. names. I do see how the symbols make things more concise, less clutter, and can even make it easier to grasp a piece of code if you are deeply familiar with them[1]. On the other hand, there might be a limit. I do know how it is to use the Haskell lens package only occasionally, and then having to lookup again what the operators…
> I'm torn. Not about the conciseness of the language overall, but about using symbols vs. names. I do see how the symbols make things more concise, less clutter, and can even make it easier to grasp a piece of code if you are deeply familiar with them[1]. I think the "if you are deeply familiar with them" is important. Using non-standard symbols makes comprehension more binary: either you've memorized them and under…