Pointless debates on the finer points of naming your objects (moved from Combo Box Requery thread)

R

Robert Morley

I still don't buy that this is either product-specific or amateur-specific.
I've seen countless numbers of experienced, formally trained (and who
learned it on their own) database programmers on every platform I've ever
used who use "tbl" for tables, "vw" for views, "usp" for user stored
procedures, not to mention "frm" for forms, "rpt" for reports, etc., ad
nauseum.

Personally, I don't see the point of starting ALL objects in a category with
the same letters; that's generally redundant (though occasionally useful
when you're trying to distinguish between views and tables, etc.). My
general preference is to base it around the function of the object. "acct"
for account-related tables, "resp" for respondent-related tables, "list" for
simple lookup-type tables, etc. Only for objects that don't have a
significant inter-relationship with the rest of the database (i.e.,
localization tables, user preferences, etc.) do I use the generic "tbl",
"frm", or whatever.

And while "tbl" itself may have first appeared in a Smart Access article in
1993, as I said, Hungarian notation itself pre-dates that. As I said,
Simonyi Károly (aka Charles Simonyi) did indeed work at Microsoft, but he
started Hungarian Notation back when he was working for Xerox. It's hardly
a surprise that it later appeared in a Microsoft product that he worked on.
Hell, ignore Hungarian notation for a moment, how long ago did people start
using "i" for integer? "For i = " was one of the first constructs I learned
almost 30 years ago.


Rob
 
B

BruceM

If the debates are pointless, why are you adding to them? Name things as
you choose. For myself it would be confusing if account-related tables,
queries, forms, and reports all start with the same prefix, but that's just
my preference.
 
R

Robert Morley

Because my professional pride hates being insulted by being called an
amateur even more than I hate being drawn into pointless debates. :)


Rob
 
S

Sylvain Lafontaine

Like everything else in the world, to much is like not enough. When writing
some piece of code, you must write it in a way that will convey the maximum
quantity of useful information to the programmer but without cluttering the
whole thing, because at this point the process will become
counter-productive: instead of diminishing the possibility for the
programmer of writing a bug, it will increase it.

« how long ago did people start using "i" for integer? "For i = " was one
of the first constructs I learned almost 30 years ago. »

For those interested, this old notation came from the first commercial
version of Fortran and had then a functional purpose: all variables
beginning with one of the letters i, j, k, l, m and n (taken from the
enumeration i .. n corresponding to the first two letters of the word
INteger) were automatically declared to be of type integer and all others
were dimensionned as float by default.

In fact, in Fortran 4, I'm not even sure if you could dimension a variable
beginning with one of the letters i .. n to *not* be an integer. (Since my
old manual of Fortran 4 is gone since a very long time, I can't no longer
verify this point.) In Fortran 5, you can easily declare one of these
variables to not be an integer but still, if you don't say otherwise, they
will be of type integer by default.
 
R

Robert Morley

Is that where we get it from? I never knew! Apparently you've been
programming even longer than I have! ;)


Rob
 
R

Robert Morley

Like everything else in the world, to much is like not enough. When
writing some piece of code, you must write it in a way that will convey
the maximum quantity of useful information to the programmer but without
cluttering the whole thing, because at this point the process will become
counter-productive: instead of diminishing the possibility for the
programmer of writing a bug, it will increase it.

Actually, I found a hilarious web page about that by yet another Canadian:
http://mindprod.com/jgloss/unmainnaming.html
 
B

BruceM

I looked through the other thread. I have to say I'm puzzled that a naming
convention would sort of cheapen the program in the view of some. I'm not
clear if those who think poorly of using prefixes for objects would prefer
no naming convention at all, or what exactly, but in any case it seems in
rather a different category than lookup fields in tables.
When I first started learning about Access I was taught to put prefixes onto
fields (txt for a Text field, dat for Date/Time, and like that), but I soon
discovered that I much prefer to use prefixes for controls in particular. I
also use them prefixes objects, so I therefore know that if it does not have
a prefix it is a field. Works for me, even if it offends some.
Best regards.
 
T

Tim Ferguson

And while "tbl" itself may have first appeared in a Smart Access
article in 1993, as I said, Hungarian notation itself pre-dates that.
As I said, Simonyi K roly (aka Charles Simonyi) did indeed work at
Microsoft, but he started Hungarian Notation back when he was working
for Xerox.

For a good description of the history of "systems Hungarian" and its
misapplication see Joel on Software:

http://www.joelonsoftware.com/articles/Wrong.html

Tim F
 
M

mnature

BruceM said:
If the debates are pointless, why are you adding to them?

Arguing with programmers is like wrestling with a pig in the mud.

After a few hours, you realize that the pig likes it.
 
R

Robert Morley

Good article, though I was already aware of the differentiation between
Systems & Apps Hungarian (though I can never remember their formal titles
until I re-read articles such as that one...the names just never made sense
to me).

Going back to the "tbl" concept, though, at some point in this long chain of
messages over multiple threads, I seem to remember stating that I only use
"tbl" for generic tables that have no other logical grouping within my
database (or code, or whatever it is I'm looking at), and that I tend to
group and name tables by logical function ("acct", "resp", etc.)
otherwise...that it seemed a little redundant to name everything of a
certain object type or data type with the same prefix. Isn't that basically
what the article is advocating?

I *do* consider Systems Hungarian to be a perfectly valid alternative for
those that find it's useful to them, though for what I do, I find it a
little limited in its own right. My personal preference is to use a hybrid
of systems & apps when coding, where the first lower-case prefix is
descriptive of the data type (with reasonable exceptions...I don't know
ANYBODY who uses something like lngHWnd), and the first upper-case prefix is
descriptive of the logical grouping, (i.e. strAcctFilename, which is very
obviously a string relating to an account, and is a file name). But there
are those who prefer Systems Hungarian, and as long as they keep it
localized to their own code/database/whatever and don't try to impose it on
mine, that's fine. (As you can imagine, I was NOT best pleased with the Web
developer who went and copied all my stored procedures that started with
"web" to indicate they were used on the Web to a simple "usp" prefix. Who
on earth ever gave System Administrator privileges to a *student* web
developer?!?)

Anyway, all things considered, I think we mostly just misunderstood each
other from the start of this conversation. You know what the say about
assumptions! :)



Rob
 
R

Robert Morley

Arguing with programmers is like wrestling with a pig in the mud.
After a few hours, you realize that the pig likes it.

Dare I ask how you came to this conclusion (about the pigs, that is, not the
programmers)? <grin>


Rob
 
M

mnature

Robert Morley said:
Dare I ask how you came to this conclusion (about the pigs, that is, not the
programmers)? <grin>


Rob

After arguing with programmers, the pig was a nice break . . .
 
S

Sylvain Lafontaine

Many people here will post examples of code using prefixes such as tbl or vw
only because they are writing only a few lines of code instead of a full
database and they need to make these very few lines to be a much clear as
possible; with no other background.

Myself, I often write here things MyTable or MyView; however, I will never
use the names MyTable or MyView in one of MyDatabase.
 
R

Robert Morley

Like I said, for myself, I don't generally stick to simply "tbl" or "vw" or
whatever unless there's no other logical prefix, but I can think of at least
one argument in favour of doing it that way: when you're looking at someone
else's code, you know EXACTLY where to go if you need to look at the design
of the table, view, SP, or whatever else.

The record/field vs. row/column discussion is something I've heard before,
and I've always thought that calling them rows & columns to look more
professional or well-educated was "bass-ackwards". To me, spreadsheets have
rows & columns; to apply those terms to a table is to relegate it to the
level of a spreadsheet (or at best, a pre-relational-database table).

But hey, I'll be the first to admit that I started out in Access and
expanded my expertise from there, so maybe my views are a little biased
towards the historical Access ways of doing things. :)



Rob
 
B

BruceM

It's interesting how much of the discussion is about how using one system or
another will appear in the eyes of somebody else. I learned about a naming
convention that makes sense, so I started using it, and found it to be
helpful. It had nothing to do with being a "wannabe". Did you choose the
naming convention you use because you "wannabe" like somebody else? If not,
why do you assume that somebody using another naming convention is driven by
such a motivation?
 
T

Tim Ferguson

Like I said, for myself, I don't generally stick to simply "tbl" or
"vw" or whatever unless there's no other logical prefix, but I can
think of at least one argument in favour of doing it that way: when
you're looking at someone else's code, you know EXACTLY where to go if
you need to look at the design of the table, view, SP, or whatever
else.

Unless what used to be a table is now a view, (or vice versa, though less
likely). Access does not easily provide the tools to go hunting through
every reference to "tblSomething" and change it to "vwSomething". Nor,
for that matter, "txtDescriptionType" to "cboDescriptionType", but that
is a different argument.
But hey, I'll be the first to admit that I started out in Access and
expanded my expertise from there, so maybe my views are a little
biased towards the historical Access ways of doing things. :)

To be fair, it was Microsoft itself that pushed Hungarian notation as its
own house style. I don't believe that the company ever understood how
good Access was and they don't seem to have cared either. As for the
programming style, they have now reverted completely, and prefixes are
AbsolutelyOut for anything based on the new versions of VisualStudio --
or should that be visualStudio?

All the best


Tim F
 
R

Robert Morley

Unless what used to be a table is now a view, (or vice versa, though less
likely). Access does not easily provide the tools to go hunting through
every reference to "tblSomething" and change it to "vwSomething". Nor,
for that matter, "txtDescriptionType" to "cboDescriptionType", but that
is a different argument.

Yes, I've run into that problem. I currently view called "tblPreferences",
which is a hanger-on from when tblPreferences was stored as a local table in
a replicated MDB, but then got upsized to SQL Server and had to be done as a
view based on the current user.

There are a number of good search & replace utilities for Access...for some
reason, I just haven't gotten around to using it on tblPreferences yet! :)
To be fair, it was Microsoft itself that pushed Hungarian notation as its
own house style. I don't believe that the company ever understood how
good Access was and they don't seem to have cared either. As for the
programming style, they have now reverted completely, and prefixes are
AbsolutelyOut for anything based on the new versions of VisualStudio --
or should that be visualStudio?

Yes, so I've heard. Personally, I don't give a rat's ass what's in or
out...as many have said, I use what works best for me (and since my
programming team at work is a whole two people, and I'm the lead programmer,
it pretty much works that way there, too <grin>).



Rob
 
R

Robert Morley

Yes, I've run into that problem. I currently view called
"tblPreferences",

Ummm...apparently I'm just randomly dropping words from sentences. That was
supposed to read "I currently have a view", of course. <blush>



Rob
 
Top