by Davertron on 8/23/22, 5:01 PM with 36 comments
Looking for any tips you all might have for making this easier.
by dschuessler on 8/23/22, 5:25 PM
F12: Go to definition
Shift+F12: Go to usages
Ctrl+-: Go back
Ctrl+Shift+-: Go forward
Once you get used to it, it's as easy as browsing the web.
Since I started using VSCode I did not have to work with codebases that were complex enough to make these features valuable but some VSCode language extensions support tree views of call hierarchies and type hierarchies. Here's the documentation for the Java extension.
https://code.visualstudio.com/docs/java/java-editing#_call-h...
https://code.visualstudio.com/docs/java/java-editing#_type-h...
You can set keybindings for them too.
by BlackFly on 8/23/22, 8:09 PM
Most code (especially legacy code) has more branches than typically matter: the majority of branches is error handling or special cases and can be ignored when investigating core functionality. Executing the happy path test case for the functionality I want to extend or bug fix and then stepping through the code with a debugger or manually is my usual mode.
I use IntelliJ myself. Being able to step through with a debugger can be a huge help to show actual implementations used in polymorphic code but few test suites are sophisticated enough to guarantee the possibility. Sometimes I will refactor code simultaneously in order to make it more comprehensible; that obviously requires some tests and experience but if you have the tests take the time to gain the experience and otherwise write the tests! Especially BDD style tests, the kind that survive refactoring.
by rpigab on 8/24/22, 7:17 AM
by jjk166 on 8/24/22, 4:25 PM
by nameless912 on 8/23/22, 6:26 PM
- <spc>gd = go to definition
- <spc>gr = open a hovering window filled with references to symbol
This is enough to get through every codebase I've yet encountered (Go, Typescript, Python, Java, C++). I also like to use <C-I> and <C-O> in vim which allows you to jump between the most recently viewed locations.
For keeping context, I just write everything down! Either in a scratch file or on a digital notetaking app on my iPad.
by swah on 8/23/22, 6:51 PM
by c7DJTLrn on 8/23/22, 8:08 PM
I should probably use an IDE but I just don't like them. Sublime is insanely fast and lightweight. I don't want to wait for anything to happen and I find my current workflow allows me to navigate codebases quickly anyway.
by livinglist on 8/23/22, 6:28 PM
by kejaed on 8/23/22, 11:26 PM
by johncoltrane on 8/25/22, 7:14 AM
by badpun on 8/24/22, 10:07 AM
by i_have_an_idea on 8/24/22, 12:56 AM
In the old days when I did more Java dev, I used Eclipse to view where things are defined and find usages.
by factorialboy on 8/24/22, 5:41 AM
Otherwise, searches for file names and contextual links, usages etc.
by _smmt on 8/23/22, 9:11 PM
by dswilkerson on 8/24/22, 12:00 AM
run strace or ltrace on it;
grep: works better with editor assistance, such as emacs M-x grep;
write documentation for it;
factor out parts of it;
by fifteenth on 8/24/22, 5:50 AM
by livueta on 8/23/22, 6:58 PM
opengrok is nice if you want code search and navigation in a web interface
by aprdm on 8/23/22, 10:12 PM
Take some rough notes on a google doc / gedit so that I don't forget paths that I've explored previously
by mickotron on 8/24/22, 9:13 AM