Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

>> it's a pet-peeve of mine that people write large functions/expressions/statements as function parameters when not needed all in the name of conciseness -- I think it affects readability.

Worst thing ever. I was trying a gfx-rs example to do some drawing. One smallish function took another function as a parameter (a closure actually) so they just wrote an entire drawing function inline. The pipes helped clue me in that something strange was going on.

My own code pulled that function out into a clean definition eventually. As it should have been in example code.

It's not in the name of conciseness. Not sure what it is, but it's not that.



That looks a bit unusual even from a FP perspective. Functions get passed to functions all the time, just not defined inline very often. Unless it's the only one parameter or a very simple closure, then it could still look clean and readable.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: