Category Archives: Week 9

CS343 – Week 9

Front-end development is focused on the user experience with the site. They design the elements of the application that the user interacts with and ensures that the interface is fast and easy to use. As technology continues to grow with different devices with varying screen sizes, a challenge that has arisen for front-end development is the accommodation for the different screen sizes that want to access the same site or application. There are different programming languages for front-end development, including HTML, CSS, and JavaScript. HTML (HyperText Markup Language) allows browsers to display text or load elements, rendering webpages for users. CSS (Cascading Style Sheets) is the standard language to identify how HTML content will be displayed, such as fonts, foreground and background colors. JavaScript (JS) extends the functionality of websites beyond HTML and CSS. This gives websites the ability to refresh themselves dynamically and respond to user actions without page reloads. You can also model UI components like pop-ups and interactive sliders.

While the front-end interface draws a lot of attention to the general audience due to the visual interaction with it, the back-end forms the backbone of any online program. It includes the logic, data storage, and security features required to create a fully functional and reliable application. It is also responsible for processing client requests, interacting with databases, and generating responses to be delivered back to the client. There are several different responses that can be generated depending on the quality of the request. Examples of some responses include 200, 201, 400, 404, and 500. 200 OK indicates the request was successful and returns the requested data. 201 Created indicates another successful request but creates a new resource rather than displaying an existing one. 400 Bad Request indicates the server could not understand the request due to malformed syntax. 404 Not Found is a different type of client error response which indicates the requested resource could not be found. 500 Internal Server Error indicates the server encountered an unexpected condition which prevented a successful request.

The use of databases is important when it comes to designing the back end for several reasons. Data persistence is a positive outcome from databases and ensures that information is not lost when an application is closed or is restarting. It also allows for better data management and efficient mechanisms for inserting, updating, deleting, and retrieving information. Concurrency control is allowed through the use of databases, meaning multiple users or applications can access and modify data simultaneously.

Front-End Development: The Complete Guide (cloudinary.com)

Back-End Web Architecture | AppMaster

From the blog CS@Worcester – Jason Lee Computer Science Blog by jlee3811 and used with permission of the author. All other rights reserved by the author.

Open Source Software in Education

     In recent times I have started a job as a computer teacher for a private school, and as such I have had to become familiar with a variety of educational software. As an educator, it is important for there to be a plethora of accessible software to teach children digital literacy, as computers have become increasingly incorporated into more facets of modern society Open-source software is one avenue that allows young students access to important tools to learn and create, without incurring a hefty price tag for their school. This is especially true for those learning how to code since it is not exactly a subject that comes naturally to everyone. While there are certainly many free IDEs out there for any aspiring adult programmer to use, I am more concerned with young children who may not be able to understand all the complex operations of standard IDEs. The best answer I have found is the educational coding software Scratch, created by MIT. Licensed under the “Creative Commons Share Alike” license, Scratch provides a drag and drop block-based coding environment that is easily understood and accessible to children. This allows teachers to easily demonstrate basic coding concepts like if-then-else statements and assigning variables. There’s even Scratch jr., available on tablets, that has an even more simplistic UI designed for even younger audiences. MIT has also released App Inventor, a free open-source software for creating mobile applications. These coding applications highlight the ability of open-source software to easily adapt to changes in social needs. But educational software does not just encompass programming and mobile apps, it also extends to various tools needed for academic success. Software such as ONLYOFFICE and LibreOffice, which provides a free alternative to Microsoft Office, is appreciated by students who cannot afford the more popular and expensive version. Not only are these applications useful within the U.S. education system, but another benefit they provide is their international reach. Since they are online and free for anyone to download and copy, they can be distributed to anyone globally with an internet connection. This opens new avenues for providing education to those in need. Education is a sector in need of accessible tools so that we can better teach the next generation and expand access to reliable education within our own borders and beyond. Not only that, but in this modern time where the importance of digital literacy is at an all-time high, we need to start laying the groundwork for future developers. 

https://scratch.mit.edu/faq

https://elearningindustry.com/open-source-tools-to-boost-digital-learning

From the blog CS@Worcester Alejandro Professional Blog by amontesdeoca and used with permission of the author. All other rights reserved by the author.

application architecture, serverless

In CS-343, we’ve gone over three major architectures for designing applications. These three are the monolith, client-server and microservices architectures. Each has its strengths and weaknesses, but it seems as though if you can go with microservices, you should go with it as it provides stronger scalability and reliability even if it is much more complex.

From this, it seems like you would use the other architectures if you cannot afford to build a microservices architecture currently, do not have the time to do it, or if your team does not have the required skills / manpower to build up the architecture. It makes sense in the case where the application doesn’t need to be complex, but as time progresses, perhaps it will be that complex in the future, and having built from a monolith architecture ends up being a nuisance.

Out of curiosity, I wanted to learn about some additional types of architectures. I found this blog post written by Paul Gillin, and what stuck out to me was the serverless architecture model. His explanation of it is that it is an evolution of the microservices architecture, with the main departure being that it is, well, serverless. Services are run from software containers as opposed to being pulled from a server.

This idea interests me, not just because of not needing to construct a server with it, but also because it utilizes containers in a very effective way. In this course, I was interested in the practical uses of containers outside of simplifying development within a team, and it seems like this implementation is what I was looking for. Of course, there are some cases where a serverless architecture wouldn’t work, and this architecture is mostly suited for experienced teams due to its complexity, but it’s an interesting idea nonetheless.

After looking at other websites, I must mention that there is a distinction between a pure serverless architecture and one that utilizes containers. This webpage on the serverless architecture from DataDog makes this clear in the “Serverless Architecture vs. Container Architecture” section. Essentially, with a pure serverless architecture the cloud provider (AWS, for example) manages their servers, which means that you don’t have to manage it, but you do have to work with what they give you. With a container architecture, you have to update and maintain your containers, system settings, and dependencies for everything to work properly in place of a server.

With this distinction in mind, I definitely wouldn’t want to rely on an external cloud service, and so a container-based architecture does seem more appealing. Ultimately, though, every tool (and architecture in this case) has its uses, so it’s important to know and understand many architectures so you know what to use when you need to use it.

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.

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.