Getting Started with development

+1 for that series. I’d not done any serious programming for over 20 years, and then it was mainly pure C - those vids have got me back up to speed and demystified some of the C++ syntax. I did watch about 1/3 of them back to back, and yes my head did nearly explode! I’m still finding I’m dipping back in to them for little refreshers now and then. Best of all they’re not delivered so slowly you’re shouting at the screen to “just get on with it”

1 Like

That’s the thing with them. They’re fast paced but not information overload fairly well done!

Regarding rack development - today I learned:

  • struct is used in rack for saving the “public:” line because in contrary to classes it is public by default.
  • outside of vcv coders often prefer using classes when methods are called and structs only if you’re just calling a set of data types.

Not sure if the last point is expressed correctly for reason of language barrier. Yet I am happy, that vcv rack puts me getting back into programming again (: Are there more reasons to use struct instead of class in vcv rack?

Sound correct to me. VCV’s use of struct is not something I’ve seen that often, but it isn’t difficult to get used to. And it’s for sure very versatile to have everything public so that a module can do anything it wants to.

In C++,

struct {

is syntactically equivalent to

class {
    public:

In C++, there are three common ways to encapsulate class members.

  • public/private labels: If you’re going to have private members, it shouldn’t be part of the ABI. However, a private member is still part of the ABI. This makes this C++ feature completely pointless.
  • “weak encapsulation”: simply documenting that certain symbols should not be used by certain callers.
  • “opaque pointers”: e.g. struct Internal; Internal* internal. This makes private members not part of the plugin ABI.

VCV uses the latter two methods.

2 Likes

Private members are supposed to be objects anyway, no? object obj = new object;

Huh? A C++ member is either a data member (aka class variable), member function (aka method), etc. See https://en.cppreference.com/w/cpp/language/class under “Member specification” for the full list.