|
|
|
|
|
by DatBear
2922 days ago
|
|
Go to definition is insanely useful. Just because you "write good software," and are able to put everything in exactly the correct place, and find everything without it, doesn't mean that everyone else does, or the guy next to you does, or that you aren't wasting your time by not using it. Go to definition isn't just for multiple inheritance hierarchies. It can be as simple as getting to another method in the same file 50 lines away, or to a child class's method which is in exactly the right spot, and you'd be easily able to find. It's not about where it takes you, it's about the speed at which it takes you there. You press one button and you're back to getting through the control flow of the code without interrupting your thought process by having to search for a method. Press another button and you're back to where that method ends. Yes, you don't need it, but the speed that it offers you is invaluable a lot of times. |
|
But that's exactly my point. Jump-to-definition features slow you down. The only real exception is if the code's overall organization is extremely pathological and you wouldn't have a chance of mentally caching the local layout relevant for some work you're doing.
Flipping around to different files is super easy to do in any number of ways, with various shortcuts and macros. "Go to definition" features do not differentiate themselves based on that.
The difference is if you navigate to a section of code intentionally because you know it contains what you're looking for, or if you let yourself be taken to that place and then have to orient yourself around what you find.
For me anyway, the mental difference is huge. "Go to definition" means that after the quick keystrokes for invoking that feature, there will follow a noticeable slowdown while I figure out where I am.
Imagine two different ways of teleporting somewhere, like say a restaurant. In one way, you can say, "teleport me to wherever this pizza was made" but when you appear there, you won't know the prices, the etiquette, the lay of the land.
In the other way you say, "Ah, I know where this pizza was made, take me to X" and your mind is already set to the expectations and you're ready immediately.
The mere typing difference of saying "take me to X" with a few extra keystrokes instead of a shortcut keystroke for "take me to where this was made" is not relevant, plays no part in what matters for quickly moving around in the code.
I think this mental distinction, especially added up over thousands and thousands of "go to definition" invocations, is a huge thing. Your productivity takes a tiny hit each time you do the unplanned context switch.