On the other hand, performance is a big deal. I do believe that if you use extract method several times with small amounts of code in it over a large block of code it hurts performance by a small amount. But when this code is called constantly and the application depends on it running super fast everything slows down significantly. There are times when OOP is critical to be used but having ugly code that runs in 0.0000003 seconds compared to 0.01 seconds and it is being called over a billion times, I'd much rather prefer the horrifying looking code than something that is amazing looking but takes forever. I'd much rather have Windows move files in less than a minute compared to an hour.
Job security is one of the other things that comes to mind. If you write code that no one else can understand, you are less likely to be fired. If you have something that looks like it is summing up some data but in reality is just sorting that data and the comments make zero sense, then that is job security. It doesn't mean that if you write horrible looking code constantly, that could easily be written very nicely, is a good idea. It just means that if there is some function that ties the whole system together and you are the only one who knows how it works and where to add/remove things that is pretty good.
The book on refractoring does have some really useful ideas for one to use after they have written the code or having to make changes to existing code later. I know for sure I won't be writing code and then spontaneously decide to "Replace Type Code with State/Strategy". I'd much rather have the code working perfectly first then clean it up.
This is the last CS 373 blog entry I'm going to write. So to any hardcore followers, you should know where to find me on the internet.
No comments:
Post a Comment