Category Archives: Week 9

Work Smarter, Not Harder

This week I was viewing the syllabus topics and found a short article written by Rosie Faulkner, LAMP stack developer, where she describes the principle of least knowledge relating to software development.

Rosie coins the principle of least knowledge as “One of the most important software design principles” and defines the principle as “loose coupling, in that your code or your class depends on the least number of other classes in order to function.”

Rosie also states that the principle’s main focus is modularity and that a code’s modularity is important as to reduce the chances of code becoming overly complex/opaque and/or causing naturally occurring errors to become a frequent issue. By keeping our code as simple as possible, developers can create and maintain code while being more confident that new changes or updates will not affect/break anything. The less dependent (where possible) your code can become from third-party libraries the more secure and clear your code becomes overall by allowing others to view what is being done directly versus having to familiarize themselves with a new library.

By following the principle of least knowledge a developer can avoid their code from becoming Rigid, Fragile, Immobile, Overly Complex, and/or Unclear (or Opaque). By restraining from using third-party code, you can reduce the reliance on outside systems (where possible) which in turn will help not only yourself but also others in being able to view and understand your code directly. This will allow everyone to meaningfully contribute to whatever the project may be since all will have a proper understanding of what is being done.

An example where this can be displayed, given by Rosie, is a class that allows you to locate a user’s country using the IP of the given user. Rosie states “You could use a third-party class to do so” but security may become an issue over time and unsuspected updates may cause outages resulting in downtime and/or errors for users. Instead, if you create your method to return a user’s country you can directly change and update the code as needed and be able to view and tweak code with more transparency.

I often find when I am coding that I tend to over-complicate whatever I am trying to do. One example would be looking for ways to work around creating functions myself by using external systems instead. After reviewing this article, It’s more prevalent to me that trying to create the least amount of lines for a block of code doesn’t always relate to the health of the code as well. By taking a step back and reviewing what I am trying to complete and what remains to be done, I will be able in the future to partition which code should be used and what should be refactored to create the most healthy and maintainable coding environment possible. This will save me from future headaches due to negating the risk of unexpected changes/updates breaking things.

Article Link: https://medium.com/@faulknerproject/the-principle-of-least-knowledge-in-software-development-499b7a28aa14

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

Embracing the Future of Coding with Gitpod

In the ever-evolving landscape of programming, developers often find themselves grappling with unforeseen challenges. Recently, I encountered one such obstacle during my computer science class, which eventually led me to explore a game-changing solution – Gitpod. This is the story of how Gitpod came to my rescue when Docker, a crucial part of an in-class activity, failed to run on my M1 Mac Pro, and my professor recommended Gitpod as a solution.

The Problem

As the class assignment required me to work with Docker containers for a web application, I was excited to get started. However, I hit a roadblock when I attempted to use Docker on my M1 Mac Pro. Due to compatibility issues with the M1 chip, I found myself unable to run Docker containers, leaving me perplexed and frustrated. My professor, understanding my predicament, suggested an alternative solution – Gitpod.

A Quest for a Solution

Eager to continue with my assignment and make the most out of the in-class activity, I immediately began researching Gitpod. This cloud-based development environment promised to provide a solution to my Docker woes while offering a host of other benefits. Without further ado, I dived into the world of Gitpod.

The Gitpod Experience

Upon signing up for Gitpod, I discovered the true power of cloud-based development environments. Gitpod provides an intuitive interface that closely resembles VSCode, making the transition remarkably smooth. It offers a wide range of programming languages and frameworks, ensuring that it can cater to almost any development needs. One of the most remarkable features of Gitpod is its ability to create a development environment based on a Git repository, making collaboration with peers more efficient.

Additionally, Gitpod’s integration with GitHub is seamless, as it allowed me to work directly with my project’s repository. This feature made it easy to commit and push code changes, ensuring that my work was well-organized and readily accessible.

The Benefits of Using Gitpod

  1. Compatibility: Gitpod works seamlessly on M1 Macs, resolving the compatibility issues that I faced with Docker.
  2. Accessibility: Gitpod is accessible from anywhere with an internet connection, which is a major advantage, especially for students and developers who are always on the move.
  3. Time Efficiency: Gitpod’s pre-configured environments saved me hours of troubleshooting and setup, enabling me to focus on coding and project development.
  4. Scalability: As my project expanded, Gitpod effortlessly scaled to accommodate my needs without compromising performance.
  5. Collaboration: The collaborative features of Gitpod made working with my classmates on group projects a breeze. We could effortlessly share and collaborate on code in real time.

Conclusion

In the end, the incompatibility of Docker with my M1 Mac Pro might have been a setback, but my encounter with Gitpod was nothing short of transformative. It provided a solution to my immediate problem and introduced me to a world of cloud-based development environments. Gitpod has become a valuable tool in my programming arsenal, and I encourage every developer to explore its capabilities.

References:

  1. Gitpod – The Dev Environment Built for the Cloud
  2. Visual Studio Code – Docker Extension
  3. GitHub – The World’s Leading Software Development Platform

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

CS343 Blog Post for Week of November 6, 2023

This week, I wanted to continue writing about the SOLID software design principles. We’ve reached the letter “I”, which represents the Interface Segregation Principle. I’ve been noticing a theme across the SOLID design principles that as many parts of your software as you can manage should be independent of one another, so that modifications can be made to a part without compromising the whole. The Interface Segregation Principle brings the relationship between the software user and designer into focus.

Once again defined by Robert C. Martin, the Interface Segregation Principle is “Clients should not be forced to depend upon interfaces that they do not use.” This principle goes hand-in-hand with the previously defined Single Responsibility Principle, which declares that “A class should have one, and only one, reason to change.” The goal of abiding by these principles is to produce code that is resilient to future modifications and fostering that resilience by building independent software components.

The article provides the real-life example of a years-old piece of software being iterated on. The designers may want to add new methods to existing interfaces, even though that may introduce new dependencies to the interface and violate the Single Responsibility Principle. The author introduces the term “interface pollution”, referring to the phenomenon of existing interfaces becoming cluttered with new methods that introduce new responsibilities to the interface, rather than building new interfaces that handle those responsibilities.

The author provides a practical example of this principle through another Coffee Machine implementation. A new EspressoMachine class is proposed but requires a new method that the BasicCoffeeMachine interface doesn’t include. The problem of interface pollution is illustrated simply in this example, when a brewEspresso() method is added to the CoffeeMachine interface to support the new EspressoMachine class. No other kinds of CoffeeMachine would use this method. This approach also introduces the issue that BasicCoffeeMachine could try calling brewEspresso(), or EspressoMachine could try calling brewFilterCoffee(), and either case would throw an exception.

The solution in this case is to create new interfaces from the existing CoffeeMachine interface, FilterCoffeeMachine and EspressoCoffeeMachine. This way, only the methods required by either type of concrete CoffeeMachine class can be accessed. This approach strengthens the independence of the concrete classes. If a new CoffeeMachine design demands methods from both interfaces, it can simply implement from both.

I chose to write about this topic because I’m still learning how to assign responsibilities to different parts of my software. Having interfaces that contain too many methods rather than continuing to further specialize them is an issue I’ve faced in software that I’ve written myself. Studying the SOLID principles and actively applying them to my work will help save me a lot of time and effort in my future projects.

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

Exploring the Significance of REST APIs

REST APIs: How They Work and What You Need to Know: https://blog.hubspot.com/website/what-is-rest-api

Introduction: In the ever-evolving landscape of software applications, the demand for seamless data sharing and communication has propelled the prominence of Representational State Transfer Application Programming Interfaces (REST APIs). The blog post titled “What is REST API?” serves as a comprehensive guide, shedding light on the fundamental concepts, principles, and practical applications of REST APIs.

Reason for Selection: The selection of this resource stems from its ability to provide a clear and concise overview of REST APIs, making it accessible for both beginners and those seeking a refresher. The blog’s structured approach, starting with basic terms and progressing to the principles of REST, makes it an ideal starting point for anyone looking to understand the role of APIs in modern software development.

Content Overview: The blog begins by defining key terms such as clients, resources, and servers, setting the stage for a nuanced understanding of REST APIs. It then introduces the concept of REST as a set of guidelines facilitating internet communication for efficient integrations. The six rules of REST APIs, including client-server separation, a uniform interface, and statelessness, are elucidated, providing a solid foundation for grasping the core principles.

Reflection on Material: The content not only explains what REST APIs are but also delves into the reasoning behind each rule, offering insights into their importance. The emphasis on statelessness, for instance, is justified by the reduction in server memory requirements and improved scalability. The layered system principle is exposed, highlighting the role of intermediary servers without disrupting client-server interactions.

Applicability in Future Practice: Understanding REST APIs is crucial for anyone venturing into software development or related fields. The blog’s breakdown of HTTP methods, URLs, and the common language of communication, HTTP, provides practical knowledge that a student can directly apply in API development. The explanation of caching and its role in enhancing server efficiency offers a valuable insight that can be leveraged to optimize web applications.

The blog’s real-world examples of REST APIs, such as Twitter, Instagram, Spotify, and HubSpot, illustrate the versatility of REST in various domains. For a student aspiring to build applications with social media functionalities or integrate music-related features, this resource serves as a roadmap for leveraging existing APIs effectively.

Conclusion: In conclusion, the blog post serves as an excellent resource for grasping the fundamentals of REST APIs. Its adherence to the recommended length, coupled with its clear and informative content, makes it a valuable asset for students and professionals alike. The insights gained from this resource can empower students to navigate the complex world of API development with confidence, laying the groundwork for successful future practices in software development.

From the blog CS@Worcester – Site Title by rkaranja1002 and used with permission of the author. All other rights reserved by the author.

Enhancing Development Environments with Dev Containers

When you work in a codespace, the environment you are working in is created using a development container, or dev container, hosted on a virtual machine.

Dev Containers are Docker containers that are specifically configured to provide a fully featured development environment. They are a crucial part of our course material, and this blog post will explore their significance and functionality.

Summary of Dev Containers

Dev Containers are isolated development environments created in virtual machines, ensuring a consistent setup for everyone working on a project. They can be customized to match the specific requirements of a repository, enabling the inclusion of frameworks, tools, extensions, and port forwarding.

Why Dev Containers Matter

The reason for selecting Dev Containers as our topic is simple: they are a game-changer for modern software development. With write permissions to a repository, you can create or edit the codespace configuration, allowing teams to work in a tailored environment. They eliminate the “it works on my machine” problem, providing a consistent, reproducible setup for all team members.

Reflection on Dev Containers

As I delved into this topic, I was particularly struck by the flexibility and versatility of Dev Containers. The ability to create custom configurations, use predefined setups, or rely on default configurations makes it adaptable to various scenarios. It’s not just about convenience; it’s about ensuring that development environments are well-structured and efficient.

What I Learned

One key takeaway from studying Dev Containers is the importance of clear and standardized development environments. This is especially vital in large repositories that contain code in different programming languages or for various projects. It’s not just about having the right tools; it’s about having them consistently available to every team member.

The use of Dockerfiles, referenced in the devcontainer.json file, is another fascinating aspect. Dockerfiles allow you to specify the steps needed to create a Docker container image, making it easy to reproduce your development environment.

Applying What I Learned

In my future practice, I plan to leverage Dev Containers in collaborative projects. The ability to define a single dev container configuration for a repository or multiple configurations for different branches or teams is a feature I intend to use strategically. By tailoring development environments to the specific needs of a project, I aim to improve productivity and ensure that every team member has the tools they require.

Resource Link

Introduction to Dev Containers

In conclusion, Dev Containers are a powerful tool in modern software development, ensuring consistency, efficiency, and collaboration within development teams. By understanding how to create, customize, and apply Dev Containers, we can take our projects to the next level and tackle complex coding challenges more effectively. This topic directly relates to our course material, offering practical knowledge that can be applied in real-world scenarios.

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

Find Mentors

Hello and thanks for coming back to another week of my blog! This week, I took a look at chapter 4 in the book Apprenticeship Patterns by Dave Hoover, called “Find Mentors.” Having a mentor can help you get guidance, support, and feedback to help you get better in your field. This apprenticeship pattern gives tips on how to find a mentor, like looking for people who are respected in your industry, going to conferences, and asking for feedback from your colleagues. It is also important to be open to feedback and find more than one mentor to get different perspectives. The computer science field is still relatively new, so there are not that many truly skilled mentors that excel in all computer science areas that are available to look up to. The pattern also says that you may encounter mentors that you may not be able to talk to, such as people making informative YouTube videos who live overseas. But those people are still mentors who inspire you. The pattern also emphasizes how hard it actually is to find a mentor. While there are many skilled people in the computer science field, not all of them are open to mentoring. Therefore, you should always ask if they are interested in mentoring people because you never know if they will accept being a mentor.

As an aspiring computer science major myself, I should also be on the lookout for mentors. There are several ways I can find mentors. The book says I should pick a tool, library, or a community that has an active mailing list and sign up for it. Other ways include asking faculty members at university, who are definitely more skilled than me and are always open to answering questions. Reaching out to alumni is a great option as well, since they were in the same boat as me when they started out. They could mentor me themselves or redirect me to someone they know who is skilled enough to answer my questions. Attending computer science events could be another option since it is a great way to network with professionals and ask them for advice. I would also have to keep in mind that as I get more experience, others may look up to me as a mentor and I would have to guide them on their long journey as well.

Thank you for reading.

From the blog Comfy Blog by Angus Cheng and used with permission of the author. All other rights reserved by the author.

Craft over Art

In software development, surpassing the expected work is very essential. This means going above and beyond the project specifications to create a product that not only meets but also exceeds the product owner’s expectations. When you see software development as a craft, you approach it as an art form, which requires imagination, innovation, and meticulousness. This approach is particularly crucial when designing user interfaces, as the visual appeal of software can significantly impact the user experience. Therefore, striving for excellence in software development can elevate it from a mundane task to a creative endeavor that delivers results that stand out.

Personally, I try putting extra effort to go above and beyond when working on class or personal projects. This mindset not only promotes personal growth but also adds value to my portfolio. I especially take pleasure in crafting user interfaces that are not only visually attractive but also user-friendly. However, it’s crucial to be mindful of the balance between adding valuable features and spending excessive time on details that aren’t necessary. As software development requires careful planning and prioritization, focusing on what’s essential and avoiding distractions can save precious time and effort.

Balancing extra effort on client projects with their needs and requirements is essential. Adding unnecessary features can waste effort, and spending too much time on one project can harm others. Still, going the extra mile on critical projects can bring significant rewards and boost one’s reputation. Effective communication and understanding client priorities are crucial in making informed decisions on where to devote extra resources and attention. Ultimately, delivering work that satisfies the client’s needs while exceeding their expectations is key to success in software development and this is something I will be using in my future endeavors.

In conclusion, exceeding expectations in software development can yield positive outcomes and personal and professional development. Thinking software development as an art form can help produce anything that’s visually appealing and user-friendly interfaces, enhancing user experience. However, it’s crucial to maintain a balance between investing extra effort in projects and fulfilling clients’ needs and specifications. Ultimately, effective communication and understanding clients’ priorities are crucial in creating informed decisions on where to devote additional resources and attention.

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

Apprenticeship Pattern: The Deep End

This week, I delved into the Apprenticeship Patterns book once again and explored the chapter on “The Deep End”. The context of this pattern is that you are taking small steps and are left unsatisfied with your learning. You start to fear that you are in a rut, where your skills are decaying. You need to grow your skills, confidence, and your portfolio.

The solution given is to jump right into the deep end. Waiting until you feel ready can lead to never doing it. Growth only happens when you challenge yourself. This can be risky because failure is possible, but without risk, you cannot grow. This does not mean lying about your qualifications on a resume, it means taking promotions or tough assignments when they are offered. Even though taking on risk is advocated in this pattern, it makes it clear that there is a responsibility to offset that risk as much as possible. This could be as simple as having someone who can be there to help you out when you need it.

The action plan given is to think of the biggest project you have worked on and then try to find and measure its complexity. Then use the metrics you came up with to measure every project you have worked on and plot them. When you start a new project, you can compare it to your old ones and make choices based on it.

I chose this pattern because I have felt like I have been in a position where I am only making safe moves. It is a lot easier to stay at your current skill level and never try something new, but it is not sustainable. I need to constantly challenge myself so I can improve my skills as a software developer. Currently, the list of projects that I have on my portfolio is not long. Most of what I have coded has been small class work or homework assignments, but to stand out to employers, I want to get more complex projects under my belt. The takeaway from this pattern is to keep challenging yourself to improve your skills. Do not settle for where you are at because that is when you can slip into mediocrity.

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.

A Different Road Pattern~

Hello!

For the final pattern blog of the semester, I decided to close off with the “A Different Road” pattern from “Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman” by Dave Hoover and Adewale Oshineye. 

This pattern is related to following your own map but straying from the Long Road in the process. As you spend time following the Long Road, you may come to see that your values have changed. For example, you may value family or money more than before. Your goals may not align anymore and this may cause you to leave the Long Road. However, what you have learned along the way isn’t rendered completely useless–they can be applied in other ways to whatever you choose to do. 

You may realize after leaving the Long Road that you would like to go back. There may be some organizations that would give you a tough time for that gap in your resume, but there are some organizations that aren’t as bothered by that and may welcome your perspective of leaving and returning to the field. The pattern encourages you to not be afraid to go for something different, and either way, your skills can be utilized in a different way. You can take action by making a list of what you would do if you were not a software developer, and what you may enjoy– and reach out to people who are doing those jobs to learn what their experience is like, and compare it to what you like about software development.

I think this was a useful pattern to read. It is recognizing that some people change, and they may shift what their focus is on. I think it’s reassuring to see that it acknowledges the industry may be tough on people who have gaps in their resume but that wouldn’t be a complete set-back. It wouldn’t be the end if we can’t exactly make it back to the kind of position we were in before, but some important skills we gained along the way can be transferred to something new. There’s more flexibility than we think, and I think that I would definitely have this in mind going forward. Sometimes it feels like I may be reaching a dead end if I don’t meet certain deadlines, but of course, we all have different timelines and paths. I don’t have anything I disagree with for this pattern as I agree that diverging doesn’t mean the end of everything or means that everything would be wasted.

From the blog CS@Worcester – CS With Sarah by Sarah T and used with permission of the author. All other rights reserved by the author.

The Deep End

The Deep End approach is designed to motivate learners to take on difficult tasks and ambitious projects that may seem intimidating at first. The goal is to immerse oneself in unexplored territories and push past the boundaries of their comfort zone to accelerate learning and personal growth. By tackling challenging tasks, apprentices can gain a deeper understanding of their trade and develop their skills more rapidly.

As a software developer, I find myself identifying with The Deep End approach. It’s all too easy to become complacent with the familiar and continue with what we already know. However, by accepting challenging projects and tasks, we can reap immense benefits. This methodology recalls the saying such as, “Life begins at the end of your comfort zone,” which holds true for personal and professional growth alike.

I particularly value the emphasis on embracing uncertainty within The Deep End methodology. It can be fearful to dive into a project or task that is entirely new and unfamiliar, but by doing so, we are forced to learn and grow in ways that wouldn’t be otherwise possible. This is especially important in the fast-paced world of software development, where new technologies and techniques are continuously emerging. It’s critical to keep up with the latest trends and stay ahead of the game. Furthermore, I value the concept of assuming responsibility for one’s learning and development. Instead of relying on external sources to delegate assignments or undertakings, this approach motivates learners to actively seek out prospects to push themselves and expedite their progress. In my opinion, fostering this mentality is crucial, not only in software development but also in any discipline that necessitates ongoing education.

This pattern serves as a reminder that learning and development do not end with formal education or training. In fact, it is often the experiences outside of our comfort zones that provide the most significant opportunities for growth and development. Therefore, The Deep End pattern has the potential to unlock new possibilities and accelerate personal and professional advancement. As a result, I am committed to applying this pattern in my endeavors and look forward to the growth that it will facilitate.

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