6 ms·
if i need a toposort in my proprietary task scheduling system, or fisher–yates shuffle in my proprietary ranking system, what do you recommend? this isn't hypot
by tubby12345 5y ago
if i need a toposort in my proprietary task scheduling system, or fisher–yates shuffle in my proprietary ranking system, what do you recommend? this isn't hypothetical - i've had these things come up in the last half at work.
- YZF 5y agoThere ya go: https://www.boost.org/doc/libs/1_78_0/libs/graph/doc/topological_sort.html https://www.boost.org/doc/libs/1_78_0/libs/graph/doc/topolog...
- tubby12345 5y ago
- YZF 5y agoI don't think anyone is saying never implement an algorithm. There's a time and place. I've seen code bases where these algorithms had ten different implementations, some of the with subtle bugs, some of them with some performance issues. Your code will also need to be maintained down the line. There's more to software engineering than writing toposort. Obviously(?) my Boost proposal was made in jest. Anyways, maybe I'm a little bit jealous that you get to do this all the time ;) I just hope I'm not the one that has to maintain it down the road...
- tubby12345 5y ago>I just hope I'm not the one that has to maintain it down the road... i'm good at what i do - my implementations are clean. they got that way (surprise surprise) as a side-effect of me implementing many times.
- trollytroll69 5y agoevery one says this, yet I've had on multiple occasions debug terrible implementations of lists/stacks. someone's lying
- sol_invictus 5y agoHi! Please refer to the HN guidelines, especially the following section: > Be kind. Don't be snarky. Have curious conversation; don't cross-examine. Please don't fulminate. Please don't sneer, including at the rest of the community. You can find the guidelines here: https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- tubby12345 5y ago
- sol_invictus 5y agoHi! Please refer to my previous comment.
- tubby12345 5y ago
- eternityforest 5y agoIf you're doing things in C++ you're already doing very specialized stuff, nobody can advise without actually knowing the app well. Especially if you have an app that rubs in all those different situations. But... boost seems pretty common. Everyone seems to complain about it, but if it replaces a whole pile of hand written things, it looks like it could really bring some consistency to a project. I've never done serious C++ outside of embedded though, so I don't have Boost experience. In a dynamic language like JS, you'd search for "Graph theory algorithms library" and probably find one with ten million downloads, investigate the maintainer a bit, and use it.
- mehrdada 5y ago> In a dynamic language like JS, you'd search for "Graph theory algorithms library" and probably find one with ten million downloads, investigate the maintainer a bit, and use it. Mmm... `leftpad`
- eternityforest 5y agoLeft-pad was as far as I know written by one person. Had they used underscore or lodash or any of those bazillions of utility libraries out there, that have real code review, and are actually making money, this would be way less likely. That's why I'd look for a graph algorithms library first, not a topo sort specifically, I'd be looking for larger one size fits all libs likely to be maintained by a larger group and have more eyeballs on them.
- WalterBright 5y agoBubble sort is really bottom of the barrel.
- tubby12345 5y agowhat was your point? that it's silly to reinvent the wheel over and over. so i gave you an example of a wheel (two) that often needs to be reinvented.