Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

find main() and follow the parts that interest you - that's how I start with reading a new codebase


first thing I did. Opened the main.c, tried to follow the include files. That's where the problem starts, as it branches out I start to lose track.

When ever I start reading code, my confidence hits rock bottom. Seriously, I just feel really bad about myself and just walk away.


Try opening it up in an editor/ide with ctrl+click to step into function or similar like gvim or eclipse(and hopefully a way to jump back. eclipse also has a nice expand macro feature which lets you look at macros fully expanded and at different expansion stages.


you are a life saver. Kind of embarrassed that I didn't do a Google search on that one.

I just found ctags. :D !


darn forgot to mention ctags. If you are up for it supposedly scope is better but I couldn't get it set up. I don't know of any vim plugin for eclipse like macro expansion but if you see hairy macros you can always do gcc -E |vim - (gcc -E does full includes so macro expansion + importing of all headers)and search for your code or jump to the bottom.


> supposedly scope is better

cscope?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: