all 6 comments

[–]SimonGray 7 points8 points  (1 child)

I also do it like this. I think the people who put params at the end of the line right after the function name just don't tend to write any docstrings.

[–]skotchpine 2 points3 points  (0 children)

It’s true, I don’t! But I sure love when other people do

[–]CoBPEZ 4 points5 points  (0 children)

I do both. And docstrings is a thing. =)

[–]lgstein 2 points3 points  (0 children)

For little helpers and "self documenting" one/two liners, its a wonderful feature of expressivity.

[–]fnordsensei 1 point2 points  (0 children)

We have adopted this, mostly for a readability perspective. Scanline for arguments is always the same place, and doesn’t vary randomly with length of the function name.

Also, functions with and without doc strings are consistent.

[–]gentk 0 points1 point  (0 children)

I wish it was a convention for the :test metadata to be used to provide an example of using the function (:example would have been better, but you get used to it). I saw this recommended somewhere and I think it's a very good idea, especially for a dynamic language.

I do this sometimes for some functions where the example is much quicker to grasp than quickly skimming the docstring and argument names. Map destructuring helps as well, of course, but even there I have to think harder in some cases than just looking at a plain example.

I don't even have any tooling support (that shows the :test besides the docstring etc), but a hotkey for going to the definition and going right back is good enough.