Recent

Author Topic: Is it good practice to leave Unit1 named "Unit1" ?  (Read 3142 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Is it good practice to leave Unit1 named "Unit1" ?
« on: July 22, 2011, 07:51:14 am »
Is there any caveat to leave the default as unit1 and not rename it?

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: Is it good practice to leave Unit1 named "Unit1" ?
« Reply #1 on: July 22, 2011, 10:11:30 am »
Simple, Unit1 means all and nothing... if you need to edit your code after some time, or someone else is need to do it, Unit1 doesn't say what that unit do. So it's very good practice to rename default unit names. (Use refactoring, Source -> Refactoring -> Rename identificator or Shift + Cmd/Ctrl + E)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Is it good practice to leave Unit1 named "Unit1" ?
« Reply #2 on: July 22, 2011, 12:28:24 pm »
Thanks Shebuka.

That's what I thought and have tried to do as you suggest but found it a little hard to put the right name to begin with, or at least I often don't like the first name I give to things, and I want to change later. In code it seems I got it now. But as long as I am just learning I think I can leave it default, and rely on the Project Folder's name, which I can and do change easily.

What I mean is I've used the same project over and over to study different ways of doing things, so I've just been changing the folder names.

Later I will try the refactoring..I've clicked into it but did not dare to use it yet.

Thanks for the good explanation.

 

TinyPortal © 2005-2018