[Cuis-dev] recommendations for class name prefixes
Mark Volkmann
r.mark.volkmann at gmail.com
Sat Jun 22 17:18:31 PDT 2024
As a newcomer to Smalltalk, but with many years of experience in lots of
other languages, my main concern is that I will encounter name conflicts
when using packages written by others if I don't add a prefix to my
classes. But perhaps that isn't as likely as I'm thinking. I wonder if the
situation is different if I'm creating a library of classes that I expect
many others to use. Is there a consensus that name prefixes are more
important for such libraries?
On Sat, Jun 22, 2024 at 5:58 PM Juan Vuletich <juan at cuis.st> wrote:
> On 6/20/2024 2:19 AM, Luciano Notarfrancesco via Cuis-dev wrote:
>
> It’s up to you. I don’t do it, and i think most people in Cuis dont do it
> either (perhaps becase Cuis is smaller than other Smalltalks, so it’s less
> prone to name clashes).
>
> On Thu, Jun 20, 2024 at 06:39 Mark Volkmann via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> From what I understand it is standard practice to add a prefix your
>> classes to avoid name conflicts with classes from other packages. Is it
>> recommended to do this for every class you define? Are there guidelines on
>> choosing prefixes such as their length (2?) and case (all uppercase?) ? Is
>> there a list of well known prefixes used by popular packages that we should
>> avoid using in our own class names?
>>
>> ---
>> R. Mark Volkmann
>> Object Computing, Inc.
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
> The question is: why do names clash? I can think of two reasons:
> - Duplicated concepts. A redesign is in order. Each concept should appear
> once.
> - Names are too generic. Things that are not the same are named the same.
> Renaming is in order to clarify.
>
> The only times I had names clashing, and I still wanted them to coexist
> was during merge of different codebases. For that, a rename with some
> prefix is appropriate. Any prefix would do. It should be as short lived as
> possible.
>
> HTH,
>
> --
> Juan Vuletichcuis.stgithub.com/jvuletichresearchgate.net/profile/Juan-Vuletichindependent.academia.edu/JuanVuletichpatents.justia.com/inventor/juan-manuel-vuletichlinkedin.com/in/juan-vuletich-75611b3twitter.com/JuanVuletich
>
>
--
R. Mark Volkmann
Object Computing, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20240622/3fc2984e/attachment.htm>
More information about the Cuis-dev
mailing list