The one thing about both writing to your own specification, and writing object-oriented code is that things because obfuscated as it’s contained in your own mind – something of which that is free to do what it wills when you’re laying out your own plans. An untidy mind leads to untidy code, which is why staring at the screen for hours on end leads to crappy code, in my opinion. What I do wonder though is at what point does an object outgrow its responsibility? For example I’m writing some network code at the moment which has a connection object. This object has the ability to send and receive messages, but internally the functioning of the system is quite complex, but of course it need not be exposed.
When sending and receiving data there’s a a considerable amount to think about. Threading is important as queues are required when both sending and receiving data as – whilst processing plain text can be quite quick – there can be a chance that too much comes in at a single moment, perhaps caused by some network lag. So already we have two nestings within the connection object dealing with both the sending and receiving of data by pulling data off the queue, and pushing data down the network. So now we have two threads spinning on the network, two queues, at least the observer pattern, input and output streams.
The object is designed to send and receive data, which is how it’s handled externally, but can an object take on too much internal responsibility? I tend to dwell on that.