[PD] declare vs. namespaces - current best practice

Derek Kwan derek.x.kwan at gmail.com
Wed Jan 3 13:15:37 CET 2018


João Pais <jmmmpais at 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



More information about the Pd-list mailing list