Class naming guide

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Class naming guide

bahman
Hi all,

I noticed that since there is no `import' statement in Pharo, class
names can easily conflict.  What is the common naming strategy that you
people use to avoid that?

TIA,

--
Bahman Movaqar  (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant


Reply | Threaded
Open this post in threaded view
|

Re: Class naming guide

Damien Cassou
On Tue, May 28, 2013 at 7:13 AM, Bahman Movaqar <[hidden email]> wrote:
> I noticed that since there is no `import' statement in Pharo, class
> names can easily conflict.  What is the common naming strategy that you
> people use to avoid that?


the first two letters are often an indication of the package. E.g.,
PRPage for a Page class in the Pier package, ZnEasy for the Easy class
in the Zinc package...

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: Class naming guide

bahman
On 2013-05-28 12:07, Damien Cassou wrote:
> On Tue, May 28, 2013 at 7:13 AM, Bahman Movaqar <[hidden email]> wrote:
>> I noticed that since there is no `import' statement in Pharo, class
>> names can easily conflict.  What is the common naming strategy that you
>> people use to avoid that?
>
>
> the first two letters are often an indication of the package. E.g.,
> PRPage for a Page class in the Pier package, ZnEasy for the Easy class
> in the Zinc package...

Thanks.  I'll follow that convention.

BTW I assume there is no central place to check if the two letter
combination has already been taken or not, right?

--
Bahman Movaqar  (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant

Reply | Threaded
Open this post in threaded view
|

Re: Class naming guide

Damien Cassou
On Tue, May 28, 2013 at 10:30 AM, Bahman Movaqar <[hidden email]> wrote:
> Thanks.  I'll follow that convention.
>
> BTW I assume there is no central place to check if the two letter
> combination has already been taken or not, right?


nope. But you can ask the mailing list if you have a doubt. Don't
worry too much about that. It's easy to change all the class names
later if you see a conflict.

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm."
Winston Churchill

Reply | Threaded
Open this post in threaded view
|

Re: Class naming guide

bahman
On 2013-05-28 13:07, Damien Cassou wrote:

> On Tue, May 28, 2013 at 10:30 AM, Bahman Movaqar <[hidden email]> wrote:
>> Thanks.  I'll follow that convention.
>>
>> BTW I assume there is no central place to check if the two letter
>> combination has already been taken or not, right?
>
>
> nope. But you can ask the mailing list if you have a doubt. Don't
> worry too much about that. It's easy to change all the class names
> later if you see a conflict.

Alright then.  Thanks.

I already started coding :-)  http://smalltalkhub.com/#!/~Bahman/Simin


--
Bahman Movaqar  (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant

Reply | Threaded
Open this post in threaded view
|

Re: Class naming guide

philippeback

I am using a 3 letter prefix for my own projects. It works well too.

Lack of imports is not that bad. Cleaner code most of time.

Phil
Pharo Consortium Member

Le 28 mai 2013 12:52, "Bahman Movaqar" <[hidden email]> a écrit :
On 2013-05-28 13:07, Damien Cassou wrote:
> On Tue, May 28, 2013 at 10:30 AM, Bahman Movaqar <[hidden email]> wrote:
>> Thanks.  I'll follow that convention.
>>
>> BTW I assume there is no central place to check if the two letter
>> combination has already been taken or not, right?
>
>
> nope. But you can ask the mailing list if you have a doubt. Don't
> worry too much about that. It's easy to change all the class names
> later if you see a conflict.

Alright then.  Thanks.

I already started coding :-)  http://smalltalkhub.com/#!/~Bahman/Simin


--
Bahman Movaqar  (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant