4 ms·
Over and over, I see code written by star professionals that you've heard of, reinventing the bubble sort. I'm guilty of it myself. > It's a bit like saying i
by WalterBright 5y ago
Over and over, I see code written by star professionals that you've heard of, reinventing the bubble sort.
I'm guilty of it myself.
> It's a bit like saying it's silly for pilots to have to know what to do in the case of engine failure or stall from memory and regularly practice in a simulator, because that stuff rarely happens and most of the time they're just using autopilot. That's true, it usually doesn't matter, but when it does... it matters a lot.
Well, we now know what happens when pilots forget the runaway stabilizer trim procedure (turn off the stab trim).
- XorNot 5y agoI mean this is also what happens when pilots aren't following their checklists though.
- WalterBright 5y agoChecklists in an emergency are the same idea as Dealer's Strategy in blackjack. If you've got nothing better, or are under so much stress you can't think, or don't have time to think, do Dealer's Strategy. But sometimes, pilots are needed to recognize when the checklist isn't going to work, and can innovate on the job. That's why we still have pilots on airplanes, as a computer can follow a checklist.
- tubby12345 5y agoif 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
- 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.