From: Just Another Victim of the Ambient Morality Date: 2006-08-23T04:55:13+09:00 Subject: Re: Static typing ain't so bad, after all... "Chad Perrin" wrote in message news:20060822190314.GA28969@apotheon.com... > On Tue, Aug 22, 2006 at 11:50:12PM +0900, Just Another Victim of the > Ambient Morality wrote: >> >> "Farrel Lifson" wrote in message >> news:c2c0b660608220540y3cf55b18v18c5879ce4ea55a9@mail.gmail.com... >> > >> > In my experience the way to handle this is to have parameters and >> > variables with logical, consistent names. If I'm debugging a function >> > 'foo(i)' it's almost impossible to know what is. If the function >> > instead was defined as 'foo(categoryName)' it's a lot easier to deduct >> > that it's a (string or an object that should be able to ducktyped to a >> > string). >> >> ...but this is often not enough. What if the parameter is called >> "node." > > That doesn't even address the exhortation to name your functions > properly, because "node" is a terrible name for a function unless the > operation of your program is so clearly defined and its requirements and > context so obvious that "node" becomes an explicit description of > functionality. Even then, it's probably not as expressive as it could > be. You know, it looks like you trimmed off the context and then responded that, rather than reading the post and then trimming off the unimportant parts in your response. 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...