Relative Content

Tag Archive for anti-patterns

God Files versus Ravioli Code

Recently I asked a question about whether or not I should refactor my code. the responses I received were most definitely in the camp of going through with the refactoring due to the presence of a God File.

Use of interfaces to ease rapid development/prototypes

Recently I’ve started to put almost all of my data structures into interfaces, and many of the classes that contain pieces of logic code as well, depending on how much work they are. I find that this makes development of applications much easier because I can easily swap out parts of my code when they do not work as well as intended without changing the rest of the application and swap them back in when I have corrected them, or if I need something simpler for the time being.
I was wondering if I’m developing a bad habit here.

terminology for upward devolution from modules to framework

Is there a word for the problem of a framework becoming married to the software modules it supports, for example adding methods to a base class that may apply only to certain subclasses or use cases? It’s a particular kind of violation of separation of concerns.

Where and when to include assets in languages that don’t care where they are declared?

I come from c++, where one declares all assets to be included at the top of a file. That is what I have been doing with php as well. Lately I have been tempted to stray from this rule: I have a script file where I put functions I use throughout my projects, sort of like a library script. There are some functions included that require assets that no other function uses, and since one can put require_once statements all throughout one’s scripts, I have been tempted to include assets at the beginning of those functions, to conserve resources when the script is running. Is this kind of thing frowned upon in OOP, or is that OK? I guess while I am at it, should I not be doing this at all because there is a purerer OOP approach to the kind of library scripts I have been creating?