12/23/2011 ~ 5 min read

Somewhere To Think


I need somewhere to think and rant a little bit. I am not one to question how it is done. However it has been left to figure out on my own what things do and how they do it. This in and of itself is not a problem. Where my problem comes from is two factors. First, there is no system documentation so the only way to get information is to either read the entire source or grep through it with target words. Oh, I can also dump class functions and variables but that seems to only be good as a last resort. Second, and this is what is disappointing with regards to most of this code having been written by the Senior Systems Architect. While personally he is a nice guy I am not seeing very good code. Lets look at Assets. None of the functions in Assets make sense. In an OO sense the models Assets would be a collection of type Asset. When we need to manipulate a bunch of Assets in a business logic way we use or extend functionality here. When we need to transform/modify or apply business logic to a singe system entity called an Asset we code that functionality there. Instead we create an Asset and apply business logic to it in Assets class. But isn’t business logic supposed to live in the controller? Basically, this is the third job where I see a bare minimum of an attempt to apply OO/MVC to the system or the project. It seems that everything at these small shops with minimal experience resorts to just get it done with spagetti code and worry about it later. Unfortunately, as I try to write tests later I have to pick the head of the developer who wrote the code. I can only do that when he is here. Sigh. Whats the point in telling yourself that you do OO or MVC if it is only applied in the loosest sense of the term and the way it is applied only makes sense to the developer who coded it. Perhaps this is the norm or just normal for small boulder tech(ish) like companies. IDK, all I know is that I don’t understand how or why some things are done the way that they are and it’s turning my tests into the same type of code I see in the application. A bunch of nested if/elseif/elseif (catch that one corner case and do something else to it) else functions that are several hundres lines of code long. What would I do differently if It had been me? Write my tests first, then write the code that makes them pass. Keep my functions under 50 lines of code. If I get into some weird business case that requires nested loops and branched logic refactor it out into it’s own function call. I don’t have a right answer for what I think is wrong, but as I get deeper into the system and try to apply tests the way I see done in examples, tutorials and by the professionals I think there is something wrong in the way our system is put together. Is it Zend? Could be but just because their documentation is horrible doesn’t make it a bad framework. So while I don’t think it is Zend, I think modern web application development has moved beyond the way it has to be used to put an application together. SInce I am just an average coder figuring it out as I go along I could be totally wrong but more and more so I don’t think so. So how would I get said Senior Systems Architect to listen to me? How do I get the project manager and company owner to understand that if they do not refactor now they will spend more time training new developers and fixing hacked legacy code to adress one off corner cases as they arise. There is value in doing it right, making it look good even if no one else will ever see it. I think the value of ding it right is like interest in relation to the time value of money. Right after you invest some money and earn interest on it you get only a little return. But after years and years of compounded interest you get large return on the small initial investment. Like in software though, in life it is hard to discipline ones self to make the regular investments so that you get the bigger payoffs later on. Life intrudes, we forget and then its to late you are stuck with what you have. In life to little retirement to actually retire and in software a legacy system that costs as much to maintain as it does to continue development on.


Headshot of Matthew Hippely

Hi, I’m Matthew. I live in Ventura County, and spend my time thinking about systems, software, and how things evolve over time.

You can find me on GitHub, LinkedIn, or read more about me here.