dpl.lv2 icon indicating copy to clipboard operation
dpl.lv2 copied to clipboard

Why is this C++ instead of C?

Open Zipdox2 opened this issue 4 months ago • 1 comments

I don't know about your intentions but I personally think it would make more sense for this to be C. You used the new operator to create a float array and then memset it to 0, instead of just using calloc. Sure, a C++ class is convenient, but I believe doing it in C like with dyncomp makes more sense.

Zipdox2 avatar Aug 23 '25 20:08 Zipdox2

I very much like a small sensible part of C++ for plugins, notably access specifiers for class/struct members and an implicit this, while staying close to C otherwise.

Early plugins I wrote in C99 which was often more trouble and messier. Here'd you have to pass an explicit self struct to every call, and with the number of private variables in e.g. Peaklim::process it's just very nice to use a class instance instead.

What would be the advantage of using plain C?

x42 avatar Aug 23 '25 22:08 x42