Why The ‘Don’t Touch That Framework!’ Mentality is not Pragmatic or Agile
I recently came across another framework sanctity nazi over IRC. You know the guys that freak out when you mention changing a core class or customizing what gets loaded by default or other things specific to your app. Oh, you are one too? Well maybe if stick around and read further with an open mind I can help you see things from a pragmatic perspective.
First off most new programmers or even somewhat experienced engineers should not go around messing with things in the framework classes for the hell of it. Also you should try to see if there is a straight forward way of doing what you need to do without changing framework code. It’s always best to just change a controller or the configuration if it makes sense that way. Even if there is only a not so straight forward way of completing a task without touching the framework you should weigh it out and try to avoid changing the framework.
The But…
However, if the solution costs about 3 minutes to change the framework and 3 hours to avoid changing the framework then there might be a good reason to just change the framework. For instance lets say we have are a building a web app. The web app needs to do (or not do) something on every request…no matter what. Sure I could change something outside the framework to get the app to work that way. But that is bad on many levels. First off, if someone down the road wants to change that global behavior, she will most likely look at the framework first…since it is global. Secondly, you will spend much more time testing and bug-fixing to make sure your non-framework-touching change really did work globally. That’s certainly not pragmatic.
Also, if you are working in an agile environment on a new project and are trying to make quick iterations you don’t want to spend 3 hours on something that could have taken 3 minutes just because you don’t want to touch the framework. You can always fine tune things later and refactor your code when you get to the launch phase. You can use litter markers like @todo and search for those areas you have been meaning to refactor when it makes sense to…but right now just iterate so you know you are building what they want in the first place.
Of course you can ignore the logic I pose here and continue on your path of perfectionism and framework sanctity. Or you could get stuff done.