file_ref = open(string_ref)

James J. Besemer jb at cascade-sys.com
Tue Apr 23 13:56:36 EDT 2002


Greg Weeks wrote:

> Is this code
>
> C1:     file_ref = open(string_ref)
>
> better than this?:
>
> C2:     file = open(string)

I would vote for C2 for the simple reason that C1 stinks of Microsoft's dreaded
"Hungarian" notation.  It may have use in assembly code and maybe even in C but
I think encoding object types into object names is not only unnecessary it
creates a maintenance hazard.  If you wanna know the type, look at the
definition.  Better, choose good class, instance and method names so that your
code is clear without having to be reminded of the class name.

Regards

--jb

--
James J. Besemer  503-280-0838 voice
http://cascade-sys.com  503-280-0375 fax
mailto:jb at cascade-sys.com







More information about the Python-list mailing list