Seperating Public/Private Folders

I see it a lot. People from UE4 community put their header files in Public folder. All source and some header files put inside Private folder.

There should be a reason and advantage of doing that right? What is the reason and according to what you seperate code files?

Hey Corpse0327-

The main benefit to separating files in this manor is for encapsulation. This is a term that basically means only giving access to enough of the code to use it without being able to change something you don’t want someone else to change. In this way when someone else uses the code they will be able to look at the public header and known what the code does without necessarily knowing how it works or being able to change it. In short it is a way to protect the code from being changed and possibly broken.

Cheers

So basically it is another protection barrier, when multiple programmers work on the project. Thanks for the reply.