and usually involves sort of prefixing or suffixing for every abstraction/external.
I've also done this in the past. namespacing by prepending the folder name has one advantage, though: it provides you the possibility to choose between the long (safe) and short (unsafe) name. short names are convenient in rapid prototyping while long names are preferable if things ought to be robust.
but after all, it's a matter of taste I guess.
Gesendet: Mittwoch, 03. Januar 2018 um 13:15 Uhr Von: "Derek Kwan" derek.x.kwan@gmail.com An: pd-list@mail.iem.at Betreff: Re: [PD] declare vs. namespaces - current best practice
João Pais jmmmpais@gmail.com writes:
Dear list,
I'm trying to make my abstraction library vanilla-compatible, but nevertheless I need to use some externals. Since I didn't keep up with the vanilla progress the last years, I wanted to ask what is the best method to make sure that all externals are loaded:
- use [declare ....]?
- use namespaces such as [list-abs/list1]?
To jump into this discussion, I used to be a huge believer in doing the [library/object] thing and I still try to do it with libraries that aren't of my own creation because yes, there can be name collions and it's good to take steps to try to avoid it.
On the other hand, it is a lot of typing so when I can afford not to (usually with my own abstraction/external libraries and with my own personal patchese I don't necessarily intend on having other people use), I just forego that whole thing and either do a [declare] or just import the paths in my preferences.
One strategy I try to follow with my own libraries and a strategy I have seen others follow is to try to make the names as unique as possible (which isn't as good as the [library/object] strategy but perhaps good enough) and usually involves sort of prefixing or suffixing for every abstraction/external. In my case, I usually just prefix dk to everything so my bitcrushing abstraction becomes [dkbitcrush~]. Or I've sort of put all my list abstractiosn in their own little library so I prefix everything with pdkl- (pd + dk + l for list) so my mapping abstraction is called [pdkl-map].
Derek
-- Derek Kwan www.derekxkwan.com
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list