Category Archives: CS-343

Best Practices of REST API Design

I chose the blog post, “Best Practices for REST API Design” by John Au-Yeung because it addresses the best practices developers should be following when it comes to utilizing REST API. The blog shows us strategies that we can use so we can create items to the best of our abilities. In class, we have been using the REST API since Thea’s Pantry utilizes it. Due to this, while we have been learning a lot about it due to classwork and homework, it was interesting to be able to read other perspectives such as this blog. This is really our first introduction in our computer science classes on design like this so the more we can read and learn the better.

In the blog, the author focuses on creating user-friendly APIs that adhere to widely accepted principles. The foundation of REST API design is using nouns in endpoints to represent resources, such as /users or /orders, rather than actions like /getUser. This approach keeps the API intuitive and aligns with REST conventions. HTTP methods play a vital role, with verbs like GET , POST , PUT , and DELETE defining the operations on these endpoints. The principle of statelessness is key to this design, meaning each request from a client must contain all the necessary information for the server to fulfill it. This avoids maintaining client-specific state on the server, simplifying scaling and debugging. Error handling is another essential practice. APIs should return meaningful and consistent HTTP status codes, such as 404 for “not found” or 400 for “bad request,” paired with descriptive error messages to guide users on fixing issues. For managing large datasets, pagination, filtering, and sorting should be supported. These features enhance performance by limiting the data returned and allowing clients to specify exactly what they need. APIs should adopt JSON as the standard response format, as it’s widely used and easy to parse. Including appropriate content-type headers ensures compatibility across platforms. These practices foster better user experiences, maintainability, and scalability. By following them, developers can create APIs that are reliable, predictable, and efficient, promoting successful integrations across diverse client applications.

From the blog, I was able to learn the best practices when it comes to designing using REST API. Going forward, I plan to incorporate these practices as I continue to learn more about front end work. After reading, I feel like I will be able to increase my learning in this area as well as be able to share these practices with my peers.

https://stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design/

From the blog CS@Worcester – Giovanni Casiano – Software Development by Giovanni Casiano and used with permission of the author. All other rights reserved by the author.

Object Oriented Programming – Abstraction, Encapsulation, Polymorphism, and Inheritance

Within object oriented programming, there are four main pillars. These are known as abstraction, encapsulation, polymorphism, and inheritance. These four are essential in understanding object oriented programming and why it is important. While researching, I found a blog called “Encapsulation, Abstraction, Inheritance, and Polymorphism” by Cole Davis which I believe does a great job at explaining all four of the pillars as well as why they are important. I chose to write about this topic as I use object oriented programming all the time, and I plan to do it in the future. Because of this, I wanted to help share some information that I find to be very useful in understanding how it works in case anyone else wants to do the same.

Abstraction: One of the first major pillars you’ll learn about is known as abstraction. Cole Davis does a great job at explaining this pillar, as shown in a quote from his blog: “Abstraction is the process of combining many functions into one. Think of a thermostat. Typically, a thermostat allows the user to change the target temperature, select different modes such as heating, cooling, or fan, and turn the unit on or off. When we use a thermostat, we are unaware of the intricacies that create these functionalities under the hood. By exposing only the necessary abstracted functions to the user, we make it easier for the user to use our programs.” I really enjoyed reading this example as it relates abstraction to real-life terms instead of just using coding terms, making it a lot easier to understand. Essentially, abstraction does the same thing. It makes our code easier to understand, allowing others to get a high-level understanding of our program.

Encapsulation: The second main pillar is known as encapsulation. Encapsulation is the idea of hiding and restricting access to the implementation details of our objects. Basically, this protects the data and functions of our code from being improperly accessed by things other than our objects. It makes our code more robust and predictable, allowing others to see its purpose more clearly. Another major benefit of encapsulation is it allows us to see precisely where we can change implementation details, allowing us to safely change our program.

Inheritance: The third main pillar is known as inheritance. According to the blog “Inheritance is a technique that involves a child class “inheriting” functionality from a parent or super class.” This increases usability in our code as well as stops it from being redundant.

Polymorphism: The four main pillar is known as polymorphism. Polymorphism is a hard one to explain, but its very easy to show. Essentially, it is when child classes run the same inherited method that returns different values. They use the same method, but can return different values based on what they do. Polymorphism allows us to have a more dynamic inheritance, which enables us to use inheritance more for its values that it provides.

Link: https://medium.com/@colebuildanddevelop/encapsulation-abstraction-inheritance-and-polymorphism-26aa98042d41

From the blog CS@Worcester – One pixel at a time by gizmo10203 and used with permission of the author. All other rights reserved by the author.

Exploring REST API Implementation

In this blog, I’ll talk about the process of implementing REST APIs, their significance, and the key considerations for building good APIs. REST API implementation involves creating a structured interface for applications to interact with. Using HTTP methods like GET, POST, PUT, DELETE, and PATCH, REST APIs facilitate operations on resources. These resources are typically represented as URLs for example /users, /products, and the interactions follow stateless communication principles where each request is independent and self-contained. A simple example of a REST API might include GET /users: Retrieve a list of users. POST /users: Create a new user. PUT /users/{id}: Update details of a user with a specific ID. DELETE /users/{id}: Remove a user. It’s important to know why REST API implementation is important.Communication. REST APIs provide a consistent framework for systems to interact, regardless of their underlying technologies. This universality enables integration across diverse applications and platforms. Scalability and Performance.REST APIs are designed to scale easily, as their statelessness allows servers to handle multiple requests without maintaining client-specific sessions. This makes REST ideal for cloud-based applications. Business Value
Exposing services through REST APIs enables businesses to monetize their platforms by integrating with third-party applications or creating ecosystems like app marketplaces.

Some key steps in implementing REST APIs include Defining Resources and Endpoints. Identify the data and operations required by the API. For example, a library system might need endpoints like /books, /authors, and /borrowers. Choose the Right Tools
Use frameworks like Express.js (Node.js), Django (Python), or Spring Boot (Java) to streamline development. Ensure Proper Security.Implement authentication and authorization mechanisms like OAuth, API keys, or JWT to protect sensitive data. Document the API. Tools like Swagger can help generate comprehensive, developer-friendly documentation. Test and optimize.
Use automated testing tools to verify functionality, and monitor performance to identify bottlenecks. Some of the best practices for building REST APIs include Designing clean and meaningful resource URLs. Properly utilizing HTTP methods for specific actions. Using status codes to convey response status and errors. Implementing authentication and authorization mechanisms. I chose this topic because it talks about different aspects of implementing REST APIs. In conclusion, by understanding the key principles and specifications of REST APIs, developers can design APIs that facilitate seamless communication between clients and servers.

References.https://medium.com/@zappy_cordovan_shark_864/exploring-restful-apis-building-implementing-and-best-practices-4003a19df798

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

Specifying Rest Api Calls

In the world of modern software development, rest API’s enable seamless communication between systems, services and applications. Specifying REST API calls is equally important for ensuring clarity, functionality, and integration efficiency. Rest APIs provide a way for two applications to communicate, which enables your software to interact efficiently with various other services, thereby enhancing its capabilities and user experience. Rest APIs work by fielding requests for a resource and returning all relevant information about the resource, that is translated into a format that clients can easily interpret. Clients can also modify items on the server and even add new items to the server through a REST API. The six rules of REST APIs include client-server separation. The client sends a request to the server, then the server sends a response back to the client. Servers cannot make requests and clients cannot respond, and all interactions are initiated by the client. The second rule is uniform interface where all requests and all responses must follow a common protocol, or a way of formatting their messages. The third rule is stateless which means that every interaction is independent, and each request provides all the information required to complete the interaction. One important thing we need to understand is why use REST APIs. Rest APIs are flexible where they can handle many types of requests and send data in many different formats. Rest APIs are scalable. They are designed for communication between any two pieces of software, regardless of size.

Benefits of REST APIs help systems and applications communicate with each other. They are simple to use and implement. You can scale REST APIs easily and this is because they are stateless, meaning each request from a client has all the information your server will need to fulfil it. There are a few different types of APIs. One is private APIs.These are internal to an enterprise and only used for connecting systems and data within the business.Public APIs 

These are open to the public and may be used by anyone. There may or not be some authorization and cost associated with these types of APIs. Partner APIs.These are only accessible by authorized external developers to aid business-to-business partnerships. Composite APIs. These combine two or more different APIs to address complex system requirements or behaviors. Some of the steps to create an API are plan the API, build the API, test the API, document the API, and then market the API. I chose these resources because they explain REST APIs in more detail and how they are used in the real world.

References.

https://aws.amazon.com/what-is/api/

https://blog.hubspot.com/website/what-is-rest-api

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

Exploring FrontEnd

Front end development, often described as the face of a web application, plays a crucial role in shaping how users perceive and interact with digital platforms. Front end development basically creates the user interface (how the website looks like) of a website. Users directly see and interact with buttons, menus, text, and images, making it crucial for delivering a positive user experience and influencing how people perceive a digital product. This is important because it directly impacts user engagement, and overall website functionality by ensuring it is visually appealing. Some of the key points about front-end development are focusing on user interface. Developers primarily focus on creating the visual layout and design of the website, including how users interact with them. Another key point is core technologies. The primary languages used in front-end development are HTML (for structuring content), CSS (for styling elements), and JavaScript (for adding interactivity). I think it’s also important to know some key differences between software development in the front end and back end. Backend development is the process of building the components for running the application behind the scenes. Some examples are components for data storage, infrastructure, and code written in one or more programming languages. Users can’t access the back end. Front-end development is the process of building components that interact with users. Examples are the user interface, buttons, user-entered data, websites, and user experience (UX) features. The front end aims at meeting user requirements and delivering a positive user experience.

Pros of front-end development include improved user experience where websites are well crafted, functional, and visually appealing on any device and this attracts more users. Low maintenance cost where you can have websites that work seamlessly across all devices. Faster web pages that optimize your website’s performance, ensuring fast experience across all devices. Some cons of Front-End Developmentare Steep Learning Curve. With numerous tools, frameworks, and libraries available, staying updated can be overwhelming. Browser Compatibility Issues. Ensuring a site works seamlessly across multiple browsers and devices can be tedious. Rapidly Changing Technology. The fast pace of technological advancements requires constant learning, which can be challenging for developers. I chose this article because it goes further into detail about what we talked about in class. It talks about front end development in depth. In conclusion, front end development is an essential aspect of modern web and application development. It’s rewards in terms of user engagement, satisfaction, make it an exciting field.

References.https://cloudinary.com/guides/front-end-development/front-end-development-the-complete-guide

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

Adaptable Web Designs

I chose the blog post, “Designing for the Unexpected” by Cathy Dutton because it addresses how one can create designs that can combat unexpected content changes. The blog shows us strategies that we can use so we don’t get stuck in situations like this. On my own time, I have been learning how to create in the web design space so that was one of the main factors when choosing this blog. This is what led me to choose this blog post, so I can learn how to not make mistakes and so I can follow the strategies laid out to design in the most efficient way possible.

In the blog, Dutton explores strategies for creating adaptable web designs that accommodate unforeseen content changes and evolving device landscapes. She reflected on the evolution from fixed-width designs to responsive layouts, emphasizing the necessity of planning for flexibility from the outset. Dutton recounts her early experiences with web design, and  highlights the challenges of transitioning to responsive design, noting that it requires comprehensive planning during the design phase rather than being an afterthought. To implement responsive designs, Dutton initially utilized percentage-based layouts with native CSS and utility classes, later incorporating Sass for reusable code and more semantic markup. Media queries played a crucial role in this process, allowing designs to adapt at specific breakpoints to maintain readability across different screen sizes. However, she observed that this method often necessitated complex markup, posing challenges for content management, especially for users without extensive HTML knowledge. Dutton introduces the concept of intrinsic design, a term coined by Jen Simmons, which leverages new and existing CSS features to create layouts that respond organically to content and available space. This approach employs the ‘fr’ unit to distribute space flexibly without compromising content legibility, enabling designs to adapt dynamically to varying content and container sizes. Intrinsic design moves beyond predefined breakpoints, fostering components that are inherently responsive. The article also discusses the limitations of relying solely on frameworks like Bootstrap for responsive design. Dutton emphasizes the importance of designing for diverse user contexts, acknowledging that users interact with websites across various environments and devices. By adopting flexible design principles and focusing on content adaptability, designers can create resilient and future-proof web experiences that cater to unforeseen changes and diverse user needs. The blog advocates for a shift towards intrinsic design methodologies that prioritize content flexibility and responsiveness. By embracing CSS advancements and moving beyond rigid frameworks, designers can craft web experiences that gracefully adapt to the unpredictable nature of content and device evolution.

From the blog, I was able to learn the best strategies when it comes to designing an adaptable web interface. Going forward, I plan to incorporate these strategies as I continue to learn more about designing web pages. After reading, I feel like I will be able to increase my learning in this area as well as be able to share these strategies with my peers.

https://alistapart.com/article/designing-for-the-unexpected/

From the blog CS@Worcester – Giovanni Casiano – Software Development by Giovanni Casiano and used with permission of the author. All other rights reserved by the author.

REST API usage

I’m very unfamiliar with REST API’s but throughout most of our classes I’ve learned that they are very important especially in moving forward with development as a career. Since I was not very familiar with the topic I wanted to look up the basics of the API’s functionality, this is the site that gave me that information https://www.redhat.com/en/topics/api/what-is-a-rest-api. This site is basically documentation describing an API, REST API and REST all in their own individual categories.

The documentation covers the basics of REST such as the client-server architecture and communication, the representation of the requester and endpoints and the format the data is actually transferred through and the guidelines of the REST functionality as well. This post also covers the topic of what an API has to include to be considered a RESTful API, disregarding the aforementioned topics it covers the specifics of how the resources that are used by the client and modified on the server should react. Cacheable data that is transferred between both the client and server is also a topic brought up which I think is actually the most important since any data lost between actions would result in a broken / useless API.

Since I’m very uninformed on the topic of REST and I haven’t setup any personal development environments to work with such a thing, so I won’t be putting much of this newly gained knowledge to use as of this moment, but learning about it for future reference will definitely help me in the long run. I’ll most likely setup the development environments needed and study up more on the internals and all of the languages that work best for this type of development since understanding server and client architecture does not only represent working with REST. It also represents working with pretty much any application that multiple of your clients will use depending on what they ask for. This also gets more into the request part of the communication which I have never really looked into in depth, so being able to see how it functions will also help my understanding of most other server-client / client-server communication.

Honestly when we first discussed REST in our classes I still didn’t really understand the entire process of what exactly was happening. Reading through this post again though, definitely clarified some of the topics we went over and more, especially more into the back-end side of the API. Going forward I will continue to research more into REST, it seems very interesting to me and again, will be very helpful in understanding more about architecture in bigger programs.

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

Week 13

We started to work in the front end I became more curious about front-end developers. They are often the key if someone will even use a website to begin with. You can have a fully functional site but if it isn’t engaging it can lose people. In the past, this wasn’t something you had to deal with but there are so many things taking people’s attention that just doing the bare minimum isn’t enough. There are things that we don’t even think about that are key to a successful website. A main common feature now is dark mode if a website doesn’t come with this theme it can scare away users. Even simple things like where the search bar is placed are key for the navigation through the site. This week I decided to find information about front-end developers and how they achieve success.

The article starts by explaining what a front-end developer does. They create the graphical layout of a website or application. Front-end workers are usually hired by someone looking to build a website. They can create a site layout to give the buyer an idea of what their website could look like. It can save people a lot of money and hassle if their vision can reasonably be imagined by a front-end developer. A front-end developer’s main focus should be to place everything to benefit the user it should be simple and intuitive for the user. There are several job opportunities in this field from working in industry or having the freedom to be a freelancer. This is a job that offers a lot of challenges but with critical thinking, a solution can always be found. Many big companies hire this position including Microsoft and Meta are always looking for new front-end developers.

Reading this article showed me a new field in this space. There are many fields in Coding there are so many I find a new one every year. This field uses different coding languages including HTML, CSS, and javascript to name a few. I liked how this was a problem-solving job that there has to be actual decision-making need to be successful. This is a job that is engaging while trying to engage others to use your product. The key for a great front-end developer would probably have to be to not forget about the little things. This article reassures that keeping a user-friendly UI is the key to having a successful website.

https://www.coursera.org/articles/front-end-developer

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

Week 14 Post

This week’s post will cover a powerful and popular frontend tool, Node.js, that enables developers to execute JavaScript code outside the browser. By allowing JavaScript to run on the server side, Node.js has transformed the way developers approach web development, enabling full-stack JavaScript applications. The blog by Matthew Clark highlights the common uses for Node.js, for example, Node.js is often used for building real-time applications, such as chat apps and collaborative tools. Additionally, Node.js is a popular choice for developing REST APIs and microservices, enabling efficient handling of API requests and data exchanges between client and server. Another common use case is single-page applications (SPAs). These applications rely on seamless interactions between the frontend and backend, and Node.js allows developers to use JavaScript across the entire stack.

The V8 Javascript engine compiles JavaScript into machine code, ensuring fast execution, making speed one of the primary advantages of Node. The speed of a platform is crucial to creating an enjoyable user experience. No one enjoys a slow program. Additionally, Node can handle large volumes of simultaneous connections efficiently. Arguably the most important advantage is scalability. Node.js is designed to scale horizontally, allowing applications to handle increasing workloads by adding additional resources without significant architectural changes. Developers can use JavaScript on both the client and server sides, reducing context switching and improving productivity. This consistency simplifies debugging and maintenance.

Node is used by major companies like Netflix and PayPal. Netflix is particular uses Node.js to improve application performance, specifically for the server-side rendering of their video streaming platform. Its lightweight nature has helped Netflix handle millions of user requests with reduced startup time and increased efficiency. PayPal made the switch to Node to unify their frontend and backend development. This shift resulted in a significant reduction in development time and improved application response times.

One drawback to this tool is the asynchronous programming model, this model relies heavily on callbacks and promises. While this enhances performance, it can increase the complexity of debugging and code maintenance.

I chose this topic of research because it’s one of the most popular connection tools for frontend and backend development, and for good reason. One other tool that I came across during my research was Deno, a modern runtime for JavaScript and TypeScript, created by Ryan Dahl, the original developer of Node. Unlike Node, Deno is secure out of the box. It runs scripts in a sandboxed environment, requiring explicit permission to access files, networks, or the environment. Additionally, Deno has native TypeScript support and doesn’t require additional package managers.

Blog Post: https://dev.to/mattclark1025/why-node-js-for-web-development-in-2020-2ebc

From the blog CS@Worcester – Computer Science Through a Senior by Winston Luu and used with permission of the author. All other rights reserved by the author.

The problem with old GPU supply

CS-343, CS@Worcester

As we all know, graphic cards have been getting more expensive over the years. This is because of tariffs and product costs. As a result, gpu manufacturers need to increase prices. They do this to break even from the costs of production. We also have to consider that many graphic card chips originate from TSMC. This company is a semiconductor manufacturer. It supplies Nvidia and AMD gpu chips. These gpu chips are being made in Taiwan. They are finished being built in other factories around the world. Consequently, tariffs would apply to these products due to the tariffs on China’s products being exported to the U.S.

The next issue with these products is the increased cost in prices. It just becomes not worth it for average consumers to purchase these products. Currently, Nvidia, AMD, and Intel want to sell their newer products. These products are better than the current graphic cards in the market. They offer a performance increase ranging from 10%-20%. Living expenses are high, so many consumers have not being able to buy the current gpu’s in the market. During the holidays, they aimed to cut prices significantly. Their goal was to sell as many units as possible before launching the new products. 

According to the rumors AMD is going to try to sell the new gpu’s in different quarters in 2025. While Nvidia is trying to sell their new gpu’s separated time between the next low tier product. I believe they will not try to change this. It has worked by lowering stocks in the market. Consumers would either have to wait for the product they want or get the best one initially. 

For AMD new gpu’s are apparently going to have improved FSR by significant margins in comparison to RDNA 3. Let me explain further FSR is called FidelityFX Super Resolution. It is a program that will render games at higher quality frames. Additionally, it boosts the performance of the graphic card. AMD uses software like this to compete with Nvidia’s DLSS (Deep Learning Super Sampling). DLSS does the same thing for Nvidia graphic cards but performs way better. In some cases, it achieves around 30% better performance and image quality in frames. There is a gap between them because Nvidia created a gpu with DLSS first. It was able to refine DLSS more and more since the rtx 2000 series cards. 

Currently Nvidia gpu’s are more expensive due to using DLSS as the main feature to sell their gpu’s. Nvidia does not want to sell increased performance. If they did, it would cost too much to produce enough gpu’s to meet market demand. They increase the performance of cards by 10% to save on production costs. They improve DLSS by 20%-30%. This makes consumers not consider the base performance difference between previous generations gpu’s.

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