On 9/18/07, Anton Melser <[EMAIL PROTECTED]> wrote:
>
> On 17/09/2007, Jonathan Mitchem <[EMAIL PROTECTED]> wrote:
> > Alchemi.Windows.Forms == good
>
> Could you expand on exactly how that would be done? That's a notion my
> crud-coding hasn't yet come across...
>
>
> > > I know it sounds overbearing, but I think the Alchemi code could
> benefit
> > from a "coding standard".  I've already been going through the code and,
> > while not changing the end result of how things work, have been trying
> to
> > use some "best practices" to get things into shape.  My main reference
> has
> > been the appendix of Juval Lowy's book "Programming .NET Components" --
> an
> > excellent read for anyone interested.  One of his guidelines is "Never
> use
> > Hungarian Notation except for UI elements.".  He has a lot of good
> tidbits
> > there -- I'll try to type them up if I get a chance and put them in the
> > Developer's Handbook for future reference.  Things like never using
> public
> > fields (use properties), never use public events (use event accessors),
> make
> > all On<eventname> functions virtual, etc etc.
>
> I *completely* agree with this. I have the MS framework
> recommendations book and will have a look through. We are not too bad
> apart from public fields which not only is very ugly, but actually was
> the cause of a bug! The MS UI people seem to just assume you will not
> use them so completely that things sometimes don't even work if you
> do!
>
> > > So, just so we have a list:
> > >
> > > txtTextBoxName
> > > btnButtonName
> > > cmbComboBoxName
> > > grpGroupBoxName
> > > lblLabelName
> > > mnuMenuItemName
> > > lvListViewName
> > >
> > > I can't think of the others -- chime in if you remember.
>
> I would go with tb for textbox and cbo for combo, but that is
> completely arbitrary :-). I remember seeing a "Microsoft sanctioned"
> list somewhere a few years ago (apparently the Office people still use
> it everywhere!), but it must be pretty old now. In any case, I will
> have a look for a reasonably "official" looking list (whatever that
> means!) and post it for inclusion.


Here's a website with the ones that I use.
http://condor.depaul.edu/~sjost/ndp/notes/winforms1/winforms1.htm
Section B.4.

I guess I'm still using the ones I learned back in the day when I started
playing around with Visual Basic (for DOS!!)

It's purely an intellisense thing though:
- Some people advocate prefixing all controls with "ui" or "ux", but then
all of the controls come up and it's hard to find what you're looking for.
- Other people advocate naming stuff like "optionComboBox" or
"addressTextBox", but then that requires you know exactly what the control
does "option or address" before you start typing
- Prefixing with "txt" or "btn" seems to work better (at least for me)
because I usually remember what _kind_ of control (textbox or button etc) I
want to do something with and then get a hint about the specific purpose of
that kind of control (txtUsername or btnStart).
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Alchemi-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alchemi-developers

Reply via email to