Since it's almost Halowe'en, I'm continuing last week's theme of truly scary code. One practice that creates scary code is mixing levels of abstraction. The problem here is that the developer is so focussed on what needs to be done that they write high level code that deals with low level details. This is a natural tendency simply because it's harder to think abstractly but the resulting code is inevitably much longer and much more complex than otherwise. For example, I could create a web application that works by listening on sockets and directly operating on the Get and Post messages. It would then compose an HTML response and send it back to the socket. This may work, but you're mixing your high level functionality with HTTP functionality and HTML writing funcitonality. This makes your application difficult to maintain and very inflexible. By writing or using layers that just manage the HTTP and HTML, you can separate the levels of concern and make each level much easier to understand than before. Download