5 ms·
Getting better at algorithm/data structures has made me a much better programmer. People say "oh I'll never use that" but doing graph and tree problems got me m
by dimmke 5y ago
Getting better at algorithm/data structures has made me a much better programmer. People say "oh I'll never use that" but doing graph and tree problems got me much better at writing pure recursive code. I instinctively know how to write algorithms now that are much more performant.
Last night I decided to write a React component that can render formatted JSON in the browser, with collapsing etc...it took me about 4 hours. There's zero chance I would have been able to do that without that experience. I would have just looked for a library to do it.
So yeah, I highly recommend it.
- deleted 5y ago[deleted]
- ornornor 5y agoHow did you learn these? I tried CTCI but I found it so mind numbingly dry and boring that I couldn’t read it for more than five minutes without falling asleep.
- bourgoin 5y agoIsn't CTCI basically just a workbook? It has ~20 pages of intro and then problems and solutions. So it's not really a book you 'read' anyway, it's one you work through. I think the way you get really good at data structure/algorithms problems is by doing a lot of them and there's no way around that.
- ornornor 5y agoSo grinding leetcode in other words?
- machiaweliczny 5y agoGo with "Grokking algorithms" and then with "Algorithms unlocked" to get some intuition. Then I recommend intro about alogirithms design from "Cracking the coding interview". Then i would read "Algorithm design manual". Then if you are interested add CLRS. After that MIT advanced courses and papers. Supplement with solving whole leetcode and you will be a beast.
- thoughtpalette 5y agoThanks for the recommendations.
- dimmke 5y agoIt depends on where you're at. I'd recommend taking a course on data structures to brush up first. Then LC until you are doing Mediums. Then, it's just a matter of trying to figure things out and reading up on solutions. I dig in where I feel like I really don't understand a concept.
- random_kris 5y agoBut isn't using a library generally better idea than to roll your own stuff ? At least that is my approach to programming.
- killingtime74 5y agoYes generally. However to evaluate how good a library is, do you not need to know what it is doing?
- dimmke 5y agoWhether or not using a library is better is highly dependent on the problem you're trying to solve. Sometimes there isn't a library. Sometimes the library hasn't been updated in years. Sometimes you need only 10% of a library's functionality but have to import 100% of it. Etc... But the problem - and I say this as someone who was like this for years, is when you reach for a library before attempting to actually understand the problem or what the library is doing. Then it's just Google driven development. And you better hope that the library has example code you can copy and paste and modify to fit what you're trying to do, because when you don't understand anything about what's going on under the hood that's mostly what you're going to do. Like I said, I was like this for a long time. Libraries were a black box to me. I still work with people who are like this. In the article this comment thread is about, he talks about how he released an open source library for doing advertising on Windows Phones and got tons of Issues from other "developers" wanting new feature/changes. Their mindset isn't "I could add this myself" or put in a pull request, this guy who I am relying on to do a part of my job for me -for free- needs to fix this. Ultimately, you don't grow as a developer when you think like this. You don't grow to become the kind of developer that makes libraries. It also gets harder and harder to be effective the more senior you get. Because if you need a feature the package you're relying on doesn't have, you're SOL.
- random_kris 5y agoGood points thanks for clarification. My general approach is to treat libraries as black boxes untill they I need more from them or they behave weirdly... Then I try to understand them. I've been lucky that the area that I am working on has well documented and up to date libraries. Working this way allows me to be faster than most of my coworkers who try to understand every piece to the fullest.