4 ms·
"I've never heard a manager or developer say: If only we had someone that could write an algorithm to solve this travelling sales person problem we'd be saved!
by davesims 14y ago
"I've never heard a manager or developer say: If only we had someone that could write an algorithm to solve this travelling sales person problem we'd be saved! No. Inefficient algorithms are often good enough, typical programmers muddle through and yes pick up a textbook or reference wikipedia once in a while."
Exactly, or google it and find the difference between between the different sorts, or look at any one of the great visual representations of sorting strategies. I've seen otherwise very accomplished coders throw up a crappy bubble sort and move on because it just didn't matter. And it didn't. In any case, 95% of the time those sorts have already been implemented in your Hash object or database or somewhere else in your languages collections library.
I've been doing this...Good Lord nearly 15 years now -- mostly in the middle-tier and lower, so I've had plenty of opportunity -- and I can't even fill up one hand with the number of times that I had a problem that required anything beyond rudimentary algorithmic analysis, much less a deep examination of sorting efficiencies, etc. Those are solved, cut-and-paste problems, the least of your worries.
The list of technologies you give is spot on. I'd add to that: good data modeling/object design, testing/TDD (if you're into that), security issues to be aware of (XSS, SQL injection, mass assignment), classic performance killers like n+1 queries, on and on.
And yes, the change bit -- as a coder you can never assume you've learned your craft. You're always learning it. We're not blacksmiths that get better and better at one thing over the years and arrive at something like "mastery."
We're attention-deficit polymaths that have to scramble week-in, week-out just to maintain competence on the current problem, while anticipating the trends that will be turning the apple cart over a year from now. Remember in 2008 or so when RIA was the buzz-cronym and everyone was talking Silverlight, Flash and the lot? And 4 years from now who knows what the acronyms will be. We may all be laughing about how awesome we thought HTLM5 was going to be (probably not, but in this business...)
- foobarian 14y agoIf someone gave me a sort implementation in a code review, I'd have to seriously wonder how the heck that person got hired. Libraries exist for a reason. Sorting is a good example, though, because it is often complicated not because the algorithm is hard, but because the sorting criteria rely on heterogeneous data, sometimes coming from multiple services. Coming up with a clean code design in such cases is challenging, and that's where good developers shine.