I find the visceral hatred of free functions among the Swift community really perplexing. Why did functions ever do to you all?
Conversation
It's worse in Rust because you can't make an anonymous extension, so people start making interfaces just to avoid having to make a free function -.-
3
4
I feel like if rust supported and encouraged the prelude pattern better this would be nicer.
Folks want to avoid imports as much as possible.
1
1
also peeps really like dot.syntax() 🙄
I'm cool with module::function(...) 🤷♂️
1
3
I like dot syntax in part bc it means that my editors autocomplete works much better if it can scope the functions it suggests to methods available on my type
somehow I feel like there's a true legacy of Java joke in here somewhere
1
2
Typed holes can give a similar experience, but alas not many language servers support this outside theorem provers. Would really love it for Rust.
1
3
Still harder for docs though, need some kind of ‘type search’ like hoogle to fill that gap, which could be seen as a bit hacky depending on your point of view.
roogle was my first "I'll build a real rust project ambition" lol that ended quickly
1
Dot syntax could be seen as unnecessarily biasing the ‘self’ type though. But you could argue that worse is often better. Tradeoffs, ugh.
1




