Think in object orientation: Put related nouns and verbs together: it is much easier to organize your thoughts using constructors and methods. However do not use virtual methods unless you really must, and if you do, make the class a well-defined explicit interface having only abstract methods. That said, avoid using implementation inheritance: overriding one defined method for another.
Get rid of pointers: When passing objects by reference, using references instead of pointers, especially reference to const, makes code much easier to read. When combined with vector instead of raw arrays, most uses of raw pointers go away.
Do not implement your own fancy data structures: instead use the Standard Template Library. I use STL map, set, and vector all of the time and they remove the need for most other data-structures. Also, when you can, use iterators to traverse these containers, rather than the visitor pattern. Using iterators keeps the control flow of the client contiguous, so it is much more flexible than visitors.
>Do not implement your own fancy data structures: instead use the Standard Template Library. I use STL map, set, and vector all of the time and they remove the need for most other data-structures.
Don't the STL tree and map data structures have notoriously poor performance?
From memory, std::map is comparatively slow because the spec requires pointers to indices to be stable. In practice it is slow; see khash and many others
Personally i don't think this matters too much; you're using c/c++; you're already fast
Get rid of pointers: When passing objects by reference, using references instead of pointers, especially reference to const, makes code much easier to read. When combined with vector instead of raw arrays, most uses of raw pointers go away.
Do not implement your own fancy data structures: instead use the Standard Template Library. I use STL map, set, and vector all of the time and they remove the need for most other data-structures. Also, when you can, use iterators to traverse these containers, rather than the visitor pattern. Using iterators keeps the control flow of the client contiguous, so it is much more flexible than visitors.