May 2021
Posted 3 years ago
Something that comes up now and then in our chats in the preview discord is the subject of dependencies. A lot of people want to make an addon that relies on another addon. They want to make a base addon and then make addons based on that. Some people only want to make bases.

Runtime dependencies suck. It's something I want to stomp out in s&box. Your game should include everything it needs to run. It shouldn't be pulling in 8 different addons. It shouldn't need people to install CS:S.

Using inheritance and re-using code is smart. The issue is when you're doing that at runtime. The addon you're using updates, or is deleted, or an addon which that addon relies on is updated or deleted. Now we have a ton of addons that don't work.

So the official recommendation right now is to copy and paste code into your addon to re-use it between projects. 

If you want to make an addon based on sandbox, download the repo and copy over what you want to take from it. It won't stay up to date with changes from the official sandbox repository - but that's a good thing - you're in control.