3 ms·
I knew someone would pipe in with that suggestion as I was writing that comment! Yes, I suppose that would be the canonical way to go. But it's just one functi
by ComputerGuru 2y ago
I knew someone would pipe in with that suggestion as I was writing that comment!
Yes, I suppose that would be the canonical way to go. But it's just one function; four lines! I'm getting isEven() vibes!
- pryelluw 2y agoI package unrelated classes, functions, utilities like yours into one module/crate/library and just keep adding stuff to it. Sort of like my own standard library.
- mikepurvis 2y agoThat works for a time but it’s ultimately not great for new/external contributors to be faced with your code being full of unfamiliar idioms and utility functions coming from a single kitchen sink package.
- pryelluw 2y agoYeah strictly for my own personal use. Having a bunch of unrelated stuff in one place is bananas
- mikepurvis 2y agoYou do still see it though; a bunch of the core infrastructure packages in ROS depend on this grab bag of utilities related to console capture, cli, and colouring: https://osrf-pycommon.readthedocs.io/en/latest/ https://osrf-pycommon.readthedocs.io/en/latest/
- pryelluw 2y agoI do tend to stumble into it with hardware relates libs like ROS. Web adjacent libraries/frameworks, IMO, tends to package things a little nicer (though the js ecosystem just said YOLO).
- marcosdumay 2y agoReally don't. If that crate becomes successful, it will basically greenlight a lot of functionality that was just there because it happened to be made by the same author. And all that extra functionality will only reduce the chances of the really useful function to get into the spotlight. Both are bad for the ecosystem. If the GP has related useful little functions, yes, pack them together. Otherwise, I'd say a crate for a small little function isn't a problem at all.
- pryelluw 2y agoInteresting how it was perceived me suggesting they publish a crate with multiple unrelated functionality. My point is that I keep my own little collection of useful code. I don’t publish it as a package or crate. It’s what I suggested to the other poster.
- im3w1l 2y agoMaybe you could go looking for a home for your function in some existing crate then?
- saghm 2y agoMaybe it could fit into the `num` crate in some fashion? https://docs.rs/num/latest/num/ https://docs.rs/num/latest/num/