Category Archives: Week 3

Blog 3 – Understand clean code

Coding is just like writing an essay, it requires a logical structure, clear message, and readability so others can understand it. That’s why we need “Clean Code” in every project of programming. Clean code refers to code that’s easy to read, understand, and maintain. The ultimate goal is not just working software, but software that remains clean and maintainable throughout its lifecycle. So, how do we write clean code?

According to the Codacy article “What Is Clean Code? A Guide to Principles and Best Practices” (https://blog.codacy.com/what-is-clean-code). They provide a good explanation about clean code and how do we make the code become more understandable for others to read, and also help us to improve more in coding skill.

Why Clean Code Matters

  • Readability & Maintenance: Clear code helps developers (including new ones) understand and navigate the codebase faster. blog.codacy.com
  • Team Collaboration: When code follows shared, clean practices, it’s easier for team members to read each other’s work and contribute. blog.codacy.com
  • Debugging: Clean structure (good names, simple functions) makes it easier to isolate and fix bugs. blog.codacy.com
  • Reliability: By adhering to best practices, you reduce the chances of introducing bugs and make the code more stable and reliable. blog.codacy.com

Key Principles & Best Practices

The article outlines several principles that help make code clean:

  1. Avoid Hard-Coded Numbers
    • Use named constants instead of “magic” numbers so their meaning is clear and changeable.
  2. Use Meaningful Names
    • Choose variable, function, and class names that reveal their intent and purpose. blog.codacy.com
    • If a name needs a comment to explain it, the name itself is probably too vague.
  3. Use Comments Wisely
    • Don’t comment the obvious. Instead, use comments to explain why something is done, not what.
  4. Write Short, Single-Purpose Functions
    • Functions should do one thing (following the Single Responsibility Principle).
    • When functions become long or handle multiple tasks, break them into smaller ones.
  5. Apply the DRY Principle (“Don’t Repeat Yourself”)
    • Avoid duplicating logic; reuse code via functions, modules, or abstractions.
  6. Follow Code-Writing Standards
    • Use consistent formatting, naming conventions, and style according to your language’s community or team guidelines. blog.codacy.com
    • Examples include PEP 8 for Python or common JavaScript/Java style guides.
  7. Encapsulate Nested Conditionals
    • Instead of deeply nested if/else logic, move conditional logic into well-named helper functions — improves readability and reusability.
  8. Refactor Continuously
    • Regularly revisit and clean up your code. Leave it in a better state than when you found it.
  9. Use Version Control
    • Track your changes using a version control system (like Git). It helps with collaboration, rolling back changes, and safer refactoring.

Automate Clean Code Practices

  • Codacy recommends using its tools (static code analysis, duplication detection, code metrics) to automate enforcement of clean-code rules as you write.
  • This helps catch code-quality issues and security vulnerabilities early, keeping the codebase maintainable and high-quality. blog.codacy.com

Mindset Over Rules

  • Clean code is more than following a checklist — it’s a mindset and a commitment to quality.
  • The article argues for writing code not just to work, but to be read and maintained by humans.

From the blog CS@Worcester – Nguyen Technique by Nguyen Vuong and used with permission of the author. All other rights reserved by the author.

Week 3-CS 343 blog: REST API DEVELOPMENTS AND BEST PRACTICES

Rest API is something that really interesting and fun to work with. It enables communication between different software systems over the internet, typically using HTTP protocol. However, Rest API can be difficult sometimes due to its complex queries and filtering, and also batch operations and side effects, etc…Good thing is I went through this blog written by “Medium”. They explained some of the good tips for us to practice with REST API calls. I will walk through their ideas and plans to help us be better at REST API.

Here is their blog https://medium.com/epignosis-engineering/rest-api-development-tips-and-best-practices-part-1-9cbd4b924285

  1. Planning
    • Do research first: Study existing REST API designs, standards, and popular APIs. Consider whether REST is the right paradigm, but also explore alternatives like GraphQL.
    • Look at other APIs: Try working with well-known APIs (GitHub, Stripe, Twitter, Paypal) to understand what work and what doesn’t

2. Foundations Matter

  • A solid early foundation avoids costly refactors later.
  • Assume the API will grow: design for scale, future endpoints, versioning, pagination, analytics, etc.

3. Specification

  • Write an API spec before coding
  • Use tools like OpenAPI/Swagger for designing your API contract
  • Specification pays off – especially for APs that are not just internal

4. Testing

  • Critical for APIs: because they connect server data with clients, they need to be very reliable
  • Don’t rely solely on manual testing – build an automated test suite
  • Focus on functional (black-box) tests, not just unit tests
  • Use a test database that can be reset; include regression tests for past bugs

5. Deploymemt

  • Decouple your API from other server apps: keep the API as a separate module.
  • Why? So updating or deploying one part doesn’t risk breaking everything else.
  • Independent deployments make development and operation safer and simpler.

6. Other Good Practices

  • Be consistent in resource naming: choose either singular or plural for your endpoints (/car vs /cars), but don’t mix.
  • For PUT or PATCH requests, return the updated resource in the response so clients know its new state.
  • Avoid using multiple forms of authentication or session mechanisms: for example, don’t mix custom tokens with default PHP session cookies (PHPSESSID) — it leads to confusion.
  • Don’t leak internal errors (e.g., SQL errors) to API consumers. Log the details internally, but return a generic 500 error externally for security reasons.

Why This Matters

  • The article is very practical: instead of rehashing REST theory, it focuses on avoiding pitfalls the author has personally encountered.
  • By planning, specifying, versioning properly, and testing early, you build a more stable and maintainable API.
  • A thoughtful deprecation strategy and good error-handling also improve reliability and developer experience for your API clients.

From the blog CS@Worcester – Nguyen Technique by Nguyen Vuong and used with permission of the author. All other rights reserved by the author.

Understanding REST Endpoint Naming and Why It Matters

For my third blog, I read “Best Practices for Naming REST API Endpoints” from the DreamFactory blog. The article explains why clear and consistent endpoint naming makes APIs easier to understand, maintain, and scale. It focuses on something every developer deals with when building REST systems: how to structure resources so the API feels predictable and easy to navigate. Even though naming seems like a small detail, the article shows how much it affects the overall design of a system.

It explains that good endpoint naming starts with using nouns instead of verbs and keeping the focus on resources, not actions. Instead of naming an endpoint something like /createGuest, the blog says you should use /guests and let the HTTP method determine what action is being taken. So POST creates a guest, GET lists them, PUT updates one, and DELETE removes one. Reading that made me think back to what we’ve been doing in class with our Model 5 work, where we looked inside the src/endpoints directory and saw how each file maps to a resource. All of our endpoints follow that same pattern, which helped me see why the structure feels clean.

The article also talks about keeping paths simple and consistent. It mentions using plural nouns, avoiding unnecessary words, and sticking to predictable patterns like /guests/:id. When I went back to look at our endpoint files listGuests.js, retrieveGuest.js, replaceGuest.js, and so on, I noticed how everything lines up with what the blog recommends. Each file handles one resource and uses the method, path, and handler structure to keep things organized. That connection made the blog feel way more relevant, because it matched exactly what we’re practicing.

I picked this article because it ties directly into the work we’ve been doing in class with REST API implementation. We’ve been learning how to structure endpoints, read OpenAPI specs, and understand how operationIDs match the code. This blog basically explains the reasoning behind those design choices. It also fits with the design principles we’ve been talking about, like keeping things modular and easy to maintain as the project grows.

After reading it, I realized that endpoint naming isn’t just a style preference. It affects how fast developers can read the code, how easy it is to extend the system, and how clearly the API communicates its purpose. When the names and paths make sense, everything else falls into place. My main takeaway is that good API design starts with simple, consistent patterns, and naming is a big part of that foundation.

Link: https://blog.dreamfactory.com/best-practices-for-naming-rest-api-endpoints

From the blog CS@Worcester – Harley Philippe's Tech Journal by Harley Philippe and used with permission of the author. All other rights reserved by the author.

Scrum

Pushing the Ball Forward Together

Photo by Ollie Craig on Pexels.com

Hello Debug Ducker here and recently I studied a framework used by Software Developers referred to as Scrum. Scrum is a framework that is meant to help teams find adaptive solutions for complex tasks. In layman’s is, it is a way to get hard things done small pieces at a time.

If you are wondering if Scrum is an acronym, well no it is a reference to a scrum in rugby in which teams in rugby work together to move the ball forward, which relates to teams working together to move the product forward.

The idea of Scrum is based on empiricism which is a theory that knowledge comes from experience and lean thinking to which means to focus on the essentials. The Scrum framework consists of the Scrum Team which encompasses the Product Owner, Developer, and Scrum Master who have different accountabilities on a project.

There are also very important pillars to take into account when talking about sprint which are Transparency, Inspection, and Adaptation, which can’t work well without each other. Inspection and adaption work as there is a lot of ongoing feedback during the process.

I was interested in the topic as I have recently learned about it in my software processes class and wanted to share my thoughts on it. As my understanding of it goes, it is based on reducing complexity by having different roles and small teams to handle the task. It also has steps that should be followed that are in specific time boxes, time boxes being the maximum amount of time the step can go on. The Scrum involves a time length for the task, referred to as a Sprint, that goes on specifically for 1 month or less.

I can see myself using this framework in the future, as it helps make those complex tasks easier to handle, especially in group projects. If a task is too great, then perhaps Scrum should be used to make sure the task is not as bad and easier to handle for the groups’ sake. Even though Scrum in this instance refers to Software Development, I can see it being used in other possible fields that involve working together, but that’s just me. There is more to Scrum than just what is referred to here, there is a free guide online that I recommend any viewer interested in software development to check up known as the Scrum Guide that can guide you through it. The link to is down below.

The Scrum Guide

 That will be all from, have a nice day.

The 2020 scrum GUIDETM. Scrum Guide | Scrum Guides. (n.d.). https://scrumguides.org/scrum-guide.html#the-sprint

What is Scrum?. Scrum.org. (n.d.). https://www.scrum.org/resources/what-scrum-module

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

version control

For this week’s blog post, I will be focusing on Version control. Version control is a software tool  that helps software teams and programmers keep track  of updates when working on a project. In a software team, there are multiple people in a group and there are multiple changes made  in a project. Multiple users in a team are working on different files under the same project folder, and  through version control  each team mate’s work progress is saved. For software teams and programmers, through version control, updates and changes in a project folder can be traced, and a user can view what lines in a file have been modified, deleted, added. During times when dealing with errors, with  version control  users can track back to where exactly in their code an error is occurring.

When I was choosing a topic for this week, this topic was important to me because I wanted to build upon what I know about git. I am glad that in this course we are going to spend time on git. Over the summer, I worked on a few different software projects. When I was first starting off, I didn’t know much about version control. As time went on, I became familiar with how  version control works. I had used a version control called Git. With git, I was able to use version control in visual studio code. When I was doing these projects, I wished that I had used version control to fix or prevent errors. In  Introduction to programming and in unix programming, we are taught   to test or run code in small bits,  and not build a whole program and run it at once. When I was doing these projects, I was building a whole program and running it, but as time went on, I realized that I should work with simple parts of code at a time. 

Moving forward, I want to double check my code, and I can do that through version control, and make that when working with code to apply the techniques taught to me in previous classes. For software teams, there  is a branch where software teams work independently on parts of a project,  and can merge their parts together. 

Branch can be effective as teammates can work on their parts  of code, make sure there are no errors, and bring together their error free parts of a  program. 

Blog url:  What is version control | Atlassian Git Tutorial

From the blog CS@Worcester – jonathan's computer journey by Jonathan Mujjumbi and used with permission of the author. All other rights reserved by the author.

On the subject of Inheritance…

In this post, I will be exploring the concept of inheritance in object-oriented programming. Inheritance is one of the core principles of OOP that allows a new class to inherit properties and behaviors from an existing class. The largest benefit of inheritance, in my opinion, is the ability to eliminate unnecessary (or otherwise necessary) repetition in the code. This week, we discussed design smells, and excessive repetition is one that can make code incredibly tedious to read and maintain, and it is one that can be eliminated or minimized by proper use of inheritance. The blog post I will be referencing this week can be found here, and it provides a very detailed example of inheritance as well as some further explanation of vocabulary and more advanced concepts that we have not yet covered in class, like upcasting and downcasting. I chose it because of these extra details it provides; most resources I found about inheritance provide the definition and a basic example, without going much further.

Let’s consider a practical example related to the one used in the blog post. Imagine you’re developing a software application for a zoo. You might have a base class called Animal that includes properties like name, age, and methods such as makeSound(). From this Animal class, you could create specific subclasses like Lion and Elephant. Each of these subclasses would inherit the properties and methods from Animal, allowing you to easily manage common functionality while still being able to define unique behaviors for each animal.

To expand on some of the details provided in the blog post, we could also create an instance mufasa of the Lion class and assign it to some Animal a1 = mufasa;. This would be allowed as upcasting, since Lion extends Animal. We could also then downcast a1 back into an instance of the Lion class, because at runtime, a1 will actually be a Lion instance.

Again, the main advantage of inheritance is its ability to promote code reuse. Instead of duplicating code across multiple classes, you can simply extend an existing class. For instance, if you needed each animal to have a method eat() that does the same thing for any animal, you could just implement it to the Animal class instead, saving time and space and keeping your code cleaner. The elegance of inheritance lies in its ability to create a hierarchy of classes. In our zoo example, you could further extend the Elephant class to create subclasses for different species of elephant, each with its own unique features, all while retaining the common behaviors defined in Elephant. The real world is full of hierarchies, and understanding how we can mirror those relationships programmatically when we want to represent or implement them in our code is a critical skill to have for an object oriented programmer.

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

Scrum: Is it really that bad?

I was reading an article called “Why Scrum Fails” by Jason Godesky. The link is here: Why Scrum Fails | Better Programming. It is pretty a list of much all the pitfalls Scrum contains. The author lists many points for why Scrum is not a good wat to achieve Agility. He criticized the increments saying that they do not focus on customers and giving working software. He then criticizes self-managing teams by saying that managers can interfere. They could see their positions threatened, since there are no managers in scrum teams, and try to squeeze themselves into teams. Managers may try to take management task from the developer’s shoulders as a good gesture but in actuality they take away the team’s autonomy. No one is willing to just give up their role in the company. The author also mentions a “monkey’s paw” situation where companies that want to have a quick and painless way to improve output get it and later stunt the company growth. This is mainly because companies refuse to use Scrum to transform the company but instead delegate it to a developer only thing.

This made me think of what I learned previously about Scrum. I thought it was a structured and reasonable process. First there is the Sprint where ideas turn to value. Then Sprint Planning to plan for the work that will be done. Then the Daily Scrum which acts as a progress report. After that the Scrum Review which inspects outcomes and determines future adaptations. Finally, Review Retrospective which plans for the future. All of this seems reasonable. Although, after reading the article I can start to understand the criticisms. There is no role for the managers. But to counteract this I want to add that the managers could just become Scrum Masters. Maybe the role could be divided into two and have middle managers be involved. Also, there is no focus on working software but that could be added to the Definition of Done. Easy fix. To be honest it is strange to be introduced to something as a positive and helpful and then to immediate learn that it has so many faults.

To conclude, Scrum is not perfect which makes sense since it is man made. Also, a lot of the problems in Scrum is just how the companies enact it. For example, one critism was that Scum is mostly limited to developers and not companywide. Still there are still flaws. Nevertheless, I still think it is relevant to companies and would like to use it in the future. Overall, Scrum is not scum.

From the blog CS@Worcester – My Journey through Comp Sci by Joanna Presume and used with permission of the author. All other rights reserved by the author.

Concrete Skills – Building a Solid Foundation

Summary of Concrete Skills:

In the world of software development, it’s easy to get caught up in the latest technologies and trends. However, the Concrete Skills pattern reminds us of the importance of building a solid foundation of fundamental skills.

Key points of the pattern include:

  1. Mastering Fundamentals: Instead of chasing after every shiny new tool or framework, focus on mastering the fundamental skills that underpin software development. This includes things like algorithms, data structures, and design principles.
  2. Practical Application: Don’t just learn theory for the sake of it – apply your knowledge in practical ways. Whether it’s through coding exercises, personal projects, or internships, practical experience is essential for solidifying your skills.
  3. Continuous Improvement: Learning is a lifelong journey, and it’s important to continually strive for improvement. Seek out opportunities for learning and growth, and never become complacent with your current level of skill.
  4. Balanced Learning: While it’s important to focus on concrete skills, don’t neglect other aspects of your development, such as communication skills, teamwork, and domain knowledge.

My Reaction:

The Concrete Skills pattern really struck a chord with me because it reinforced something I’ve been realizing lately: the importance of mastering the basics. In a field that’s constantly evolving, it’s easy to feel overwhelmed by the sheer volume of information out there. However, this pattern reminded me that by focusing on mastering fundamental skills, I can build a strong foundation that will serve me well throughout my career.

One aspect of the pattern that particularly resonated with me is the emphasis on practical application. I’ve always been a hands-on learner, so I appreciate the importance of applying theoretical knowledge in real-world scenarios. Whether it’s through coding challenges or personal projects, I’ve found that practical experience not only reinforces my understanding but also helps me discover new areas for growth.

That being said, I do have a slight disagreement with the pattern when it comes to balancing learning. While I agree that it’s important to focus on concrete skills, I also believe that soft skills such as communication and teamwork are equally important. In today’s collaborative work environment, being able to effectively communicate and collaborate with others is essential for success.

In conclusion, the Concrete Skills pattern has reinforced my belief in the importance of mastering the fundamentals and continually seeking opportunities for growth. By focusing on building a solid foundation of skills, I’m confident that I’ll be well-equipped to tackle whatever challenges come my way in my journey as a software craftsman.

From the blog CS@Worcester – Hieu Tran Blog by Trung Hiếu and used with permission of the author. All other rights reserved by the author.

retreat into competence

This is one of those patterns that I feels important to apply to everything in your life, honestly. It’s a well-known phenomena that the more you learn in a field, the more you know that you don’t know much. It’s a sort of complicated sentence, but it rings true: You realize the gaps in your knowledge the more you progress. I find it interesting to approach this problem by doing something you know well, but limiting yourself in doing that in order to not stay stuck and comfortable with what you know already. It makes sense as a solution in that you sort of look back and realize all the progress you’ve made, but don’t stay in that mindstate for too long because it will end in the stagnation of your learning.

I personally feel the imposter syndrome very strongly, not just in programming but also in music and other hobbies that I enjoy. I think this pattern would really help with those who, like me, have a tendency to notice the things we don’t know. The one thing is that I don’t necessarily think that this solution is a “one size fits all.”

I usually take breaks when I feel like this, or just brute force through it. The reason I do this is because, in all honesty, I don’t really like assigning myself work that doesn’t need to be done. It feels as though I’m repeating myself if I go back and do something that I already know how to do when it’s not even an important job. Granted, if I were allotted an opportunity where there is work that needs to be done with something I’m very comfortable with, I’m obviously ready and willing to do it, especially in that mindstate.

That being said, if I weren’t so stubborn about spending my time the way I do, I think this would be a great way to ease that sort of dread regarding the possibility that you don’t know very much despite all the time that you’ve spent. I think it’s definitely a good thing to look back at the work you’ve done and say “you know what, I have gotten better over time,” comparing past self to your current self feels a lot better and more productive than comparing yourself to others, because you can actually see where you’ve grown and what that you are, in some sense, competent.

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

Indiv. Apprenticeship Pattern: “Expose Your Ignorance”

Between sprint tasks, I continued reading Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman by Dave Hoover and Adewale Oshineye for Software Capstone course this week, focusing on the “Expose Your Ignorance” strategy. In professional environments, software developers are often expected to have a deep understanding of the various tools and technologies they work with, but it’s common to encounter unfamiliar domains/situations.

This strategy approaches these situations by being transparent with employers/teammates about their learning process rather than pretending to already know unfamiliar content – even if the individual is able to self-teach the content to be able to follow through. In reality, they will need to learn the new technologies/skills regardless, and transparency on this allows employers and peers to also see your learning skills and personal growth over the course of a project. 

In doing so, software developers are approaching their situation from an honest angle which is far better for building professional relationships and management expectation. In a manager role, I would much rather hear 

‘well, this API is new to me but I’m making headway in learning and implementing it. I hit an obstacle, which may delay me.’

Over an employee claiming they are an expert and then failing to deliver on time.

As a part of this, the text also differentiates between an “expert” and a “craftsman”.  While experts focus on mastering specific platforms or domains, craftsmen are driven to continually learn and adapt by broadening their knowledge base. Naturally, the craftsman can’t become a master in every topic, but master craftsmen have developed in-depth knowledge of a few separate areas of technology throughout their career and ‘apprenticeship’. So, while they may not be the absolute expert on any given topic, they will have the skills to learn, adapt and overcome challenges involving almost anything.

I appreciated this differentiation and definition of what it means to be a craftsman. Earlier this week, I had a conversation with Professor Meunier in CS497 where he described similar concepts as they relate to graduates and job applicants. As an interviewer, he/others understand that graduates will not have deep knowledge in several areas yet but looks for a wide breadth of concepts/tools we’re at least familiar with and at least one area in which we have a deep knowledge. This could be visualized as a “T” shape – wide topped with one deep portion, but master craftsmen develop a knowledge structure more like an “M”, with a wide breadth of topics and a few with deep knowledge.

Sources: Hoover, Dave, and Adewale Oshineye. “Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman.” O’Reilly Media, 2009.

From the blog CS@Worcester – Tech. Worth Talking About by jelbirt and used with permission of the author. All other rights reserved by the author.