From Sponge to Stone

29 Apr 2021

Functionality

My high school Japanese teacher used to say an analogy about our brains that as a child, it would easily suck in information like a sponge, and as we get older, it would turn to stone which makes it harder to retain new information. A program built from the bottom-up is very much like how our brains function throughout our lives. It starts with a clean slate and an infinite amount of possible information to be stored in it. Then once the program has a set way in working how it is intended, it would be very hard to completely change or make changes to the program without completely changing the intentions of what its original purpose was. It would also be very hard to make changes – big or small – to any of the functions, methods and classes that are intertwined with each other as changing or deleting a couple lines of code may end up not making any sense to the computer, as it wouldn’t to a brain – it would be like losing memory to important information – and then it would likely end up throwing errors.

As for my understanding of design patterns, it is basically solving recurring problems for the benefit of future generations. Therefore, once a solution is set in stone, it should be likely depended on for generations to come. As the saying goes, “if it ain’t broke, don’t fix it.” However I can imagine it possible that any program can be made more optimal, which would just be adding bits – not necessarily new – of information on top of the info it already contains in its ‘brain’.

Utilization

Having recently learned about design patterns, it was also made known that we’ve been using some of them in past assignments and our current group projects. So far, we only know of design patterns we are using in a template called bowfolios. Now what kinds of patterns have been set in stone for us to use in our projects? One of them is the Observer pattern, in which we utilized reactive data that updates a collection when something is added or removed. It will re-run the data collection that references a cursor. Another design pattern we’ve used is called the Prototype in which Javascript uniquely utilizes to allow instances of objects to be made from other instances, so basically any class instantiation in javascript utilizes this design pattern. These are just some of the few that we’ve been using, there is also the Model-View-Controller, Front Controller, and the Singleton design patterns that are embedded into this template, which is utilizing all of these design patterns.