Author Archives: nchabot1

Week 8 – Law of Demeter

This article from InfoWars main goal is to explain the Law of Demeter, which is something that I have never heard about before this class. The basic premise of the Law Of Demeter is to ensure that classes and objects should never know the internal design and content of other classes. This promotes loose coupling and allowing code to be easily modified and changed in the future. First discussed in 1987 at Northeastern University, the law was developed to help software designers create code that can be understood and modified easily. This seems to be the main goal for most design laws. With more coupling, there is more confusion. The Law of Demeter will ensure that there is minimal complexity within code from restricting classes to have excess knowledge of the inner workings of other classes.

The main reason I selected this article for this weeks blog post was because it again showed some visual examples of code being used in the Law of Demeter, instead of just plain text. As I stated in another blog post, I enjoy seeing pieces of code that show the principle being used, and showing its violations. This article was also another free resource for many beginner coders to utilize to enhance and optimize their code. This is a concept I did not know about before taking this class. Reading the article, I connected the main points of the Law of Demeter to concepts we have learned in class, such as loose coupling. I’ve never realized that those small concepts we learned in class had much bigger implications in the world of software design, such as having a whole law dedicated to it.

In the future, knowing the Law of Demeter exists will help me make sure my code utilizes loose coupling, so that my code can be easily understood and ready by my co-workers on the project. Having code that is easy to read and understand is important when working in a team environment, as you can write something that you personally understand easily, but if a co-workers takes over your work, they are left in the dark as to what they are reading. This also promotes communication in the work environment, such as having standards for writing code so that everyone is on the same page when it comes to creating code, and allows for a more fluid and effective work environment.

Link: https://www.infoworld.com/article/3136224/demystifying-the-law-of-demeter-principle.html#:~:text=The%20Law%20of%20Demeter%20principle%20states%20that%20a%20module%20should,of%20other%20objects%20or%20components.

From the blog CS@Worcester – Noelan Chabot's Blog by nchabot1 and used with permission of the author. All other rights reserved by the author.

Week 4 – SOLID Principles

For this week, I decided to look at FreeCodeCamp’s article on SOLID principles. This article goes deep in depth on each of SOLID’s principles, which are the Single Responsibility Principle(every class should have one job), the Open-Close Principle(open to extension/closed to modification), the Liskov Substitution Principle(subclasses should be substitutable for their base classes), the Interface Segregation Principle(many specific interfaces are better than a general interface), and the Dependency Inversion Principle(classes should depend on interfaces or abstract classes versus concrete classes and functions). The article describes each principle, and gives examples of each principle in action, which is why I chose this article.

I found it really helpful to see physical code, how the code violated the principle, and how to fix the code to make it fall in line with the principles. I also found it very helpful when the article explained the common mistakes with each principle and how to avoid them. The article overall made it very easy to understand each of the principles and described them in a casual way. FreeCodeCamp is a non-profit organization aimed at beginning coders and developers to help them understand coding concepts.

In the future I will take note when designing my code to ensure that it falls in line with the SOLID principles to avoid my code becoming too complex and opaque. This will allow myself and anyone reading my code to be able to understand it and extend it if necessary, not modify it, and the Open-Closed principle aims at making code open to extension but closed to modification.  Looking back at code I have written in previous years, they do not follow these principles at all.

Link: https://www.freecodecamp.org/news/solid-principles-explained-in-plain-english/

From the blog CS@Worcester – Noelan Chabot's Blog by nchabot1 and used with permission of the author. All other rights reserved by the author.

Welcome

Welcome to my new blog. Here, I will be sharing my research and opinions on any articles on new technologies that I come across in the future.

From the blog CS@Worcester – Noelan Chabot's Blog by nchabot1 and used with permission of the author. All other rights reserved by the author.