On 8/22/06, Just Another Victim of the Ambient Morality
<ihatespam / rogers.com> wrote:

>     In my example, "node" is a parameter and an object, not a method name.
> It's curt but it's not entirely a bad name, as long as it is a node of
> something that has nodes.  It could be more expressive but just as my
> example demonstrated (the context that you trimmed in your response), it's
> hard to expand on it.  You could say what type of structure it is a node
> for but that doesn't help that much unless you're intimately familiar with
> that structure.  In my case, what would really have helped is if I can find
> the definition of one of these nodes that will be passed in (so that I may
> become intimately familiar with that structure).  In my case, I think there
> is only one type that will ever be passed into this function but, of
> course, that's hard to tell...

Almost anyone can write hard to understand code in any language - I
try to comment anything that might be unclear in the code I'm writing.
Particularly I maintain a lot of C# code where arb names are invented
for objects, making it hard to guess their function.

But you are right that it's normally easy to determine the structure
of objects passed to functions in C# - normally as easy as
"right-click->go to definition". Since most of my Ruby functions get
called with only certain objects as parameters, I wonder if a clever
text search wouldn't be able to guess at those objects. Of course,
just looking at the function it would be impossible to tell, but a
clever search might be able to see:


def PrintMarks(marks)

has been called only by:
PrintMarks(marks)

and above that is:

marks = markSheet[0]

and somewhere before that is:

markSheet[0] = StudentMarkTable.new

etc.

Of course it might not be worth the effort to write such a thing, I
have certainly not needed it badly enough.

Les