Category Archives: Blog

LibreFoodPantry

LibreFoodPantry is a project that our community is working on not only as a way for students to learn but is also a humanitarian project to help others. What was nice that I discovered when looking through the “Values” of this project were the 16 FOSSisms that all educators should know. Not only are these useful for educators but also for us students as well. One of the things I found that stood out the most in this was, “FOSSism #11: It’s not what you know; it’s what you want to learn”. This piece of advice stands out as one where we should not look at the work we are about to do as just work, but a project where we can learn how to progress as futures Software Engineers.

Source: https://librefoodpantry.org/

From the blog CS@Worcester – Life as a CS Student by Dylan Nguyen and used with permission of the author. All other rights reserved by the author.

Familiarizing Myself With Thea’s Pantry

After visiting Theas Pantry’s gitlab, I was about to learn more about what I will be working on this semester and I can say, I am very excited. I will be on the team that will be working with the GuestInfoSystem. In the documentation repository, technology is what drew my attention. In this file, it lists what types of tools and frameworks we will be using for this project. Since I plan on being a full-stack developer, working with these technologies will help me further my knowledge with working with them. Not only that but working on this project will allow me to experience how it will be working with a team on a real project. It’s a preview of what I will be doing when I eventually start working at a company after graduation.

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

Familiarizing Myself With LibreFoodPantry

After visiting the website, LibreFoodPantry.org, I was really impressed by how clean the webpage looked. It really gives a brief idea on what this project is all about. On the main page it shows items such as the mission, values, status, and a few other things about the project. One thing that stood out to me was the User Story Map. I did not expect to see a layout of things that may be incorporated into the project. Seeing this as a student who will be working on this project allows me to better understand what I may be working on. The User Story Map shows features that may be added to the project based on interviews with clients. However, the story map doesn’t guarantee that everything on it will be incorporated, its more to help select what features to have and implement.

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

What is Javascript

Summary:

This article starts off by defining Javascript as a scripting or programming language that allows for us to implement complex features on web pages. It enables you to create dynamically updating content, control multimedia, animate images, and a lot more. They continue on with explaining Application Programming Interfaces and how they support the top side of Javascript. What is also explained is what Javascript is doing your page from browser security, to javascript running order, Interpreted versus compiled code, server-side versus client-side code, and dynamic versus static code. There’s also a section where we are shown how to add javascript to our page.

Reason:

The reason I chose this article is because we have been doing a lot with javascript on our in-class assignments and projects and I thought it was a good idea to find something that is informative and can help with that. We haven’t worked much with front-end languages and their functionality for long so this article can help give us a better in-depth look at javascript and how it functions.

What I Learned:

JavaScript is a scripting or programming language that allows you to implement complex features on web pages. Javascript  is a scripting language that enables you to create dynamically updating content, control multimedia, animate images, and lot more. APIs are functionality built on top of the client-side JavaScript language and provide you with extra superpowers to use in your JavaScript code. They fall into two categories, Browser APIs and Third Party APIs. Browser APIs are built into your web browser, and are able to expose data from the surrounding computer environment, or do useful complex things. Third party APIs are not built into the browser by default, and you generally have to grab their code and information from somewhere on the Web. A very common use of JavaScript is to dynamically modify HTML and CSS to update a user interface, via the Document Object Model API. In interpreted languages, the code is run from top to bottom and the result of running the code is immediately returned. Compiled languages on the other hand are transformed into another form before they are run by the computer. Client-side code is code that is run on the user’s computer, and Server-side code on the other hand is run on the server, then its results are downloaded and displayed in the browser. Dynamic Code refers to the ability to update the display of a web page/app to show different things in different circumstances, generating new content as required.

Source: https://developer.mozilla.org/en-US/docs/Learn/JavaScript/First_steps/What_is_JavaScript

From the blog CS@Worcester – Life as a CS Student by Dylan Nguyen and used with permission of the author. All other rights reserved by the author.

What is GRASP?

GRASP is short for General Responsibility Assignment Software Patterns. GRASP is a design pattern in object-oriented software development. It’s a tool for software developers that provides a way to solve organizational problems. Also, it offers a common way when talking about abstract concepts. This design pattern sets responsibilities for objects and classes in object-oriented program design

     In GRASP (General Responsibility Assignment Software Patterns) when working with object-oriented programming, it classifies problems and the solutions together into a pattern. Thus making them well defined where they can be applied in other similar instances. Grasp has nine different patterns for classes and objects that helps make it clear to show the responsibilities. The nine patterns are:

– Controller: Assigns the responsibility of dealing with system events.
– Creator: Most common in object-oriented system, which class is responsible for creating objects.
– High Cohesion: Evaluative pattern that attempts to keep objects focused, manageable and understandable.
– Indirection: Pattern that supports low coupling and reuses potential between two elements.
– Information Expert: The most basic principle – if we do not have the data we need, we would not be able to meet the requirement and assign responsibility.
– Low Coupling: A measure of how strong one element is connected to, has knowledge of, or relies on another element.
– Polymorphism: Responsible for defining the variation of behaviors based on the type is assigned to.
– Protected Variations: A pattern that protects elements from the variations on other elements by wrapping the focus with an interface and using polymorphism to create various implementations.
– Pure Fabrication: A class that does not represent a concept in the problem domain.

     I chose to write about GRASP (General Responsibility Assignment Software Patterns) because it is a part of our curriculum which we will be learning in this class. Since I have written about DRY (Don’t Repeat Yourself) and YAGNI (You Ain’t Gonna Need It), it made sense to continue researching about patterns and learning more about it. As I have mentioned many times before, I plan on becoming a full-stacked developer. Learning about these different types of patterns and what each of them do will help me as a developer become more knowledgeable and more efficient when it comes to coding. 

A good blog I found when researching this topic that I suggest to read and learn more about GRASP is:
http://www.kamilgrzybek.com/design/grasp-explained/.
This Blog is very useful and has many examples of the nine patterns I mentioned.

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

JSON

Summary:

This article gives us insight into JSON and why it is a popular format that we can take advantage of. We learn about what JSON is, the history of JSON and how it came to be, JSON structure, syntax, and usage, the benefits of JSON, and how to use JSON. After reading this, we should have a better understanding of how JSON works.

Reason:

The reason why I chose this article was because now since we are working with REST APIs in class, I felt that it was important to find an article that would assist with that. There’s a lot we still have to learn with JSON and after reading this I hope it helps anyone who reads this to understand the syntax and structure of JSON.

What I learned:

JavaScript Object Notation (JSON) is a data format that was built to be easily readable for both humans and computers. It has become the most popular way for applications to exchange data, and its most commonly encountered when working with APIs. JSON is a data interchange format that is easy to parse and generate. JSON is an extension of the syntax used to describe object data in JavaScript. It has a text format that uses object and array structures for the portable representation of data. All modern programming languages support these data structures, making JSON completely language independent. JSON is commonly associated with REST services, especially for APIs on the web. Although the REST architecture for APIs allows for any format, JSON provides a more flexible message format that increases the speed of communication. The structure of a JSON object are curly braces {} hold objects, the data are in key, value pairs, square brackets [] hold arrays, each data element is enclosed with quotes if it‘s a character, or without quotes if it is a numeric value, and commas are used to separate pieces of data. JSON data types are string, number, object, array, boolean, and null. The benefits of JSON are that it’s compact and efficient format, easily readable, broadly supported, self-describing, and has a flexible format. YAML is a superset of JSON that’s primarily designed to support more complex requirements by allowing user-defined data types as well as explicit data typing. Most popular programming languages have built in support to parse JSON, but they also include a plethora of JSON manipulation functions including the ability to modify JSON, save to and read from JSON files, and convert common data objects into data formats. JSON has become a vital tool of the developer arsenal because of its ease of use, efficiency, and flexibility.

Source: https://www.nylas.com/blog/the-complete-guide-to-working-with-json/

From the blog CS@Worcester – Life as a CS Student by Dylan Nguyen and used with permission of the author. All other rights reserved by the author.

What is Docker?

Summary:

This article goes over what docker is how it has it become so mainstream today. They generally go over what containers are, the components of docker, docker’s advantages, and even it’s drawbacks. Docker became popular due to the fact it makes it easy to move code for an application and all of its dependencies from the developer’s laptop to a server. After reading this article, we should have a general understanding of what exists within docker and how it works.

Reason:

The reason I chose this article was because we use docker very often in class and most of use had never heard of it coming into to computer science. Why suddenly was it something that seemed so instrumental in most of our assignments? As we continued to use docker, the more and more it appeared to use how versatile it was and the power of its capabilities.

What I learned:

Docker is a software platform for building applications based on containers, it uses small and lightweight execution environments that make shared use of the operating system kernel but otherwise run-in isolation from one another. Containers are self-contained units of software you can deliver from a server over there to a server over there, from your laptop to EC2 to a bare-metal giant server, and it will run in the same way because it is isolated at the process level and has its own file system. A docker file is a text file that that provides a set of instructions to run an image. A docker image is a portable read-only executable file containing instruction for creating a container. Docker run utility is the command that launches a container. Docker hub is a repository where images can be stored, shared, and managed. Docker Engine is the server technology that creates and runs the containers. Docker compose is a command-line tool that uses YAML files to define and run multi container Docker applications. It allows you to create, start, stop, and rebuild all the services from your configuration and view the status and log output of all running services. The advantages are that docker containers are that it’s minimalistic and enables portability, they enable composability, and they help ease orchestration and scaling. The disadvantages however are containers are not virtual machines, they don’t provide bare-metal speed, and they are stateless and immutable. Today container usage continues to grow as cloud-native development techniques become the mainstream model for building and running software, but Docker is now only a part of that puzzle.

Source: https://www.infoworld.com/article/3204171/what-is-docker-the-spark-for-the-container-revolution.html

From the blog CS@Worcester – Life as a CS Student by Dylan Nguyen and used with permission of the author. All other rights reserved by the author.

REST APIs

Summary:

This article helps us understand how to be able to read APIs and use them effectively by teaching us what we need to know about REST APIs. They go over The anatomy of an API request, Testing Endpoints with cURL, JSON, Authentication, and API versions. After reading this article we should be able to learn how to use cURL to perform request with GET, POST, PUT, PATCH, and delete. As well as that we should get a grasp on how to authenticate our requests with the -u option and what HTTP statuses mean.

Reason:

The reason behind choosing this article is because in class we just recently started learning about APIs and I think it is one of the most important real world skills we need in order to be a software engineer.

What I learned:

An API is an application programming interface. It is a set of rules that allow programs to talk to each other. The developer creates the API on the server and allows the client to talk to it. REST stands for “Representational State Transfer”. It is a set of rules that developers follow when they create their API. One of these rules states that you should be able to get a piece of data when you link to a specific URL. In the anatomy of a request, you have the endpoint, the mother, the headers, and the data (or body). The endpoint (or route) is the url you request for. The method is the type of request you send to the server and you can choose from GET, POST, PUT, PATCH, and DELETE. These methods provide meaning for the request you’re making. They are used to perform four possible actions: Create, Read, Update and Delete. Headers are used to provide information to both the client and server. It can be used for many purposes, such as authentication and providing information about the body content. The data contains information you want to be sent to the server. This option is only used with POST, PUT, PATCH or DELETE requests. JSON also known as JavaScript Object Notation is a common format for sending and requesting data through a REST API. On the web there are two main ways to authenticate yourself and that is with a username and password but also with a secret token. Developers update their APIs from time to time. Sometimes, the API can change so much that the developer decides to upgrade their API to another version. If this happens, and your application breaks, it’s usually because you’ve written code for an older API, but your request points to the newer API. You can request API version in two ways, and that is directly in the endpoint or in a request header.

From the blog CS@Worcester – Life as a CS Student by Dylan Nguyen and used with permission of the author. All other rights reserved by the author.

What is YAGNI?

     Just like my post from last week, YAGNI is another acronym in computer science. It’s an acronym for “You Aren’t Gonna Need It”. Which translate to only having features added when they are required. It’s another type of principle that is heavily followed in computer science. This is a large part of development since it trims away any excess and inefficient part of the program.

     The YAGNI principle tells you to mainly focus on current tasks. This however does not mean you cannot work on future steps but if it’s something that doesn’t need to be done currently, then you shouldn’t spend time doing it now since you can be working on something that will be more valuable now. A real-world example that I found can be that a client orders a kayak but is given a yacht. They both float on the water, but the yacht is like a luxury house on the water, where as the kayak is a simple vessel used to travel on water. In this case the yacht isn’t necessary as the client only wanted to travel or even just float on the water. This is considered “over-engineering”. This is a term that can be define as making something more complex instead of simplifying things

     There are many advantages to YAGNI. First, you will be saving time which also means you are saving money. Without having complex code, it makes it easier for others to understand the code. Without all the unnecessary coding, the code itself is better quality and allows developers to focus more on what the code is about instead of having to figure out what everything does. Following the YAGNI principle allows developers to not waste time on creating extraneous elements that may not be necessary or slow the development process.

     The reason why I chose to write about the YAGNI principle is because it is a part of our curriculum. Since I am planning to become a developer, I need to learn the different principles when it comes to programming. Learning about the YAGNI principle will help me become a better programmer as I will know to only work on the current tasks and not try to implement more complex code that will not be used until a later date or when it is necessary.

Here are some blogs I recommend to those who want to learn more about the YAGNI principle.
https://codibly.com/news-insights/yagni-how-to-do-things-when-you-actually-need-them-to-be-done/
https://whatis.techtarget.com/definition/You-arent-gonna-need-it

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

What is DRY?

First of all, what does DRY stand for? It is a term “don’t repeat yourself”. In the software engineering world, this is a principle of reducing repetition in the code, referring to a single source-or “snippet” -of reusable code whenever you need it.

An example of this could be an app that your programed that throws a ball for your dog once an hour throughout the day. Instead of writing the entire code out for finding the ball, picking up the ball, and throwing the ball every hour, you can write the code once and give it a name such as toss.ball. This will then allow you to just type toss.ball each time to call it. This saves a lot of time writing the code.

Not only are we saving time when first writing out the code, but it also means that there will be less human error as well. From the example, if we were to write out the code entirely 24 times (1 for each hour), you would be bound to make some sort of error at least once. Another reason how this is also effective is that if you wanted to change the object being thrown for example a stick, all you would have to do is change the term ball once, instead of doing it 24 times.

In terms of real life, we can see this being used when we let websites save our information such as logins, password, or any other type of information we would have to type in each time. The same goes for music. If we are using sites such as Spotify, most of us create playlists so we don’t have to constantly look for the song we want to listen to.

I chose to write about this topic because it is part of our curriculum. We will be learning about this principle along with others as it is an important part of coding. I will post a link that will take you to a blog I read. https://zapier.com/blog/dont-repeat-yourself/ I really enjoyed going taking the time to go through this blog because it taught me and showed the importance of reducing time when it comes to coding. I also recommend this blog to anyone who plans to become a software engineer because it goes into depth about DRY and uses many examples to help you understand how it works. It amazes me how a simple principle could do so much such as saving time, less human errors, and overall having a simple code.

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