views:

184

answers:

5

I would like to get my feet wet contributing to Gnome projects. I've downloaded svn sources of various projects and tried to explore the code but obtaining a working understanding of any of the projects, even the simpler ones like Eye of Gnome, seems intractable.

I admit, I am used to developing C/C++ in IDEs such as Eclipse CDT which have the ability to "Go to definition" for function calls and variable usage--this kind of feature is very useful for understanding how execution happens. Of course, one could use grep for this, but it seems a bit obtuse (for me).

So my question is, what tools have helped you explore code you're not familiar with? Is there a good IDE? or perhaps a way of importing projects into an IDE? Do I just need to "deal with it" and struggle my way through with a plain old text editor?

I would love to get involved, I just need a little advice :)

A: 

I'd suggest using a good text editor like Kate (or I guess gedit, since you're Gnomey).

Grepping would be odd, I agree. You might try 'ctrl-f'.

Alex JL
The logic for mentioning grep is thus: if you're editing file1.c which calls cool_function() and want to know where cool_function() is defined, you could do "grep cool_function() *" in the directory where all the source files are.
wilsoniya
+1  A: 

Nothing's stopping you from using Eclipse CDT... There's also Anjuta DevStudio written for the Gnome desktop environment, and it works pretty well with C/C++ projects. MonoDevelop is popular among the Gnome/.NET crowd. KDevelop is the only IDE I've ever liked using -- it integrates well with absolutely everything under the sun. (It's useful even for non-KDE stuff.)

If you just want stuff like "Go to definition" etc., Vim and Emacs have that too, with help from ctags.

Personally, I normally use Vim+ctags and ack as a super-grep. On a larger project, it's often worthwhile to run Doxygen -- it's a documentation generator, but even without those special documentation comments, it'll give you a convenient overview of your classes and function call graphs. Then again, I'm in the "just deal with it" camp; it just takes some time and effort to load the whole structure of a project into your brain, and then you're good to go.

If you want to contribute to EoG, but still haven't got a good workflow, go ask its developers what they use :)

ephemient
Brilliant response! I learned a lot of new toys/tools from your post. Ack and ctags are both amazing. I've used Doxygen, but for some reason never though to generate call and dependency graphs for oss projects. Good stuff, all of it. I owe you a beer!
wilsoniya
+1  A: 

You could look into etags and cscope for "go to definition" functionality. I'm don't how well they integrate with Eclipse.

vinc456
A: 

Sorry about being a bit flioppant with the ctrl-f suggestion; What I was thinking of actually is how in Kate, the 'Find in Files' function at the bottom of the screen will do that.

It will search the directory your file is in, and bring up a list of all mentions of the pattern as with line numbers. You can double click to go straight to the reference in each file. (it is implemented within the program using grep, actually)

Alex JL
+2  A: 

If you want to get your feet wet, there's a program just for you: Gnome Love. Maintainers have gone through the effort of saying "these bugs should be easy for a new person to fix", so that's a great start. Its where I started, anyway (Sound Juicer, to be specific. That is a nice clean codebase).

MighMoS