Category Archives: Week 10

Assessing Clean Code Etiquette from the Master

Hello Debug Ducker here, and today this piece will be a bit different. I want to share my opinions and others about on a somewhat controversial figure in the coding community. Robert Cecil Martin also known as Uncle Bob is a well-known software engineer. He is known for many things such as the subject to today’s topic, “Clean Code” a book written by him that discusses and shares what clean code is. it offers advice on how to structure and write code for it to be “clean”.

From my experience from reading excerpts from the book and trying some of his advice on an old project of mine, I have found that it has made the code a lot more readable. However there is some advice that I don’t agree with. To paraphrase, Uncle Bob mentions that a function should avoid having more than one argument or have none at all. He saw that the more arguments, the less clear it is. I understand what he means but personality I feel this may not apply to all cases when writing code, especially if you need multiple arguments to achieve something, so the advice is situational. It made me curious to do a bit of research myself on what others may think of his advice, and I found an article that shares similar sentiments about the advice given by Uncle Bob.

The blog is from a username qntm, who is a novelist but also a programmer. The blog entry is called “It’s probably time to stop recommending Clean Code”, and as the name may suggest, is an opinionated piece on the book of the same name by Uncle Bob. The blog entry had critiques about the book, such as the advice from Uncle Bob that said functions should only be about 3–4 lines. The user qntm found this bizarre, and frankly, I did too as I find this very restrictive for making functions.

That is just one of the many examples from the blog entry, and I would advise you to check the blog yourself to read the full thing. I’ll provide a link below and perhaps search for his other entries as well. I wanted to show you this because the definition of clean code perhaps can’t be defined by one person. Though I have found some of Uncle Bob advice to be helpful, I don’t think all of it should be taken as gospel. Apply his teachings where it may help and perhaps consider finding other ideas of clean code elsewhere because Robert is just one man who wanted to share some advice, I am sure others have different ideas that may help you as well.

Here is the blog entry by qntm about the subject for those curious

It’s probably time to stop recommending Clean Code. Things Of Interest @ Things Of Interest. (2020, November 28). https://qntm.org/clean

Martin, R. C. (2016). Clean code Robert C. Martin. Addison-Wesley Professional.

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

The Legal Side of Sharing Software: Software Licensing

Intro

Have you ever forked a respository without looking at its software license? It’s easy for developers to unintentionally violate licenses, especially if they aren’t informed about what they are, leading to potential legal troubles. This blog post by Fernando Galano breaks down the complexities of software licensing, providing clarity on a topic that is often overlooked, but is vital for anyone involved in software development.

Summary of Source

The blog post explores the concept of software licensing, covering its purpose, types, and implications.

  1. What is a Software License?: An explanation of how licenses define the terms under which software can be used, modified, and distributed.
  2. Types of Licenses: An overview of open-source and proprietary licenses, including popular ones like the GNU General Public License (GPL), MIT License, and Apache License. It also explains what a copyleft license is as well as what a permissive license is.
  3. Why Licensing Matters: A discussion of how licensing affects collaboration, compliance, and intellectual property rights. It describes the benefits of licensing from the standpoint of both developers and users.
  4. Best Practices for Choosing and Using Licenses: Practical tips for selecting appropriate licenses for projects and understanding license compatibility.

The blog is an introductory resource for open-source software usage and distribution. It doesn’t go into excruciating detail, with pages upon pages of technical terms, but it does cover the basics and anyone interested in furthering their knowledge on software licenses should explore more sources.

Why I Chose This Blog

I chose this blog because it addresses a topic that is often overlooked in technical coursework but is integral to professional software development. As I aspire to work as a software developer, understanding licensing will help me avoid legal complications and help my work be protected. The blog’s concise explanations and practical examples make it an ideal resource for building foundational knowledge in this area.

Reflection of Source

The blog post provided a clear and structured overview of software licensing, breaking down confusing legal jargon into digestible information. One aspect that particularly stood out to me was the explanation of the differences between permissive and copyleft licenses. For instance, I now understand how the MIT License offers flexibility by allowing modification and redistribution with minimal restrictions, while the GPL ensures that derivative works remain open-source. Reading about software licenses makes me realize how easy it is to unintentionally violate licensing terms due to a lack of awareness. Before learning about licenses I had never even considered that I might be violating the original creators intentions when deriving their work. This blog has made me more vigilant about understanding and respecting licensing terms, ensuring that my future projects remain legally sound.

Future Application

As I move forward in my career, the knowledge gained about licenses will shape how I approach software usage and distribution. When contributing to open-source projects, I will carefully evaluate license terms to make sure it aligns with my goals. Also, while working professionally, I’ll advocate for the proper review of licensing agreements to prevent legal risks. This understanding also allows me to choose the right license when publishing my own work, depending on the terms I would like others to follow. By adhering to licensing norms, I aim to contribute to a more ethical and collaborative development environment.

Citation

Understanding Software Licensing by Fernando Galano https://www.bairesdev.com/blog/understanding-software-licensing/.

From the blog CS@Worcester – The Science of Computation by Adam Jacher and used with permission of the author. All other rights reserved by the author.

Copyright and Licensing

In today’s world of software development, understanding copyright and licensing is crucial for ensuring compliance with intellectual property and collaborative innovation. Developers often work with software libraries, tools, and frameworks created by others. Without a solid grasp of licensing terms, there’s a risk of infringing on someone else’s rights or unintentionally exposing some proprietary code to the public.

What is Copyright in Software?

Software copyright provides legal protection for the code written by developers, categorizing it as intellectual property. It grants the original creator exclusive rights to use, modify, distribute, and license their work. In most jurisdictions, as soon as a piece of code is written, it’s automatically copyrighted, even without a explicit registration.

However, copyright doesn’t cover ideas, or methods used in the software it only protects the specific implementation of those ideas in code. This means that while you can’t copy someone’s code without permission, you can write your own implementation of a concept.

The Types of Software Licenses

In class we learned about Software licenses and how they specify the terms under which code can be used, modified, and distributed. They range from very permissive to highly restrictive. Some common types include:

  1. Open Source Licenses: These allow anyone to view, use, and often modify the code. Examples include:
    • MIT License: Permissive, allowing almost any use, including commercial purposes, as long as the original copyright notice is included.
    • GNU General Public License (GPL): Requires that any modified version of the code also be released under the GPL, ensuring that derivative works remain open.
    • Apache License(s): Permits use and distribution, even for commercial purposes, but includes a clause protecting contributors from patent claims.
  2. Proprietary Licenses: These are restrictive and usually prevent users from modifying or distributing the software. Examples include end-user license agreements that accompany commercial software for example like Microsoft Office.
  3. Creative Commons Licenses: While more common in creative works like music or literature, some software projects use Creative Commons to specify usage rights.

How to Choose the Right License

When releasing software, selecting the appropriate license is vital. If you want maximum collaboration and sharing, permissive licenses like MIT or Apache might be ideal. However, if you want to ensure that your work remains open source in derivatives, a copyleft license like GPL is a better choice.

Key Takeaways:

  1. Read the License: Always read and understand the terms before using third-party software. Misinterpreting a license can lead legal issues.
  2. Attribute Properly: Many licenses, even permissive ones, require attribution to the original author.
  3. Derivative Rules: If you modify software under a restrictive license like GPL, you must release your changes under the same license.
  4. Protecting Your Work: If you’re releasing your own software, choose a license that aligns with your goals for sharing or monetization.

Resources

From the blog CS@Worcester – function & form by Nathan Bui and used with permission of the author. All other rights reserved by the author.

Design Smells – Decreasing Poor Design

While writing software it is important to know, how to maintain clean and understandable code. Despite best efforts, developers can unintentionally introduce code design smells precise indicators of deeper design problems. While these smells don’t directly cause bugs, they reduce code readability, maintainability, and scalability.

In class we learned the 6 common Design Smells, so I referenced the class materials and found an helpful article on Refactoring Guru. This webpage offers a practical explanation of common smells such as long methods, large classes, feature envy, and shotgun surgery.

Why I Selected This Resource

The reason why I chose this resource resonates with the principles we’ve covered in our class on software design and architecture. Its structured, accessible approach demystifies complex design issues, offering developers clear steps to refactor and improve their code. I’ve often seen myself facing challenges and struggling with tangled code where debugging or adding features feels almost somewhat overwhelming. These tools and insights help a and provide a roadmap for addressing such challenges systematically, and thoughtfully throughout the design process.

My Reflections on the Resource

The discussion on bloaters, like long methods and large classes, I think this was particularly something worth learning. These smells arise when a method or class tries to handle too much, violating the Single Responsibility Principle. I realized that in past projects, I’ve struggled with methods growing unmanageably large as features were added. Refactoring Guru suggests breaking these methods into smaller, more focused ones using techniques like extract method, improving both readability and reusability.

Another key takeaway was the concept of change preventers, such as shotgun surgery, where making a small change requires altering code in multiple places. This often signals that responsibilities are poorly distributed across the system. The resource recommends consolidating functionality into a single class or method, reducing the risk of errors and making future updates more straightforward.

Applications for Future Practices

Refactoring Guru’s emphasis on identifying smells early and refactoring incrementally aligns well with agile development practices. Moving forward, I plan to use this more than one of these materials as a checklist during code reviews to spot and address issues proactively. Techniques like extract method, extract class, and move method will hopefully become part of my tools for tackling coupled code. By continuing improving my skills to detect and refactor code smells, I want to create cleaner, more sustainable codebases that will be easier for both my team and future developers to work with. Thank you for reading my blog post and I hope you learned some

https://refactoring.guru/refactoring

https://refactoring.guru/refactoring/smells

From the blog CS@Worcester – function & form by Nathan Bui and used with permission of the author. All other rights reserved by the author.

The Secret To Maintainable and Scalable Software: SOLID Principles

Intro

Imagine inheriting a massive, poorly designed codebase. Every change you make breaks something else. For software developers, such nightmares can be avoided by adhering to the SOLID principles, a foundational guideline for creating maintainable, scalable systems. These principles are a must-know for any software developer seeking to improve the quality of their work. They provide a roadmap for developers to create cleaner, more maintainable codebases, which is why I was drawn to this resource

Blog Summary

The blog goes through each of the five principles, explaining what they are, why they are important, and giving a code examples utilizing each one.

1. Single Responsibility Principle (SRP): A class should have only one reason to change, ensuring focused and cohesive functionality. The blog illustrates SRP with an example of separating user management from content creation, showing how this approach simplifies debugging and enhances code clarity.

2. Open-Closed Principle (OCP): Software entities should be open for extension but closed for modification, promoting adaptability without risking existing functionality. For OCP, the blog demonstrates how using inheritance and interfaces allows developers to add new functionality, using Square and Rectangle classes inheriting from the Shape base class.

3. Liskov Substitution Principle (LSP): Subtypes must be substitutable for their base types without altering the correctness of the program. The example provided for LSP highlights how properly designed subclasses, such as an Eagle and a Penguin inheriting from a Bird class, ensure seamless substitution without breaking the program.

4. Interface Segregation Principle (ISP): Clients should not be forced to depend on interfaces they do not use, encouraging lean and specific interfaces. In discussing ISP, the blog uses an example of splitting a large interface into smaller, more specific ones, ensuring that classes only implement what they actually need.

5. Dependency Inversion Principle (DIP): High-level modules should not depend on low-level modules but instead rely on abstractions. For DIP, the blog explains how decoupling high-level modules from low-level details using abstraction layers, like interfaces, makes the codebase more flexible and easier to maintain.

Why I chose this resource

I selected this blog to write about because it breaks down each principle in a concise way, clearly explaining each one in a way that is easy to understand at all levels. It’s a great resource to quickly go back to when you need a refresher on any of the principles.

Reflection on SOLID

After learning about SOLID, I see that it might take an extra step of thinking to adhere to the principles at first, but I think it’s well worth it for the resulting code structure. The easy way to code is messily throwing together code that works without a second thought, but doing that is very dangerous for the longevity of a program. I believe that after following SOLID for a while it will become second nature and will become the natural way of coding, which is why I think it’s important to learn about SOLID early and consciously until it does become a subconscious practice. In one of my past projects, I struggled with messy code that implemented multiple responsibilities in one class. Debugging it was a nightmare, but had I known about the SRP principle it could have been avoided entirely. Reflecting on these principles has already influenced how I plan on approaching my code, and I’m eager to incorporate them into my future work.

Future Application

Given the importance of SOLID principles for large-scale software, I believe it’s essential to internalize and apply them in future projects to thrive in the software development space. By crafting modular classes and reducing dependency, I aim to create services and systems that are easy to maintain and adapt as requirements expand and evolve.

Citation

“Essential Software Design Principles You Should Know Before the Interview” By Arslan Ahmad

https://www.designgurus.io/blog/essential-software-design-principles-you-should-know-before-the-interview

From the blog CS@Worcester – The Science of Computation by Adam Jacher and used with permission of the author. All other rights reserved by the author.

Team Management Strategies

Throughout the beginning half of my Fall 2024 semester, I’ve learned about development processes such as environments, strategies, and team policies. As the year has progressed I wanted to know more about the development process of software before beginning my blogs. After tackling AGILE and Scrum I have been interested in seeing other ways of team management, and potential connections back to AGILE. To begin in understanding these processes I first found an article designed around general team management. This article is found on desktime.com, and it is not focused particularly on computer science, but on managing a team. The article’s title is A guide to team management: Strategies and techniques to help you succeed by Viesturs Abelis

This post outlines key strategies for effective team management to boost productivity and morale. It first emphasizes the importance of creating a supportive team culture, where employees feel valued and heard, mentioning Google’s Project Aristotle which found that psychological safety and feeling heard are crucial for team success. The article states that managers should engage actively with their team, foster inclusivity, and lead confidently. It is stressed that managers must be considered part of the team. The article also mentions the need for a clear vision and direction, including both long-term goals like a mission statement and short-term objectives like Key Performance Indicators and Objectives and Key Results. It highlights that employees are more motivated when they connect personally to the organization’s values. The use of productivity software is also recommended to improve team management. Tools for time tracking, performance evaluation, and project tracking provide valuable data, helping managers optimize team performance and streamline workflow. The article continues to reaffirm that team management combines fostering a positive culture, setting a clear direction, and using the right tools to enhance productivity and success.

This was a good article to step into team and development-based blogs, as it is a very broad and applicable subject matter. This is a key step in constructing a blog based on understanding development environments and processes. Without having a baseline understanding of team management, tactics like AGILE can be confusing to grasp. I wish to refine my knowledge in this area and prepare for working in and managing teams going forward into classes like CS-448. Next in my blog I will look into articles relating to development environments, such as Docker or GitPod, or look into articles based around AGILE and Scrum principles.

Source:https://desktime.com/blog/team-management

From the blog CS@Worcester – WSU CS Blog: Ben Gelineau by Ben Gelineau and used with permission of the author. All other rights reserved by the author.

Version Control

Source: https://www.spiceworks.com/tech/devops/articles/what-is-version-control/

This article is titled “What Is Version Control? Meaning, Tools, and Advantages.” The main purpose of version control is to “track the progress of code across development and iterations and also aids in managing changes during the life cycle.” Records are kept of all changes with names, timestamps, and other important information. So, the process by which software code is monitored and the way in which changes are made is called version control. A huge benefit of version control is being able to look at the revision history and determine where problems originated from, and who caused them to happen. This allows for increased efficiency regarding workflow considering that the time required to locate problems is greatly reduced. Another benefit of version control is branching. “Branching is a distinct approach to version control where development programs are duplicated for parallel versions of development while keeping the original and working on the branch or making separate modifications to each.” This allows for enhanced collaboration where development is increased, issues are resolved, and code remains organized. A couple very popular version control tools are Git and GitHub. The creator of Linux, Linus Torvalds, created Git. The memory footprint of Git isn’t vast and is able to follow changes in any files. It is a very simple version control system and as a result is used by top companies such as Google. GitHub is a service that enables development teams to collaborate and keep track of all their code changes in a cloud environment. GitHub is secure and reliable, and as a result is also widely used. Through the use of a version control system the following can be achieved: “streamline merging and branching, examination/experimentation with code, the ability to operate offline, creation of regular/automated backups, communication through open channels.” Overall version control aids in the maintenance of reliable code bases and enforces accountability for effective collaborative development. 

I selected this article because we are actively learning about version control in class right now so I figured it’d be the perfect time to read up on it more. Reading the GitKit chapters has exposed me to different git commands and GitHub usage. It was interesting to read in this article about all of the in-depth benefits that version control offers and clearly showcases why even top companies such as Google use it to optimize their workflow. In future practice, whether it be at a job or while working on an individual project, I will use version control to improve collaboration and the ease of maintenance of my code.

From the blog CS@Worcester – Shawn In Tech by Shawn Budzinski and used with permission of the author. All other rights reserved by the author.

Scrum in Action: Lessons from Spotify’s Agile Journey

One of the topics we covered in Software Process Management this year is Scrum. I’ve always been curious about how big companies and tech corporations manage their teams and make everything work smoothly. In the article “Achieving Team Purpose and Pride with Scrum” by Sophia Ciocca, a Web Engineer at Spotify, she shares her team’s journey to creating a more efficient and structured routine using Scrum principles.

Sophia starts by describing the struggles her team faced when they first tried applying Scrum. Meetings felt unproductive, sprints were often left unfinished, and there was little connection between their daily tasks and long-term goals. To fix these issues, Sophia’s team reached out to a Spotify Agile Coach and decided to adopt the full Scrum framework, as outlined in the Scrum Guide.

This shift involved several key changes, like holding weekly backlog refinement sessions, simplifying sprint planning, improving sprint reviews, focusing retrospectives on actionable steps, and enhancing stand-ups. These adjustments helped the team stay aligned, better understand their workload, and communicate more effectively.

The results were impressive. The team’s efficiency improved significantly, and tasks were completed faster. They even tripled their monthly active users without adding more team members. Most importantly, the team gained confidence in their work and a stronger sense of pride and purpose.

I chose this article because it directly relates to the Agile methodologies and Scrum Guide we’ve discussed in class. I also wanted to understand how big companies use these frameworks to foster teamwork and efficiency. It’s fascinating to see how systems like Scrum can make a huge difference in how teams work together.

Sophia’s story highlights an important Agile principle: “responding to change over following a plan.” Her team’s ability to adapt their process while staying true to Scrum principles was key to their success. One of my main takeaways is that asking for help, like Sophia did by reaching out to an Agile Coach, can lead to growth and positive change.

As I prepare for my career in tech, learning how to implement Agile and Scrum effectively is crucial. This article showed me how small changes, like adding confidence checks to stand-ups, can improve teamwork and productivity. I’m excited to apply these insights in my future career and work with teams that value collaboration and continuous improvement.

Sources:

Achieving Team Purpose and Pride with Scrum

Citation:
Spotify Engineering, S. C. (2022, January 27). Achieving team purpose and pride with Scrum. https://engineering.atspotify.com/2021/05/achieving-team-purpose-and-pride-with-scrum/ 

From the blog CS@Worcester – CodedBear by donna abayon and used with permission of the author. All other rights reserved by the author.

Anti-Patterns

Source: https://www.freecodecamp.org/news/antipatterns-to-avoid-in-code/

This article is titled “Anti-patterns You Should Avoid in Your Code.” It specifically mentions six of them, being: Spaghetti Code, Golden Hammer, Boat Anchor, Dead Code, Proliferation of Code, and the God Object. An anti-pattern, in regards to software development, is an example of how not to solve a problem in a codebase. They are not a positive thing, they are examples of practices to avoid in the development process. Anti-patterns lead to technical debt, code that you have to eventually come back to and properly fix later. Spaghetti Code is the most common, it is code that doesn’t have much structure. It is called Spaghetti Code because everything is difficult to follow, files are located in random places, and when visualized in a diagram, it appears to be a jumbled mess, much like spaghetti. Golden Hammer references a scenario where you follow a certain process that doesn’t necessarily align perfectly with the project but still works well enough. This may not seem like a large issue, but is obviously not the best practice to follow because it’ll cause performance issues in the long run. You should always use a process that is the best fit for your project, even if you need to teach yourself or learn something new. Boat Anchor is when developers leave code in the codebase that isn’t actively being used in the hopes of it being needed later and thus not requiring much effort to implement when it is eventually needed. The main problem with this is when it comes to maintaining the code. It leads to the question of what code in the codebase is unused and what is being actively used. Trying to fix a bug in the system on code that isn’t even being used is a time waster. Dead code is code that doesn’t look like it’s really doing anything, but it is being called from many different places. This leads to problems when trying to modify the code because no one is unsure what is actually dead. Proliferation of Code is about objects that have the purpose of invoking a more important object, meaning it doesn’t really do anything on its own. The action of invoking the more important object should be set to the calling object. Lastly, the God Object is an example of an object that does too much. Objects should only be responsible for doing one thing, referencing the Single Responsibility principle in SOLID. 

I chose this particular source because I appreciated the way examples were clearly given along with the 6 examples of anti-patterns, and upon reviewing the syllabus the topic “anti-patterns” seemed interesting. When you’re learning computer science a lot of the time you’re learning about things that you should do and not about things that you shouldn’t do. I really enjoyed reading about these 6 examples of common mistakes that developers make in industry. It’s important to both recognize good and bad practices to ensure that your projects are properly optimized. I can definitely see myself referencing anti-patterns when designing code in the future so my code can easily be maintained. 

From the blog CS@Worcester – Shawn In Tech by Shawn Budzinski and used with permission of the author. All other rights reserved by the author.

How REST API’s Shift Front-end Development

11/16/2024

REST is a crucial topic in APIs in which I just began to learn about this semester. Before this, I had never heard of REST API so I assumed it would be a challenging concept to grasp since I had no prior knowledge regarding this style.

This text dives into the definition, explanation, and exploration of what REST is, how it is used, and how we can get the most out of it in certain services. The text highlights the importance and nuances of REST API’s while still idolizing their importance of implementation.

Initially, during classes I found the material hard to grasp since I had no idea as to what Rest was and how it worked. However, everything began to make more sense when we started working with the hands-on assignments involving actual API calls.

I learned that with certain API calls you are able to retrieve, post, edit or delete information from the backend. These important methods are called HTTP methods which play a key role in manipulation, addition, or removal of information.

A couple key concepts that I learned based off of the reading are that REST APIs are cacheable, which are essential for improving performance and managing network traffic due to its cache technique. The reading also gives insights into how API’S are considered a layered system, in which it allows you to add proxies and gateways. These are very important concepts to keep a mental note on for the future as working in a frontend environment, especially when accessing backend data.

I expect to use these resources for building websites or even mobile applications, ideally when scalability and flexibility play an important role on what I am working on. I also learned that Resp API’s work alongside Node.Js and Express.Js. Node.Js is a back-end JavaScript runtime environment, while Express.Js is a web application framework for Node.Js. This relatively new information to me, due to my experience only using C++, Java, and Python for specific applications.

Rest API’s can be tested by integrating parameters and seeing how the output compares to the expected output, while also ensuring the correct error codes are being returned for methods like GET, POST, and others. The text also mentioned endpoints, and while I grasp the basic understanding, there is still more to learn in order to increase my confidence with this REST APIs Overall, I expect to use this knowledge and information in future jobs, as per my interest in software development, and in my personal projects. Additionally, I learned a bit more about swagger, which was introduced in class to demonstrate the GET, PUT, DELETE, and POST methods of the Rest API.

Source: The REST API Handbook – How to Build, Test, Consume, and Document REST APIs

From the blog CS@Worcester – Cinnamon Codes by CinnamonCodes and used with permission of the author. All other rights reserved by the author.