On Thu, Jan 24, 2002 at 12:46:00AM -0500, [EMAIL PROTECTED] wrote:
> I'm trying to decide whether to use the variable naming conventions that
> Webware uses in an RDBMS. By convention, we use "variableNamesLikeThis" in
> Python because this is what Webware uses too (trying to keep jarring style
> changes to a minimum).
>
> The problem is of course, that SQL isn't case sensitive, at least as far as
> table and column names are concerned. So, using the Webware convention when
> naming tables, columns, etc. will result in rather unreadable
> "tableandcolumnnameslikethis". For this reason, most people use underscores
> to get "table_and_column_names_like_this".
Do you actually need such long names? Mine look like this:
DataBase, TableStudlyCaps, fields user_id, createdate, moddate, name,
zip, email, is_min_price. It's not that often that I need an
underline, except I always use it in the key field (*_id).
For Python variables/keys that shadow database fields, I use exactly
the same convention. For other Python variables I've adopted the
webwareStandard. One advantage of this approach is that it makes
database variables stand out because they're different.
> I guess I'm a bit fussy in trying to avoid a jarring shift in naming
> conventions between SQL and Python, but I can't think of a nicer
> compromise. Is there a way out of all this ugliness?
Using SQL itself is jarring. But if you're going to use it at all,
it's probably easier to just accept its conventions. When in Rome, do
as the Romans. Short variable names like this:
SELECT ssn ... WHERE expdate > NOW()
will probably be easier to manage than:
SELECT socialsecuritynumber ... WHERE expirationdate > NOW()
SELECT social_security_number ... WHERE expiration_date > NOW()
--
-Mike (Iron) Orr, [EMAIL PROTECTED] (if mail problems: [EMAIL PROTECTED])
http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss