Forum OpenACS Development: Re: ad_parameter deprecated in favor of parameter::get?

response:
  • OpenACS is the Unix of the web toolkit world. It is not PHPnuke. It is not WebGUI. It does have a learning curve. It is also by and for programmers.
  • the style of naming only optional parameters is very well-known among programmers. Flouting conventions just for the hell of it does not, as Tom says, make things easier for the novice; it only confuses those with experience in Tcl which is after all one of our target audiences.
  • If you seriously think parameter::get -parameter foo is more clear than parameter::get foo then you are probably the kind of C programmer who uses indexForMyArray in his for loops instead of i. With 15 years of C experiencee you must understand that this is not "saving a few keystrokes;" it's simply bad form, and frankly you can't call yourself proficient in C until you understand this and other idioms.
Naming all parameters is the wrong solution to the wrong problem. If your variable names make sense, 99% of the time it is obvious what you are doing. Writing my_proc -userId $user_id would be pretty silly, but that is what you are advocating. Or db_foreach -name my_query -sql $sql -body {...}. How about util_close_html_tags -htmlFragment $html? Or if the nsd guys subscribed to this style, nsv_set -nsvArray my_nsv -nsvKey $key -nsvValue $value?

As I said above, if you really want to help newbies, write an etags howto. Naming all parameters is misguided at best.