I've stumbled upon code project that is organized something like the following:
Namespace TheProject
{
public class SerialPortManager
{
public class RingBuffer
{
// Clears the buffer
public void Clear(SerialPortManager theManager)
{
}
}
}
}
Here's an example of a method call:
spm.RingBuffer.Clear(spm);
I'm surprised this code doesn't result in the program crashing. What are some of the implications of the code being organized this way? Can this result in memory leaks? What other problems might I be looking at? Or is this a legitimate but quirky way to organize code?