Author Archives: Dylan Nguyen

Apprenticeship Pattern “Your First Language”

This apprenticeship pattern describes how we should approach our first language and how develop our craft in it. The greatest and simplest way for us to master our first language is to tackle real problems to solve. It is beneficial for us to practice problems and code that provide feedback to us with an example being using a print line function to see what we’re getting from specific functions and methods from maybe certain APIs. These test-driven results really teach us to take small steps in developing code and to take a step-by-step approach to testing out assumptions on what we’ve written. We also should always try to learn from more experienced peers. They can help provide insight into some of the nuances in the programming language we are trying to learn.  Also, don’t shy away from focusing on what you’re not good at, try to branch out of what you’re comfortable with and try different types of coding outside of your comfort zone.

What I’ve taken away from this is to try and solve real situational problems to help us learn how to code. A lot of times as students, we tend to just try to get assignments done without truly understanding how certain parts of our code work. We are just learning our first programming languages and are never forced to understand how to use certain things for specific situations. That’s where I believe that using mentors to our advantages work very well. We are able to ask them for help to help us understand the reasoning behind why we use certain things.

This pattern has been insightful into the basics of how to approach my first language. I personally shy away from the things I am weak in and tend to focus more of my time into what I’m good at. As a software engineer, I shouldn’t be scared to tackle problems that I’m not comfortable with but now feel as though I should go back and revisit what I’m not comfortable in. I should be able to use my resources and the people around me to begin to get better at what I’m bad at and to use test driven results to help bridge the gap with what I’m bad at. If I do not understand something, there are always ways to get around and to better myself.

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.

Apprenticeship Patterns Chapter 1 and Chapter 2-6 Introductions

            From reading chapter one and the introductions of the rest of the chapters, I get a true sense of what it takes to become a craftsman in the world of software engineering. Getting better at this craft is all about one’s mentality and how they deal with being able to learn and having a growth mentality. We need to always be adapting and changing, and if we come in with our cup half full then there’s always room to grow. After graduating we are looking to become apprentices and learn what we can from those around us who have been coding for years. Once we have taken all we can at some point is when we can then change jobs or get promoted to learn more. The journeyman part is really where I believe that a lot of us will be for most of our lives. We’ll always be trying to grow in new and different technologies as software engineers. We want to be able to take what we’ve learned from one place to another to be able to compare what works and what doesn’t as well as just learning as much as we can. Here we want to begin building a bigger portfolio that is diverse and pushes us to someday to become masters at our craft. What is also important to know is that we will never know everything about certain languages and coding; there will always be something to learn and most likely someone to learn from. We should never be satisfied about where we stand as software engineers, for example, we have strictly been using java in class and may have gotten good with is, but it doesn’t mean that we should just stick with it because we’re good at it. We should branch out and try learning new things or even try exceling in more advanced java that you haven’t even thought about learning. There is always room to grow, and it is up to us to take the time and put in effort to learn. There are plenty of books such as this one for us to grow as software engineers, from books to blogs, to other online sources, information is at the touch of our fingertips, and it is up to us to better ourselves at our craft.

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.

Thea’s Pantry

Thea’s Pantry Client is an integrated software solution for the actual Thea’s Pantry that is created by its students at Worcester State University. While looking through the project on gitlab, what I found most interesting was architecture of the software. It was amazing to see all the features that already exist to make it work from the inventory system to the reporting system. There are so many pieces to each thing that make it all work such as in inventory system it has a CheckOutGuest, AddInventory, CheckInventory, InventoryBackend, InventoryEvents, and InventoryDb. The reporting feature also is an interesting part of it that we have not worked with yet, and they generate reports of the backend as well as guest info and the inventory.

Source: https://gitlab.com/LibreFoodPantry/client-solutions/theas-pantry

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.

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.

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.

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.

Interface vs Abstract class vs Concrete class

Summary:

As a programmer, java is all about classes and there are design patterns that we must follow, and it is our duty to question them. Java is an object orientated programming language where we have the ability to write our code in the form of reusable classes. Code re-usability doesn’t start by creating objects out of classes, it starts way before that when we are creating the classes itself. The class types that we have available to us are Interface, Abstract, and Concrete classes.

Reason:

The reason why I chose this article was because I thought this article would help us understand why we us certain classes and when to use them. In class we have gone over different design patterns where the uses of every class are different depending on what we want to achieve. I believe that it is important to fully understand how they each function as it will make understanding the design patterns much easier.

What I’ve Learned:

Interfaces are a blueprint for your class that can be used to implement a class and an interface cannot have any concrete methods. What your interface can have are static members and method signatures. All methods that you declare in an interface can have static, default or abstract modifiers. Abstract methods cannot have a body; all they can have is a method signature. Variables are not allowed in interface. Hence any data declaration is public static final. Interfaces can extend other interfaces (one or more) but not classes (abstract or not). Interfaces cannot be instantiated as they are not concrete classes. Methods and constants cannot be declared private, methods cannot be declared final.

Abstract classes are a bit different from interfaces. These are also used to create blueprints for concrete classes but abstract classes may have implemented methods. Abstract classes can implement one or more interfaces and can extend one abstract class at most. A class can be an abstract class without having any methods inside it. But if it has any methods inside it, it must have at least one abstract method. This rule does not apply to static methods. As abstract classes can have both abstract and non abstract methods. Static members are allowed. Abstract classes can extend other at most one abstract or concrete class and implement several interfaces. Any class that does not implement all the abstract methods of it’s super class has to be an abstract class itself.

Concrete classes are the usual stuff that every java programmer has come across for sure. It is like the final implementation of a blueprint in case you are extending it some abstract super class. A concrete class is complete in itself and can extend and can be extended by any class. The only condition is that all the methods have to be implemented in order for it to qualify as a concrete class.

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.

Why Encapsulation Matters

Summary:

In this article, they don’t show us examples of encapsulation but instead explain to us the importance of it and why we do it as software engineers. Initially, they start off with how encapsulation helps us hide the complexity of our code. The beauty of hiding our code is not having to understand all the details in order to be able to use it, we just need to understand a broader abstract concept and how it works and how we interact with it. They also explain to us what happens when are not able to achieve the proper levels of encapsulation in our design. That article continues as to why we need accessor and mutator methods in Java.

Reason:

The reason why I chose this article was because in class we have done a lot coding in regards to encapsulation and I thought that this would help me fully grasp the purpose and meaning of encapsulation. Encapsulation is the very essence of API’s and how they work and being able to understand this is very important since we may be creating API’s in the future.

What I’ve Learned:

Encapsulation is more than just defining accessor and mutator methods for a class. It is a broader concept of programming, not necessarily object-oriented programming, that consists in minimizing the interdependence between modules and it’s typically implemented through information hiding. Our software designs the visible parts of our modules/classes constitute their public interface, and this is exposed to the outside world, the rest of it should be hidden to the naked eye. With encapsulation us as humans deal with complexity by defining abstractions with public interfaces so that we are able to interact with them and all of the code that lies beneath it is unnecessary in order for use it. It is like an iceberg, only a small portion of it is visible on the surface, but most of its true size is hidden underwater where we cannot see it. Changes can we made in directional systems because internal implementation is encapsulated and because of that, changes can we safely done without affecting it’ public interface. By minimizing the impact of changes and independence of modules, we can achieve proper levels of encapsulation in our software that can handle change without breaking its users. Information hiding is important because it decouples modules that compromise a system and it allows for them to be tested, optimized, used, understood, and modified in isolation. This allows for other modules to be developed in parallel and eases the burden of maintenance without the fear of affecting other modules. Encapsulation is a desirable attribute that allows for the evolution of APIs and as long as we respect public interfaces of our abstractions, we are free to change whatever has been encapsulated. Failing to define proper abstraction with proper levels of encapsulation will end up causing difficulties when change happens. There is no way to change the public interface of an abstraction without breaking its users. Encapsulation is one of the tools we use that help us create good abstractions, but no level of encapsulation is going to make bad abstraction work.

Source: https://dzone.com/articles/why-encapsulation-matters

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.