5 ms·
Data structures and algorithms are foundational topics in computer science. While they can seem daunting to beginning programmers, they become very important as
by lebanon_tn 10y ago
Data structures and algorithms are foundational topics in computer science. While they can seem daunting to beginning programmers, they become very important as you progress into writing more advanced programs. Also, the interview process for software engineers at most companies ask about them almost exclusively.
- throwaway2016a 10y ago> they become very important as you progress into writing more advanced programs As someone with a Computer Science degree I can say that the only times I have ever used any of the algorithms I learned directly was when writing low level C and GoLang. I'm willing to bet 90% of programmers... even those that right "advanced" programs do not use them day to day. Every algorithm and data structure worth anything has been abstracted out into easy to use libraries years ago.
- ashark 10y agoAny time I make the effort to learn more or brush up on CS fundamentals I end up forgetting most of it in short order because I so rarely use any of it at work. Ditto mathematics past roughly Algebra 1. Every now and then I try to brush up on calculus or linear algebra or something, but it takes so much time to keep those skills up when you're not using them at work. Like keeping up foreign language skills while living somewhere you rarely encounter native speakers.
- stale2002 10y agoOf course! But how are you going to know WHICH library function to use if you don't know what to look for in the first place? Knowing that a problem at hand requires a certain solution is important.
- throwaway2016a 10y agoYou use the one labeled "sort" and trust the standard library chose reasonable defaults. It's not like the standard lib is going to use bubble sort. If the reasonable defaults aren't good enough... you're in the 10%.
- stale2002 10y agoIt is not about choosing "sort" it is about knowing if you need your data sorted in the first place. Sure, in some situations it might be obvious, but maybe not obvious for others. And things that are immediately, blindingly obvious to a 5 year experience programmer may not be obvious to a newbie. Ex: imagine if you didn't know what a hashtable or a dictionary was and just used single variables for everything.
- jhomedall 10y agoThere's a lot more to data structures and algorithms than sorting. For example, just knowing that bloom filters or interval trees exist opens up a ton of options, even if you don't implement them yourself. For that matter, the choice of sorting algorithm can have security implications. QuickSort on user-facing data can easily become a DoS vulnerability.
- ecnahc515 10y agoSure, they'll already exist, but you need to know the performance characteristics of each, so you know when to use one algorithm/data structure vs the alternatives.
- nkozyra 10y agoYou use them every day, you probably just don't formulate it into a "is this an algorithms problem?" Very few days do I avoid evaluating what kind of/depth of loop (if any at all!) is needed to generate an output.
- caconym_ 10y agoI'm a self-taught software engineer and learning about data structures and algorithms has made a huge difference in my ability to deliver solid code. The basics of graph data structures and algorithms (DAGs, topological sort, BFS, connected components, etc) seem especially helpful, and it's good to have a constant awareness of the time complexity of the code I'm writing. I'm not talking about implementing my own sorting algorithms every time I need to sort things; I'm talking about recognizing that a particular problem can be efficiently represented by data structure X and solved with algorithm Y. Hopefully I'm writing none of this code myself, but a programmer who doesn't in theory know how it all works is never going to be able to compose pre-written code into an optimal solution. I know, because I've been that programmer. I don't know what you mean by "advanced" programs. I guess I fall within your 10% by definition, since I can anecdotally say that having and using this knowledge has made a big difference for me. I would say that I use this stuff 5% or less of my time, but for that 5% it can make the difference between run time of under a second vs. multiple days, and between a brittle, defective solution and a rock solid one. Not to mention that it's extremely handy for getting hired in the first place, and it's just plain fun.
- n4r9 10y agoI suspect that's untrue for many modern areas of development that are still "worth" something. When it comes to road routing I don't know of any .Net libraries providing modern functionality (hierarchy pre-processing, landmarks, arc flags etc...).