Hungarian Notation [Was Re: Too many aliases]

Hungarian Notation [Was Re: Too many aliases]

am 06.08.2011 18:58:43 von Jan Steinman

> From: Johnny Withers
>=20
> http://en.wikipedia.org/wiki/Hungarian_notation

"The original Hungarian notation... was invented by Charles Simonyi... =
who later became Chief Architect at Microsoft."

Ugh. That explains a lot!

The only time I let types intrude on names is with booleans, which I try =
to name with a state-of-being verb, such as "has_paid", "is_member", =
"has_children", etc.

> On Thu, Aug 4, 2011 at 9:41 AM, Mike Diehl =
wrote:
>=20
>> Well, while we're on the subject of SQL style, can anyone tell me why =
I'm
>> always seeing people prefixing the name of a table with something =
like
>> "tbl?"

----------------
You can't do anything about the length of your life, but you can do =
something about its width and depth. -- H. L. Mencken
:::: Jan Steinman, EcoReality Co-op ::::


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dgcdmg-mysql-2@m.gmane.o rg

RE: Hungarian Notation [Was Re: Too many aliases]

am 07.08.2011 04:02:13 von Martin Gainty

--_1e25cd38-b58a-4daf-acf3-9cfaf3061450_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Jan-
the upside is you dont have to look up a variable to know what type it is:
zVariable is Null termed string
bVariable is boolean
nVariable is an Integer
fVariable is a float
dVariable is a double..
cVariable is a char

Martin=20
______________________________________________=20
easy peasy..Shawshank Redemption


> Subject: Hungarian Notation [Was Re: Too many aliases]
> From: Jan@Bytesmiths.com
> Date: Sat=2C 6 Aug 2011 09:58:43 -0700
> To: mysql@lists.mysql.com
>=20
> > From: Johnny Withers
> >=20
> > http://en.wikipedia.org/wiki/Hungarian_notation
>=20
> "The original Hungarian notation... was invented by Charles Simonyi... wh=
o later became Chief Architect at Microsoft."
>=20
> Ugh. That explains a lot!
>=20
> The only time I let types intrude on names is with booleans=2C which I tr=
y to name with a state-of-being verb=2C such as "has_paid"=2C "is_member"=
=2C "has_children"=2C etc.
>=20
> > On Thu=2C Aug 4=2C 2011 at 9:41 AM=2C Mike Diehl =
wrote:
> >=20
> >> Well=2C while we're on the subject of SQL style=2C can anyone tell me =
why I'm
> >> always seeing people prefixing the name of a table with something like
> >> "tbl?"
>=20
> ----------------
> You can't do anything about the length of your life=2C but you can do som=
ething about its width and depth. -- H. L. Mencken
> :::: Jan Steinman=2C EcoReality Co-op ::::
>=20
>=20
> --=20
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=3Dmgainty@hotmail.c=
om
>=20
=

--_1e25cd38-b58a-4daf-acf3-9cfaf3061450_--

Re: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 01:03:43 von Arthur Fuller

--20cf3071c69697460a04a9f2570d
Content-Type: text/plain; charset=ISO-8859-1

I despise this sort of notation, and have instead adopted what have
cheerfully named Hungarian Suffix notation, the reason being Signal-To-Noise
ratio. Instead of prefacing everything with some form of prefix, just do the
opposite:

Customer_tbl
Customer_Dead_boo
Customer_DOB_date
Customer_qs (that means Query Select)
Customer_qu (that means Query Update)
Customer_qd (that means Query Delete)
CustomerOrders_tbl
Customer_frm (a form that opens the Customer table; could involve subforms,
but in that case they are named Customer_Orders_fsub,
Customer_Payments_fsub, and so on.

Easy to read, obvious the intent, and easily sortable. Just my opinion.

Arthur

--20cf3071c69697460a04a9f2570d--

Re: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 01:32:40 von David Lerer

SSBqb2luIHlvdSBBcnRodXIuIFRoYXQgSHVuZ2FyaWFuIG5vdGF0aW9uIGlz IGRlc3BpY2FibGUg
KHRob3VnaCBJIGxvdmUgbGlzdGVuaW5nIHRvIHRoYXQgbGFuZ3VhZ2UsIGl0 IGlzIGRpZmZlcmVu
dCkuDQpJIGRvbid0IGZpbmQgaXQgbmVjZXNzYXJ5IGZvciBhIGNvbHVtbiBu YW1lIHRvIHRlbGwg
bWUgaXRzIHR5cGUuICANCkJ1dCBJIGRvIGxpa2UgdGhlIGFiaWxpdHkgdG8g a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sIGp1c3QgZG8gdGhlDQpv cHBvc2l0ZToNCg0K
Q3VzdG9tZXJfdGJsDQpDdXN0b21lcl9EZWFkX2Jvbw0KQ3VzdG9tZXJfRE9C X2RhdGUNCkN1c3Rv
bWVyX3FzICh0aGF0IG1lYW5zIFF1ZXJ5IFNlbGVjdCkNCkN1c3RvbWVyX3F1 ICh0aGF0IG1lYW5z
IFF1ZXJ5IFVwZGF0ZSkNCkN1c3RvbWVyX3FkICh0aGF0IG1lYW5zIFF1ZXJ5 IERlbGV0ZSkNCkN1
c3RvbWVyT3JkZXJzX3RibA0KQ3VzdG9tZXJfZnJtIChhIGZvcm0gdGhhdCBv cGVucyB0aGUgQ3Vz
dG9tZXIgdGFibGU7IGNvdWxkIGludm9sdmUgc3ViZm9ybXMsDQpidXQgaW4g dGhhdCBjYXNlIHRo
ZXkgYXJlIG5hbWVkIEN1c3RvbWVyX09yZGVyc19mc3ViLA0KQ3VzdG9tZXJf UGF5bWVudHNfZnN1
YiwgYW5kIHNvIG9uLg0KDQpFYXN5IHRvIHJlYWQsIG9idmlvdXMgdGhlIGlu dGVudCwgYW5kIGVh
c2lseSBzb3J0YWJsZS4gSnVzdCBteSBvcGluaW9uLg0KDQpBcnRodXINCg==

Re: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 08:13:58 von Mike Diehl

On Saturday 06 August 2011 10:58:43 am Jan Steinman wrote:
> > From: Johnny Withers
> >
> > http://en.wikipedia.org/wiki/Hungarian_notation

Well, I can see this being useful in assembly language, or strongly-typed,
non-OO languages. But I was asking specifically about SQL!

When will this EVER make sense:?

select * from intCustomers;

We know from context that customers is a table and it makes no sense at all to
prefix a type to it in order to make the obvious more clear.

I guess we could have:

select * from viewCustomers;
or
select * from tblCustomers:

But really?

My personal convention is that table names are plural. Foreign indexes have
the table name as a prefix. For example.

create table customers (
id integer, index.
companies_id integer,
name varchar(20)
);

Obviously, companies_id is a reference to the id field in a table called
companies.

Just my $.02, but any comments are welcome.

> "The original Hungarian notation... was invented by Charles Simonyi... who
> later became Chief Architect at Microsoft."
>
> Ugh. That explains a lot!
>
> The only time I let types intrude on names is with booleans, which I try to
> name with a state-of-being verb, such as "has_paid", "is_member",
> "has_children", etc.
>
> > On Thu, Aug 4, 2011 at 9:41 AM, Mike Diehl wrote:
> >> Well, while we're on the subject of SQL style, can anyone tell me why
> >> I'm always seeing people prefixing the name of a table with something
> >> like "tbl?"
>
> ----------------
> You can't do anything about the length of your life, but you can do
> something about its width and depth. -- H. L. Mencken
>
> :::: Jan Steinman, EcoReality Co-op ::::

--

Take care and have fun,
Mike Diehl.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 16:25:43 von Jerry Schwartz

I was a reluctant convert, and still don't use Hungarian notation
consistently; but in something like MS Access, where you might want to
associate a label with a field, things like "lblCompany" and "txtCompany" make
a lot of sense.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341
E-mail: jerry@gii.co.jp
Web site: www.giiresearch.com

>-----Original Message-----
>From: Martin Gainty [mailto:mgainty@hotmail.com]
>Sent: Saturday, August 06, 2011 10:02 PM
>To: jan@bytesmiths.com; mysql@lists.mysql.com
>Subject: RE: Hungarian Notation [Was Re: Too many aliases]
>
>
>Jan-
>the upside is you dont have to look up a variable to know what type it is:
>zVariable is Null termed string
>bVariable is boolean
>nVariable is an Integer
>fVariable is a float
>dVariable is a double..
>cVariable is a char
>
>Martin
>______________________________________________
>easy peasy..Shawshank Redemption
>
>
>> Subject: Hungarian Notation [Was Re: Too many aliases]
>> From: Jan@Bytesmiths.com
>> Date: Sat, 6 Aug 2011 09:58:43 -0700
>> To: mysql@lists.mysql.com
>>
>> > From: Johnny Withers
>> >
>> > http://en.wikipedia.org/wiki/Hungarian_notation
>>
>> "The original Hungarian notation... was invented by Charles Simonyi... who
>later became Chief Architect at Microsoft."
>>
>> Ugh. That explains a lot!
>>
>> The only time I let types intrude on names is with booleans, which I try to
>name with a state-of-being verb, such as "has_paid", "is_member",
>"has_children", etc.
>>
>> > On Thu, Aug 4, 2011 at 9:41 AM, Mike Diehl wrote:
>> >
>> >> Well, while we're on the subject of SQL style, can anyone tell me why
>> >> I'm
>> >> always seeing people prefixing the name of a table with something like
>> >> "tbl?"
>>
>> ----------------
>> You can't do anything about the length of your life, but you can do
>> something
>about its width and depth. -- H. L. Mencken
>> :::: Jan Steinman, EcoReality Co-op ::::
>>
>>
>> --
>> MySQL General Mailing List
>> For list archives: http://lists.mysql.com/mysql
>> To unsubscribe: http://lists.mysql.com/mysql?unsub=mgainty@hotmail.com
>>
>




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 18:44:09 von (Halász Sándor) hsv

>>>> 2011/08/08 00:13 -0600, Mike Diehl >>>>
Well, I can see this being useful in assembly language, or strongly-typed,
non-OO languages. But I was asking specifically about SQL!

.....

We know from context that customers is a table and it makes no sense at all to prefix a type to it in order to make the obvious more clear.
<<<<<<<<
I suspect it makes the most sense in weakly typed languages, and, therefore, quite useless in table names. TAble names are not found in the same context as field names, and the same name may be used for both table and field in the table--field names, on the other hand, ....

In the PL1 (and scripting-language) tradition, although in the table definition there is fairly narrow description of the type, much implicit conversion is allowed. It is also in the PL1 tradition that operators yield values of some vague type ('+' yields number, '||' yields character: no general operator overloading), but with all the conversion it seldom is clear to the user what a generated field s exact type is: even which numeric type, even which character type, with what length. Then there is room for tacking type descriptions onto names.

>>>> 2011/08/08 00:13 -0600, Mike Diehl >>>>
My personal convention is that table names are plural. Foreign indexes have
the table name as a prefix.
<<<<<<<<
To me a table is like an array, and therefore I make it singular: "invoice", say, is an array of invoices, and "invoice [ 5 ]" is invoice 5. My plurals are for counts of things; if "invoice" is a table, then
select count(*) as invoices from invoice


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

RE: Hungarian Notation [Was Re: Too many aliases]

am 08.08.2011 19:59:27 von (Halász Sándor) hsv

>>>> 2011/08/08 10:25 -0400, Jerry Schwartz >>>>
I was a reluctant convert, and still don't use Hungarian notation consistently; but in something like MS Access, where you might want to associate a label with a field, things like "lblCompany" and "txtCompany" make a lot of sense.
<<<<<<<<
I forgot this--my VB teacher consistently recommended it.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org