I'm on the verge of finishing my library for a project and I have a simple question.
Is it okay to use a lot of void functions in a class? Is there some ,,law" that's saying that isn't 100 percent fine? (like for example the global variables versus local). What I want to achieve is efficiency and performance.
It's your library, mate, so you define the laws. Nobody can say otherwise, since only you (as far as I'm aware of) know the implementation better than anyone else. If your library needs a strange looking function, so be it.
Functions that return void do not return anything (obviously), so there's no data to push onto the stack when the function call ends. 1 instruction less is better than 1 instruction more. It's difficult to determine which techniques you're better off using without knowing what the library actually does.
Remember! Nobody knows the code better than the original author.
For me it was like I finally made a good library with a purpose and I was asking myself if it would be a better version of this, if there's a possibility in making it better than the actual one. My mind's wheels started spinning off and you can imagine what was the outcome.