Sunday, July 30, 2006

 
Comprehending Source Code

In my last entry I explained how to find out exactly which files are part of an environment. Once you have the right set of files identified and loaded into an editor, the next logical thing is to be able to navigate the source code and find all the relationships in the code.

As you probably know e uses Aspect Oriented Programming (AOP). There are a lot of theoretical explanations of AOP, but suffice it to say it means that data structures can be "extended" to add more fields and methods from anywhere. This extend concept leads to 2 challenges. First, it's hard to find all of the extenstions and get a complete view of the fields and methods in a struct or unit. Second, it means nobody every edits any source files for fear somebody else is using them the way they are so they just make a new file and add some extends. This leads to many files to manage. It's actually a good thing as long as you have InnerLoop as the tool to handle the navigation. If you have emacs or vi them AOP makes your life miserable.

The most important shortcuts to remember are:
ctrl-. to go to the definition of an item
ctrl-/ to get all the references for an item
ctrl-, to pop back from a definition to the original location.

These 3 key strokes will save 95% of the searching and grepping engineers do so it makes sense to master them. These are especially useful if you need to work with other people's code or code from an eVC that you did not write.

Please don't try to write a perl script or create some tool that tries to make HTML links for all the extends, it's not worth your time, just get InnerLoop.

InnerLoop has other interesting features to set bookmarks and move to them so you can save markers in important places, but that's a topic for another day.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?