MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ecanvas
Post subject: Standards for field names?  PostPosted: Jul 17, 2006 - 03:59 AM
Registered Member
Registered Member


Joined: Jul 17, 2006
Posts: 6

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?
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Jul 17, 2006 - 03:30 PM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

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 ;)

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
ecanvas
Post subject:   PostPosted: Jul 18, 2006 - 02:34 AM
Registered Member
Registered Member


Joined: Jul 17, 2006
Posts: 6

Thanks, especially for the tip about refactor not being supported!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits