Forum OpenACS Development: Re: db_multirow and db_foreach -unclobber

Collapse
Posted by Don Baccus on
I've been staying out of this but I have to say I agree with Tom on this issue.

After all these years the fact that "user_id" is used confusingly just now has become a problem that needs to be resolved by adding namespaces requiring us to touch every page in the toolkit?

At the most extreme that's what's being talked about.

A couple of quick observations ...

1. Tcl is not a block-scoped language, talking about block-local vars ala Java doesn't really make sense.  It's proc-scoped.  Uplevel's not particularly cool but the way it is used in the db_* procs is consistent with the db API and easy to understand.  Given that Tcl doesn't support reference parameters I think the design's a reasonable compromise.

2. I like consistency.  Making some db_* procs work one way, others work another way is just confusing for newcomers and error-prone for everyone else.

3. "user_id", "package_id" and a few other ids are overloaded in the datamodel and ad_conn structure.  The examples mentioned above pinpoint *this* as being the real problem.  If people got in the habit of saying

set current_user_id [ad_conn user_id]

instread of

set user_id [ad_conn user_id]

then from reading this thread, at least, I get the impression that 90% of the supposed problem would fade away.

When I look at all the *important* problems we still need to solve in the toolkit I have to wonder why we would consider this particular minor issue even worth the time spent discussing it???