4 ms·
Does anyone have tips for how to navigate new code bases faster? I feel like I would have given up reading through the code before I found the issue discussed i
by mucle6 2y ago
Does anyone have tips for how to navigate new code bases faster? I feel like I would have given up reading through the code before I found the issue discussed in the article
I didn't read through the code but maybe the library was small and this was just a case of checking the difference between c++ and js by line for 1k lines or something
- markerz 2y agoThere’s plenty of strategies. In this case, if you can see two code based behaviors have diverged, just run both through a step by step debugger and see where they diverge. Or if you run both through a profiler, you can see what segment of code is taking a crazy amount of time in comparison. In general, narrowing down what you’re looking at is the goal. In this case, a big hint is that the code should be O(nlogn) but is actually O(n^2) which is a huge hint that we’re in a nested loop and the break condition isn’t getting triggered properly. I would have looked closely at the loops because of this. The code itself is ~400 lines long minus a bunch of comments. This feels very approachable to skim through in an hour. I also love creating new variables and naming them what I’m learning. Often times naming things will make bugs very obvious.
- euroderf 2y ago> I also love creating new variables and naming them what I’m learning. Often times naming things will make bugs very obvious. Agreed. There should be a formalish name for this technique/style.