facebook

Standards for field names?

  1. MyEclipse Archived
  2.  > 
  3. Matisse/Swing UI Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #254859 Reply

    ecanvas
    Member

    Java Newbie questions –
    Is there a generally followed naming convention for the labels, fields and other components on a Matisse form?
    Do most developers use the default names or modify them to make the code more readable?
    Is there any downside to changing the names?

    #254887 Reply

    Riyad Kalla
    Member

    There is no downside to changing them, but try and do it when you create them then leave them along, renaming them from the form doesn’t do a refactor operation yet, so if you are using the veriable a lot of places in code (like listener implementations) that could become a problem.

    I always change the names to something useful. For example nameLabel, nameCheckBox, nameTextField, okButton, cancelButton, browseButton. I always append the name of the Swing type after the name of what the control does, sometimes it leads to really long names, but I prefer more descrip code over short names that are hard to decode. I hate seeing things like rsvButton, or lktCheckBox… I have no idea what that means if it’s not my code and just makes my life harder as a developer. So from time to time I’ll have something like userPaidInDollarsCheckBox, but atleast the developer that comes behind me to work on that code knows exactly what it does 😉

    #254953 Reply

    ecanvas
    Member

    This message has not been recovered.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Standards for field names?

You must be logged in to post in the forum log in