Question about general good practice

Hi there.

I have a general question about development…

In my testApp.ccp file I now have about 15 functions which are getting pretty long and it takes me forever to find each one.

What is the best way of staying organised?


Use an IDE: or at least a code-aware text editor.
Most obvious candidate IDEs for OF, depending on your operating system are
X-Code (MacOS)
Visual Studio (Windows)
Code::blocks, Eclipse (Linux, MacOS, Windows)

You could also get by using a more fully-featured editor like Emacs or Vim.

Sorry I should have been more specific…

I use Xcode. Because like many others I have arrived here through processing, I have missed the part where you learn the ‘proper’ way to organise your code.

I already have different .cpp files for a couple of classes, such as my sound engine but my testApp.cpp file still looks pretty messy! Would you generally use markers or have more .cpp files, for example?


first of all:
this is a good start, imho

in java (processing) you have packages… in c++ one could easily do:

#include "MyBrunchOfCodeOrganizedInFolder/example.cpp"  

and just add the subfolder MyBrunchOfCodeOrganizedInFolder to src/

dann, a good advice i think could be: a little bit of design pattern[1]. organizing classes in factory, facade, mediator, etc… is what software engineering does. it is not easy at all but it’s really powerfull to make modular, flexible and reusable code.

last, you could look for namespace?


Thanks nkint that is exactly what I was looking for. The idea of having a ‘modular’ way of storing code makes a lot of sense to put projects together easier.

Thanks a lot. M