3 ms·
It's generally good practice to read a library's documentation to understand how to use it - there's not really a short cut to that, regardless of the language.
by dymk 3y ago
It's generally good practice to read a library's documentation to understand how to use it - there's not really a short cut to that, regardless of the language.
As for the syntax, you know that `event` is a method, passed the param `:ignite` and a block, and in that block, you call the method `transition` with kwargs `{stalled: same, parked: :idling}`, and `same` is another method call.
- heleninboodler 3y agoIndeed I know all of this. But in terms of "what this code does," the information that a method is passed a block that calls another method is not particularly interesting. The major problem I have with this sort of DSL is it encourages people to infer what it does based on what the ad hoc method names make it sound like this is intended to do. So many of these custom DSLs are documented by example rather than by any decent specification. The attitude that these clever little grammars make it so you can "just read it and it's obvious" is, in my opinion, sloppiness in code comprehension taken to an extreme.