Category Archives: Week 10

What are Anti-patterns?

Anti-patterns are on the opposite side of the design pattern and are undesirable according to the blog “Anti-Patterns in Software Development That You Should Avoid”. Another term to describe Anti-patterns are called Design Smells.

The blog goes over the concept of the Golden Hammer anti pattern which occurs when using a familiar solution to attack an unfamiliar problem. Sometime it might work out, but most of the time it’s an inefficient way to solve problems.

The Golden Hammer anti-pattern is a concept that can shared in every aspect of life. Like for example, as mentioned in the blog some people tend to have their solution ready before understanding the problem like a doctor prescribing while the patient is still telling about the symptoms.

In software development, each design pattern is basically suited for its targeted problem. But it’s really easy to use the same framework, the same programming language, and the same design pattern for almost every problem. Like similar to the doctors example, some doctors might prescribe Ibuprofen to help a certain health but it might not completely relieve or heal that issue completely.

And so the Golden hammer could lead to; Poorly performing code, Overly complicated code, Redundant code. To avoid this anti-pattern it is best to find all potential solutions for one problem and benchmark them. List down all PROS and CONS for each solution then choose the better one.

Another anti-pattern is the God Class which for the most part controls many other classes, takes many responsibilities as well as lots of dependencies. An application could be well designed at the beginning so that there aren’t God classes but eventually dominant, very well specified classes will turn into God classes at some point.

The big ball of mud is a very common anti-pattern that happens when the solutions/application lacks a perceivable, flexible, suitable architecture as defined in the blog. A ball of mud will have, haphazardly and sloppy structure without coding comments, contains many God classes with more than 6000 lines of code, static variables/functions everywhere, methods being overloaded several times, and code duplications.

This anti-pattern is dangerous because it could happen while writing the application. Once we can’t refactor the code anymore, then we have to rewrite the entire thing. There are many reason why this anti-pattern could be brought up. It could be due to the frequent changes and requirements that the application might need, the deadline is near and the project is rushed, new developer are being brought in, or being too narrow minded about the design architecture that was initially brought in.

There are many more anti-patterns when it comes to the software development process, these are just the most common ones to date.

Link to blog: https://medium.com/geekculture/anti-patterns-in-software-development-that-you-should-avoid-780841ce4f1d

From the blog CS@Worcester – FindKelvin by Kelvin Nina and used with permission of the author. All other rights reserved by the author.

Unified Modeling Language (UML)

Unified Modeling Language is a standardized language to visually represent software construction, design, and architecture. UML designs are process independent, and often omit irrelevant, or insignificant relationships and attributes in favor of simplicity. UML diagrams can be used to represent a variety of things in several ways. UML diagram can be classified into two main categories: Structure Diagram, and Behavioral Diagram.

Structure diagrams show the structure of objects and the relationship/interaction between those objects. Structure diagrams are to be considered descriptive and behave like a blueprint for the code, i.e., it can be used to inform the design of written code. Class diagrams are one of the most frequently used Structure diagrams in software development. It shows each of the classes in a system with their attributes, class methods or operations, the scope of every attribute and method within a class, and the relationship between two or more classes. A class diagram has three parts: Class Name, Attributes, and Methods. The name of the class is always at the top, while any attribute like a variable is in the middle. A note can be added pointing to the attribute to show any individual specification or requirement. The methods are listed at the bottom and can similarly have notes pointing to the method to show any individual specification or requirement. Arrows are used to describe the relationship between two or more classes. Depending on the arrow the specific relationships can be identified. The various relationships are Association, Dependency, Implementation, and Inheritance.

Behavioral diagrams show the intended function of the system and any objects it contains. They describe how those objects should interact with each other to make the system functional. Behavioral diagrams are considered prescriptive, i.e., they show how the written code should work in the system.

As a CS student, I found thisblog post on UML diagrams to be highly relevant and useful. Homework 1 and Homework 2 provided a great opportunity to delve into the complexities of these diagrams and gain a deeper understanding of their various properties and concepts, especially for Class Diagrams. It will very likely be useful in future classes as UML diagrams allow you to be able to communicate your design ideas effectively to other members of your group, ensuring that everyone is on the same page and working towards the same goal. They can also be a valuable resource for documenting and maintaining software systems, making it easier to understand and modify the system as needed. For example, the visibility of attributes and the connections between classes, as represented by arrows, are crucial elements that contribute to the overall coherence and functionality of UML diagrams. Additionally, the provided examples helped to clarify and illustrate these concepts in a clear and concise manner.

 

Source:

https://creately.com/blog/diagrams/uml-diagram-types-examples/

https://www.uml-diagrams.org/

 

From the blog Zed's Blog by Lord Zed and used with permission of the author. All other rights reserved by the author.

Anti-Patterns

This week I learned about anti-patterns by reading “Anti Patterns” by Ilyana Smith. Smith explains “An Antipattern is a description of a “negative solution” and a corresponding “positive solution.” In other words, an Antipattern describes a common way of solving a problem that actually causes more harm than good, alongside an example of a better way to solve that problem”. Smith then gets into the details about each pattern and the problems they cause.

Smith tells us that there are seven deadly sins of software projects that are the root causes of problems. These “sins” are haste, apathy, narrow-mindedness, sloth, avarice (overcomplicating things), ignorance, and pride. There are 18 anti-patterns Smith talks about. These anti-patterns are analysis paralysis, architecture by implication, the blob, copy-paste programming, death by planning, design by committee, functional decomposition, functional decomposition, golden hammer, intellectual violence, lava flow, and poltergeist, reinvent the wheel, spaghetti code, stovepipe enterprise, Swiss army knife, vendor lock-in, and singleton.

As you can see, there are a lot of anti-patterns. I will not be able to describe all of them so I suggest reading the article yourself, but I will go through a few of them. Analysis paralysis is when a software team gets caught up in the design and planning phase and fails to start any development.  The blob is building a class that does most of the work and there are a few secondary classes that contain mostly data. Copy-paste programming is a problem because if there is a problem in the code you copied it will be everywhere you paste it. These are just a few of the many anti-patterns.

After reading about the seven deadly sins of software projects and the anti-patterns associated with them and how important they are. I also learned there are a lot of things I should avoid when working on a project. Some of these anti-patterns could be easy to get caught up in like analysis paralysis. Being too caught up in trying to get the perfect design is something I could see myself doing so keeping these patterns in mind is something I should do. I think Smith did a great job explaining these patterns in a way that is easy to understand but still gets the point across. I would recommend this post to any software developer looking to improve their skills. Even if only one of these patterns is a new concept, I am sure it would be worth the read.

Link: https://ilyana.dev/blog/2020-11-24-antipatterns/

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

Week 10 – Rest API

For this week, I decided to look at freecodecamp.com’s article on REST APIs. We are currently learning how to use and work within REST API environments, so I assumed that this article would just be review, but I have learned some new topics. The article essentially describes what REST API’s are and how they work. Before delving into REST APIs however, the article explains what API’s are. Essentially, they are a middle man between the user and an application regarding information. The article uses a customer at an unknown restaurant for an analogy. The server is the API, and the customer is the user. The user requests a specific item from the menu, or the API’s documentation, and the server brings that request to the kitchen, or the application, and then returns with the user’s order. Rest API’s are specific to web servers only, and use a set of 5 different HTTP functions to perform their operations, GET, PUT, PATCH, DELETE and POST. All of these essentially create, read, delete and update information. These features allow the user to alter and gather information from a web server from a simple application and without having to go into the actual code to do this, after the REST API is set up. The information is then returned to the user in either a json or XML format.

I picked this article due to its simple yet effective explanation of what REST APIs are. As stated before, we are currently working with REST APIs in class, so a lot of this article was review, but this article expanded my way of thinking how REST APIs work. I have used freecodecamp’s articles in the past, and they provide free and simple explanations for complex software topics that are very beginner friendly. The article also included real code examples of how to use some of the requests, along with a different method of using the requests than from what we learned in class by using the fetch API.

This article will help with my work in REST APIs thanks to its clever ideas in how its explained. I have never thought of the restaurant analogy, and I am sure it will help with learning more about REST APIs, and when I am explaining to my friends or family what it is I am doing in school, I can lead them to this article to help their understanding.

https://www.freecodecamp.org/news/what-is-rest-rest-api-definition-for-beginners/

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 10: Practice, Practice, Practice

For this week, I chose to read the pattern ‘Practice, Practice, Practice’ from Chapter 5: Perpetual Learning. The name is pretty self explanatory as to what the pattern will be on, practicing. I originally chose this pattern because it’s something that we need to reinforce within ourselves in order to get better at something, for coding especially. This is something I still struggle with due to my lack of drive and motivation but everyday is another day to push myself. Any way, the context of this pattern is wanting to get better at the things you do, to develop concrete skills. Again, just looking at the title gave away the context of this pattern, but that was it.

For the problem of the pattern, it is being unable to learn from your mistakes due to the performance of you daily programming activities, you feel like you’re always on stage. I assume this is in context of a job, but I haven’t experienced this problem yet so knowing about it ahead of time is going to help me down the line. For the solution of this pattern, you want to be able to practice without interruptions and in an environment that makes you comfortable making mistakes. This seems like an easy solution but in practice I’d imagine it’s hard. The solution also mentioned having a mentor to watch you over your practice and provide feedback. This is something I’d be interested in doing but I lack the humility to have a mentor watch me and provide me feedback, I’m always trying to do things on my own. I also dread looking at feedback because I feel I always mess something up, but I believe a pattern in the one of the previous chapters mentioned to put aside your ego, so I’ll have to go look at that one again.

Finally, for the action of the pattern, something I don’t write about often but I thought it would fit here, is to read one of the books that was previously mentioned in this pattern and take an exercise from it or make one yourself. The exercise should ideally be slightly harder than you can easily solve. You’ll then do this over 4 weeks and record your solution every time and over the 4 weeks you should observe how your solutions evolve. I thought this was an interesting take on practicing coding that I’ve never heard about. I usually just one and done exercises but repeating a exercise really cements it into your head so I’d imagine this way is much more beneficial to me.

From the blog CS@Worcester – Brendan Lai by Brendan Lai and used with permission of the author. All other rights reserved by the author.

Craft over Art

It is important to create things beyond that what is expected. You should go above and beyond the specifications of the application and create something that will wow the product owner.

I think it’s interesting to look at software development as craftsmanship and what you create as art. I do think that programming is a form of art because you have to use your creativity to make anything that you produce. Being artistic is a good way to look at creating an application, especially one with a user interface because it is what people will be looking at whenever they interact with the software. You want something to look beautiful and appealing just like a piece of artwork. In my opinion, someone would be more likely to use attractive-looking software than one that is unappealing to the eyes. It’s also important to make something that’s easy to navigate because that enhances the user experience.

I typically try to go above and beyond in the project that I’m working on. It is good for personal growth and reflects well on my portfolio. It is nice to be able to show a future client past work and be proud of the artistic design element of what I created. I prefer working on the backend, but I do enjoy creating a nice UI that users enjoy interacting with.

I think it is important to put extra time and effort into the products that you are creating for your clients. However, I think it’s important to not get lost in the details of creating something more than they asked for. Sometimes it’s possible to add features and create things that the client might not want and then you are forced to remove them. There are other times where you might put in extra work, and you were taking time away from yourself for other projects that need attention. Even though it’s good to have just to have the learning experience, I think it’s also important to make sure that projects for clients, that you put in extra effort into, should get some form of acknowledgment.

From the blog CS@Worcester – Jared's Development Blog by Jared Moore and used with permission of the author. All other rights reserved by the author.

“Draw Your Own Map”

Jennifer Gayle once said “You are the author and writer of your own story. Turn the page, start anew, and make sure it is a story worth telling”. In life, we have an open road that we are set upon. Sometimes there are factors that narrows that path. Upon reading Draw your own map, it has explained that we are not to be limited from outside factors. Such as a company with their own set expectations that conflicts on what you are interested in instead therefore, we must be more open to search for more opportunities. That it is alright to make modifications to our own maps to further gain motivation and values. 

I enjoyed the section of the solution for this matter; it piqued my interest where we must take the first step to make a motion forward. Even though it may be terrifying, but we must be willing and determined to walk forward. I also aggreged that we do not have make big goals that are broad but instead make smaller ones that can be achievable. This way we can make further adjustments to our map. It would not hurt to make bigger goals for long term but to break them down into small goals to conquer those bigger goals. There was not any part of the pattern I disliked as I believed this is very useful information. 

Using this pattern towards my life and career will be deeply considered when I go into the software development profession. To always remember that I can find many other opportunities that aligns with my interest of what I am looking for. And if it ever comes to fall out of place from my map that I will branch out my path even further to keep the love and interest I am intended to keep on going. Understanding that after having to trying out a new path and having a new set of values is essential to our mindset. To keep in mind that we ask ourselves is it worth it? Could this step hinder our truest potential? That is why we must keep expanding our choices and chose whichever is best in one’s interest.

From the blog cs@worcester – Dahwal Dev by Dahwal Charles and used with permission of the author. All other rights reserved by the author.

“The Long Road” Apprenticeship Pattern

Summary:

This apprenticeship pattern concerns the long term journey that a programmer / developer will take throughout his or her lifetime. In a society that continuously values decadence, it’s important to find a path that is right for you, no matter how weird or seemingly unusual it may be. As we gain experience as programmers and developers, there will be temptation to mindlessly progress down the path of greater income and short term gain. Instead, this pattern is for those who aspire to progress down a fruitful path in software development, gaining experience in a lifelong career.

What I find most thought provoking about this pattern is the prospect of leaving the field of programming permanently to go down another field of salesmanship or to a high ranking position in a corporation. Software development to me is a very intricate and professional field that requires a lot of research, experience, and experimentation. Someone who progresses far enough into the field only for them to change directions because of their experience seems somewhat confused to me. On the other hand, it at least makes some sense as someone who has a lot of experience in software development can have a lot more skill as a business owner or a salesman in selling software, and recognizing development cycles for a product.

This pattern has indeed somewhat caused me to change my view of my future. I knew that within the software profession there were many different ways that one could go, and that we would need to be experienced with different tools if we needed to create a competent product. I wasn’t sure, however, of the potential of an opportunity arising to shift to a different career

I generally agree with this pattern. The part I agree the most is on the matter of strange roles that one may possibly find himself in in the future. Personally, my work and perspective on planning my future took a drastic turn almost a year ago, where I actively tried to search for a career as a programmer based on the tools that I already knew. Then, I found out that it’s better to learn and gain experience with new things that I don’t know, based on the demands of a job and the industry.

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

Apprenticeship Pattern: The Long Road

This week I decided to take a look at ‘The Long Road’ apprenticeship pattern that covers the expectations and the reality of becoming a software craftsman. The pattern begins by explaining that society expects immediate results without really thinking about the journey. Usually one would aspire to take the highest-paying job and the first promotion as opposed to building up your skills. The pattern encourages you to value learning and long-term growth over salary and leadership positions. Keeping a long term goal in mind allows you to hone your skills as you work towards it. Of course this pattern is not for everyone, the long road is just one of many that a software developer can take on their journey.

Reflecting on what I read in the pattern, it is certainly more realistic to set a long term goal as opposed to trying to go for the high paying jobs immediately. I am definitely guilty of having the desire for overnight success. I agree that the biggest factor for this would be today’s culture and as well as my family’s expectations of me. But when it comes to software craftsmanship, I would like to spend more time accumulating knowledge instead of settling down and potentially stop improving. The only statement that stuck with me was, “Along the way, it is not unlikely that you will take on roles of power and responsibility or find yourself quite wealthy. However, these roles and benefits are not the main motivation of the successful apprentice—they are merely by-products of a lifelong journey.” I would say that I would probably not be ready for an executive job or being a team leader, but I can’t deny that money is one of the bigger motivators when it comes to working. That being said, you always have to start from somewhere, and I have much to learn. This pattern is more so a reminder for me to take the time to improve my skills and success and money will come after.

From the blog CS@Worcester – Null Pointer by vrotimmy and used with permission of the author. All other rights reserved by the author.

Blog 1: Expose Your Ignorance

This pattern is about shedding light to dark or unknow spaces of a craftsman knowledge. The context and problem given are that the people who are paying you to be a software developer are depending on you to know what you’re doing, and your managers and team members need confidence that you can deliver, but you are unfamiliar with some of the required technologies. The solution suggested is to show the people who are depending on you that the learning process is part of delivering software and to let them see you grow. The book also mentions how hard it is to practice it because it is scientifically proven that the need to appear competent is ingrained in most people. That being said, there is no need to hide an area of ignorance because one of the most important traits that a craftsman can possess is the ability to learn, identifying an area of ignorance and working to reduce it.

I can absolutely relate to the context given in this pattern because it’s quite frankly where I am currently at. As I am navigating working my first “real” jobs, I quickly realized that I do have many zones of ignorance and it is extremely difficult to just lay them out because there is a lot of pressure to deliver what I have been hired for. Reading this has definitely reassured me in knowing that most people feel the same. The pattern suggests asking questions as a way to expose one’s ignorance and I have really found that to be true. Often, I would just go straight to google, stackOverflow or any similar website when I was presented with unfamiliar material or when I didn’t know how to approach a task and I would ask question after I ran out of ways. I have then realized that it should be the other way around because hearing from the employer/client and asking the right questions first made my tasks easier to achieve. I found interesting the emphasis they added on expertise not being the destination but being a by-product of the long road we’re all on. It just means that with time and some practice you get the extra knowledge that make one an expert at something.

From the blog CS@Worcester – Delice's blog by Delice Ndaie and used with permission of the author. All other rights reserved by the author.