Hacker News new | past | comments | ask | show | jobs | submit login

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.




[flagged]


Hi! 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


[flagged]


Hi! Please refer to my previous comment.


I 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...


>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.


every one says this, yet I've had on multiple occasions debug terrible implementations of lists/stacks. someone's lying


If 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.


> 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`


Left-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.


Bubble sort is really bottom of the barrel.


what 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.




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

Search: