As I was working on my API last week a few times I looked up implementations of the patterns I was using. The number of different ways to implement a pattern often times makes me wonder how can you call each of them the same pattern. The GOF book can not be the definitive reference. The number of things written about the quality of patterns in that book is enormous. Everybody has got a better way. The reasoning why one implementation is better than another really comes down to quibbles. In the end it is a way to solve a problem. When doing embedded devices you always want to eek out that last little bit of performance because everything real-time can depend on it. I tried a couple of the different patterns that are similar. The profiler could not pick up the difference. It was a bit time consuming to write the examples but in most cases the efficiency gains were minimal. Why would knowing these differences make a difference in anyones life?
So I thought about the test. I thought about how many questions I could ask about these quibbles I spoke of earlier. The test wasn`t like this but it did ask to compare two different GOF patterns. Patterns are usually thought of as being architectural pieces and naming them for better communications among different people on a development team. The architect writes a pattern name on some classes on a class diagram and the end developer reads that class diagram and implements something well known. Well in my experience, somewhat loosely exemplified by what I wrote above, is that pattern implementation is not the well known thing that a door or a window is in building architecture. First the pattern is not something that is implemented every time the same exact way. Also, generally a seasoned developer can come to a similar implementation without knowing that they used a pattern and may have never heard its name anyway. I think that patterns are really a better way to teach software programming concepts. But, after you learn say...what double dispatch is, and how it is used in the pattern then you can forget the pattern name and just continue to do that unnamed concept. People don`t really talk in patterns. The confusion that that would generate is too great. I have an example.
I was reading my son some children`s books yesterday before bed. He got the bright idea to have me read the books backwards. So I did. The first few pages were easy to read but I started to try and understand the story also. To think in reverse is kind of easy for me. I have some affinity for it probably because of how information is stored in my learning disabled brain...in the form of unnamed objects and not word networks. So it took me a few pages to get the structure of sentences but after getting the structure I could understand the story in reverse and see how it went from the whole to the part. Pieces of the story work removed for each page that I read one after the other until I came to the first page. I even made mistakes like guessing words and reading them in the wrong order because the sentence idea would come to me before the words would. I do this reading forward. Reading forward gets me into trouble because I don`t read carefully enough and often get the wrong idea after reading something. Therefore my comprehension goes down because I have interpreted something that was not there. This was similar but because I had to go through a translation of reverse I think I actually read better. This would be a good technique for understanding. It would be better than me typing my entire texts to slow the interpretation process and gain understanding that way. Now I have noticed some of my learning traits in my son. During this reading backwards I wondered if he was getting the story. I think that he was because he had no complaints and enjoyed the reading just as well as I did. I kind of did this on the fly. It made me realize that patterns are not something that we use for communications it is something we use for understanding. To be able to recognize pieces of code and how they are joined together to get an overall picture of a program or system. This idea that somehow they add in reuse and better design through well worked algorithms is false...at least for me...and I think for others. I understood the sentence structure in reverse quite quickly. The pattern of English sentence structure in reverse is not something that I will use to share an idea to others. I am not even sure I could articulate the pattern. But in my head I understand that pattern well and can recognize it and understand the meaning of the text....I will say that part again for emphasis....I can understand the `TEXT`...paragraphs, plot, genre. So unnamed patterns of understanding reused over different software systems is how we use patterns. Clever implementations are not as the result of using patterns. They are the result of good programming skills. Skills that are unnamed. We don`t really talk in pattern names. You would not talk about sentence structure to get your point across about a concept you wanted to convey to another person, would you? Don`t use software patterns for that either. Naming a pattern is useless.
Picking a new swim locations is coming down to 2. I will be able to keep swimming this summer. Three years and I have only missed a handful of MWF`s. I will be able to keep my regimen. Running is going well also. You know not in the winter but summer is always good.