Category Archives: CS-343

Anestiblog #4

This week I read a blog post that I thought really related to the class about why software development is important. The blog is about a deep dive into the career of a software developer. It starts off describing software developers as the masterminds behind computer programs. The blog then gives what different types of software developers do, like how applications software developers are responsible for designing computer or phone apps, and systems software developers are responsible for operating systems level software. Afterwards , the skills needed for software developers are shown. Some of the skills are problem-solving skills, teamwork, motivation, and analytical strategy. The blog ends with the salary of software developers($110,000), and a message to motivate the reader for the future. I selected this blog post because software development is my dream job, and I thought it would be interesting to read about what I should expect for the future job. This blog has a good, in-depth description of how Software Development works, that I think every CS major should read. I think this blog was a great read that I recommend for many reasons. One reason I would recommend this blog is because of how deep it goes into the job of a software developer. The blog goes over what to expect, skills needed, the pay, and does it all at a high level. Another reason I would recommend this blog is because a lot of jobs that we need CS-343 for will all be similar to software development, so even if you do not want to become a software developer, you can still learn something. The last reason I would recommend this blog is because it could get people who don’t like software development into the area by showing them what to expect from the job. Knowing what to expect could really help open the doors for others to be interested in this field. I learned how many of the skills that are needed for software developers I have already like Java, and I also learned the skills that I have not learned yet like DevOps. The material affected me heavily because it showed me what skills to learn, and what to expect if I want my future dream of software development to come true. I will take all the knowledge given to me through this blog into the future by getting better prepared to do this job. Now that I know what to expect from software development, I will try to build on it for the future.

https://www.rasmussen.edu/degrees/technology/blog/what-does-software-developer-do/

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

Concurrency and Parallelism

In our most recent class, one of our in class activities mentioned asynchronicity for a JavaScript function. This function required us to use the “await” keyword for us getting data. I’d thus thought of doing a post on concurrency, but in my experience in using concurrency, I’ve noticed myself and others struggling with the difference between concurrency and parallelism. Hence, in order to clearly understand concurrency, I wish to also describe parallelism. 

An application that is neither parallel nor concurrent is one that is processed sequentially, typically one “where it only has a single job that is too small to make sense to parallelize.1

Parallelism is simply the separation of a task into multiple sub tasks. These sub tasks are simply parallel if they are worked on sequentially. If two or more sub tasks are being worked at the same time, the program is implementing both parallelism and concurrency.

Concurrency is the act of an application working on two or more parts of an application at the same time. One thread could be running through an array, while another is doing a separate calculation. If an application is running without implementing parallelism, then it is working on each part of the application.

An application that is both parallel and concurrent can partition parts of the application and executes the program’s sub tasks concurrently. It may also include programs that divide a subtask into further subtasks and run those concurrently too.

I picked this particular source because it articulates the difference between concurrency and parallelism, rather than just one or the other. It also has a section that shows the permutations of implementing concurrency, parallelism, both, or neither. Even though I know about parallelism and concurrency, this article in particular helped me visualize them. I did not know that one could implement concurrency without parallelism. 

I feel as through this article will help me understand some elements of homework #5, because it will likely include functions that are asynchronous, and therefore require us to acknowledge it by properly implementing the “await” keyword. While this article was oriented towards locally run applications, this will also aid with applications that are executed to and from servers, by which the topics of parallelism and concurrency will still render useful.

I have also created a program that attempts to implement concurrent execution between multiple sub tasks that exist from implementing parallelism, which this article helped me understand. Specifically, I generate a vector with integers, then split the vector into subtasks which are then run concurrently. Each vector sub task gives the average sum of their respective sub task. 

Links:

  1. http://tutorials.jenkov.com/java-concurrency/concurrency-vs-parallelism.html (the proper article sourced for the information)
  2. https://github.com/Chris-Archive/Vector-Parallelism-Concurrency (my GitHub repository of the example I used above in C++)

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

Design Smells

Hello everyone and welcome to my blog! This week I decided to write a blog on design smells. In programming, we write a lot of code and even a small mistake in the code tends to break the whole program which brings down the efficiency of the code. Design smells refer to the mistakes in the code that had to do with the way the programmer wrote the code which then tends to make a lot of problems due to the design on how the code is written. Design smells are structures in the design that indicate a violation of fundamental design principles and negatively impact design quality. If a programmer focuses less on code design, later the program tends to break easily even if a small feature needs to be added to it. In the article, Mr. Fowler says code smell is a surface indication that usually corresponds to a deeper problem in the system. Design smells are easy to spot if we know about them and what they are, hence, some of the common design smells are:

Rigidity: The program breaks if a single change is made in the code, hence had to go back, and make several changes to make the code work.

  • Immobility: the parts of the code if can be used in other system can’t be moved because of the high risk of breaking the original code.
  • Fragility: changes in the code that could make error in the different unrelated parts to the program, hence making it difficult to even change small section of the code.
  • Viscosity: Making the changes in the program in a right way is harder hence, code is easy to be broken.
  • Needless Complexity: having the code that is not useful and make the code hard to understand.
  • Needless Repetition: Various Repetition of functions in the code can be removed by refactoring the program.
  • Opacity: The functionality of a system or feature is unclear, or the code is unclear and very difficult to understand.

I choose this article because as a programmer above things are something we don’t want in our code, by learning about design smells one can know where to find it in the code and once you find it following the best practices such as refactoring can help solve design smells. As a programmer in the future knowing about these design smells helps me later in my everyday task in my job.

Links used:

https://martinfowler.com/bliki/CodeSmell.html

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.

Items API

The API is the most important aspect of web development. The program’s functionality is divided between the front end and the back end. Our assignment has been based on the front end since this week. Create, delete, list, update, and order items, among other things. To help you comprehend the entire process, I’ve created a rudimentary image that will aid with the demonstration’s layout.

Front-end web development, sometimes referred to as client-side development, is the process of creating HTML, CSS, and JavaScript for a website or Web application so that a user can see and interact with it directly. The difficulty with front end development is that the tools and techniques used to produce the front end of a website change all the time, necessitating the developer’s ongoing awareness of how the field evolves.

In an app, items are entries. Items are the rows in the table if you conceive of the app as a table. Items are made up of some basic information as well as values for each of the app’s fields. There can be many values (for example, several links to another app) and multiple sorts of values for each field (F.ex. a field of type date field consists of both a start date and an optional end date). A string id called a sub id is used to identify the type. The sub id values denote the kind of most fields, which is usually only one. Others have a number of sub ids. For each field, the sub ids and their values are provided below:

The Items API allows you to:

Verb             Path                                    Action                    Description

POST          /api/items                              create                    Create item

GET           /api/items/:id/image            image                   /api/items/:id/image

GET           /api/items                              index                     Query items

GET            /api/items/:id                        show                      Show item

PATCH      /api/items/:id                         update                   Update item

PUT           /api/items/:id                         update                   Update item

It takes a combination of programming, arithmetic, and human interaction to turn a visual design into a fully working  web design.

This will have an impact on you. HTML is loaded into a browser and interacts with other resources such as CSS and JavaScript to create a website. You may not be writing the code, but there are dozens of elements that a developer must consider in order to make this work, and you should be aware of these demands and effects, as well as the fundamental tools of the trade.

Developers have come to identify and specialize with one side of the front-end/back-end duality as both sides have become increasingly complicated. Most web engineers made a career decision about whether they wanted to work on the front-end or the back-end somewhere in the previous ten years, and new developers are making the same decision today: Do they want to work with front-end, presentation-level code, or back-end, processing-level code? It’s up to you to decide.

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

REST APIs

My experience with APIs outside of classwork is very limited, so I wanted to take this opportunity to further familiarize myself with them. After a discussion in class, I am especially eager to learn more about REST APIs and how they might differ from other APIs. Jamie Juviler’s “REST APIs: How They Work and What You Need to Know” is a very good start.

Introduced in 2000 by Roy Fielding, REST APIs are application programming interfaces that follow REST guidelines. REST, which stands for representational state transfer, enables software to be able to communicate over the internet in a way that is scalable and easily integrated. According to Juviler, “when a client requests a resource using a REST API, the server transfers back the current state of the resource in a standardized representation.” REST APIs are a popular solution for many web apps. They are able to handle a wide variety of requests and data, easy to scale, and simple to build as they utilize web technologies that already exist.

REST guidelines offer APIs increased functionality. Juviler states that in order for an API to properly take advantage of REST’s functionality, it must abide by a set of rules: client-server separation, uniform interface, stateless, layered system, cacheable, and code on demand. Client-server separation addresses the way a client communicates with a server. A client sends the server a request, and the server sends that client a response. Communication cannot happen in the other direction; a server cannot send a request nor can a client send a response. Uniform interface addresses the formatting of requests and responses. This standardized the formatting and makes it easier for servers and softwares to talk to each other. Stateless requires calls made with a REST API to be stateless. Each request to the server is dealt with completely independent of other requests. This eases the use of the server’s memory. Layered system states that, regardless of the possible existence of intermediate servers, messages between the client and main server should have the same format and method of processing. Cacheable requires that a server’s response to a client include information about if and for how long the response can be cached. Code on demand is an optional rule. It allows a server to send code as part of a response so that the client can run it.

I picked this source because I thought the information was valuable. Again, I have very limited experience with APIs, even less with REST APIs, and I struggled somewhat to understand them. Jamie Juliver provides a very thorough yet easily understood overview of REST APIs. I was not aware that what sets a REST API apart from a regular API was its adherence to a set of rules. This article helped me better understand REST APIs, and I am eager to put this knowledge to use in future coursework and projects.

From the blog CS@Worcester – Ciampa's Computer Science Blog by robiciampa and used with permission of the author. All other rights reserved by the author.

YAGNI

This is a topic that I have been wanting for a while to write about but never really got around to doing so until now. For this week, I am going to review a post made by Martin Fowler. In the first part of the blog post, Mr. Fowler explains what the acronym stands for and where the term comes from. Mr. Fowler than walks the reader through an example of when we could apply YAGNI. In the blog post, the example that he uses is a company having two teams work on two different components of a program (one for sales and the other one for pricing). The pricing team then predicts that in six months’ time, they will need to create software that handles pricing for piracy risks and Mr. Fowler argues that this violates the principle of YAGNI. He argues that because the team is making assumptions based on something that has not happened yet, the feature the team builds might be wrong or worse not needed or used at all. In which case, this will mean that the team wasted a lot of time, energy, and effort analyzing programming and testing something that may or may be useless. In the amount of time the team spent developing the precaution for piracy, they could have used that time working on a different required feature of the program. Furthermore, the feature they build could handle the problem incorrectly which means they might have to refactor this feature later down the line. It also adds an extra layer of complexity to the program and adds more items for the team to repair and maintain. In addition, Mr. Fowler argues this is a bad habit for people to get into. The habit of making precautions in advance because it is impossible to predict all possible outcomes and as he put it even if we tried, we would still end up getting “blindsided”.

I wanted to write about this topic now because when I was doing the intermediate assignment for Homework 4, I was thinking about how my approach was violating the single-responsibility principle because one of the methods was doing three different things. When realizing this, I started thinking about my other bad programming habits. One of which was I tended to think ahead and code things that I think the program would need and how it violates YAGNI. So, I decided to read and review a post on YAGNI because I wanted to learn more about why you shouldn’t code things in advance so that the next time that I code, I can avoid those mental pitfalls. I think reading about this blog post would help me a lot because sometimes I have a hard time making these realizations on my own unless someone brings it to my attention in discussion.

https://martinfowler.com/bliki/Yagni.html

From the blog CS@Worcester – Just a Guy Passing By by Eric Nguyen and used with permission of the author. All other rights reserved by the author.

How to Design a REST API

When designing an API it is extremely important to get it right the first time. API calls are the backbone of you application, and without well designed endpoints your frontend will not be able to communicate with your backend effectively, if at all. If you do not design your API with forward thinking in mind, you may end up redesigning many of your endpoints and a good portion of your application as well. The good news is that API design is usually left to experienced developers; the bad news is that experienced developers still mess up from time to time.

Since designing a good API is so important, there are many standard practices which will help you with your design process. “REST API Best Practices – REST Endpoint Design Examples” is an article written by Kolade Chris which outlines nine best practices that you should keep in mind whenever you are designing an API.

To begin with the simple practices, it is important to use JSON format for sending and receiving data. Firstly this is a good practice because it is industry standard, but more importantly it is designed to be used with many of the most common frontend languages, such as JavaScript, PHP, and Python.

Practices two and three are similar since they both relate to naming convention; use nouns instead of verbs as endpoints, and name your collections plural. The reason you should use nouns as endpoints is because the verb part is contained in your HTTP request such as POST or GET, so you can do GET /items. The reason you should use plural collection names is to indicate that it is in fact a collection and not a single item.

The fourth practices Chris mentions is to follow industry standard status codes. This is very important, but also not difficult to do; simply look up standard status codes and follow those.

Practices five and six are also similar to each other; they both relate to narrowing your search. When designing an API, you should use nesting to indicate how things relate to each other, and you should also use filtering, sorting, and pagination to narrow down a request which returns multiple values. For example, if you wanted to find a specific blog post by title you could design your endpoint like this: https://blog-website.com/users/userId/posts?title=query. This indicates that the post exists within the user endpoint, and also queries based on title.

An easy but important practice is to use SSL with your endpoints. When using SSL you will have https// instead of http//. The increased security is definitely worth the expense you might need to pay.

The final two practices are the most important: use semantic versioning and provide adequate documentation. It is important to use versioning when designing an API so that users are not forced to use the most updated version, and it is important to provide documentation so that users know how to actually use the API.

Following these practices does not guarantee that your API will be designed well, but it does ensure that you won’t have basic problems with it.

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

Web Development/Front end vs Back end

What is a Web Development?

Web development, at its most basic, is developing a website for the internet. Web development generally refers to the more non-design aspect of a website, which includes using programming, markup, and scripting languages to create features and functionality. Developers focus on the technical part of building a website, such as constructing the layout, programming, and integrating applications and graphics.

What types of Web Development are there?

The front end, back end, and full stack web development are three separate career paths that can sometimes feel muddied in the technology space. Front end developers help build what users interact with and see, back end developers are focused on data, modeling, and the back end of a website. A full stack developer does some or all of the above.

What is a Front End Developer?

Front end development is the part of web development that codes and creates front-end elements of a website, which are features that are directly viewable and accessible by the end-user or client. A front end developer is responsible for everything we see and works to enhance the user experience to ensure it is seamless.

What are some skills required for Front End Developers?

  • A good gasp of front end programming languages
  • The ability to create a responsive design
  • A knowledge of testing and debugging
  • An understanding of front end developmemt tools and features like automation, content management systems, version control systems, and frameworks.

What is a Back End Developer?

Back end development is aptly named for web development that occurs at the back end of programs. Back end developers write codes to help a database and application communicate. Essentially, a back end developer handles what we don’t see; they are in charge of the back end of a website, which includes servers, databases, and applications.

What are some skills required for Back End Developers?

  • Database management
  • Framework utilization
  • Programming
  • Knowledge of accessibility and security compliance

Differences between front end and back end.

Front end and back-end development are quite different from each other, but still, they are two aspects of the same situation. The front end is what users see and interact with and the back end is how everything works. The visual aspects of the website that can be seen and experienced by users are the front end. On the other hand, everything that happens in the background can be attributed to the back end.

Languages used for the front end are HTML, CSS, JavaScript while those used for the back end include Java, Ruby, Python, .Net.

I chose this topic because learning about front end and back end development is really important. As a computer science major with a double concentration in software development and data analytics, this is important information I need to know in order to become a good programmer.

Front End vs Back End Development: What Is the Difference? (switchup.org)

Frontend vs Backend – GeeksforGeeks

From the blog CS@Worcester – Gracia's Blog (Computer Science Major) by gkitenge and used with permission of the author. All other rights reserved by the author.

NoSQL

During this semester we have started to use MongoDB. While I did get some general explanations of MongoDB in class, I felt like I needed to get a better grasping of how MongoDB works as a database and how I can better use it. Since MongoDB is a NoSQL styled database and my general understanding of databases comes only from using relational databases, I felt like an article helping to summarize and clarify NoSQL would be advantageous.

https://dev.to/lmolivera/everything-you-need-to-know-about-nosql-databases-3o3h

This article goes into great detail not only the advantages or features of NoSQL but the terminology used alongside with it. It has descriptions of multiple types, how they differ and what they are used for and including some helpful guides around designing these different types of databases.

More specifically my focus is on the type of NoSQL database that MongoDB is which is a document based database.

As the article describes, a document type database stores it’s data inside of a “document” that could contain varied types of data. Even to the point of storing documents nested inside of other documents. Which highlights the advantage of this type of database which is scalability. Being able to store nearly anything inside the database and not needing to force it’s formatting is a great feature. I’m trying to think of a scenario needed for nesting your entire database inside as an object containing your entire database. I don’t seem to be able to think of one in specific, but the concept is interesting to me and maybe it’ll be useful later.

This article also briefly goes into describing how JSON formatted NoSQL databases are structured. This was good to see as this is exactly what I have been using in class as well as in the most recent homework assignment.

It also gave a link to a list of databases who have used Document based NoSQL databases and was interested to see eBay listed their and specifically using the same database MongoDB as we are using in class.

https://www.edureka.co/blog/real-world-use-cases-of-mongodb/

Near the end of the article it begins to describe the CAP Theorem. The theorem as I learned from this article to be a general issue around picking which attribute we focus on for the service. Is it frequently consistent with reads/writes? Does every request have the most recent changes? Does it still perform it’s functions when some of the machines are currently not connected? This concept details that you must pick only two and generally partition tolerance is chosen first as one of the two. The reasoning being that as a service being able to provide it regardless of a particular aspect of the database going down you still want to be able to provide a service.

Overall this article gave me some good general insight on what a NoSQL database specifically is and how it is generally used and will help me in class when referring to the database we have been using MongoDB.

From the blog CS@Worcester – A Boolean Not An Or by Julion DeVincentis and used with permission of the author. All other rights reserved by the author.

Coding Interviews

https://levelup.gitconnected.com/the-ultimate-guide-to-coding-interviews-b11fc1efc9b2

This week I chose to write about coding interviews. The reason that I chose this topic is that the coding interview is an essential part of a software developers career. A student can finish a Computer Science program, go to a bootcamp, or finish an open source program. But if they can’t pass a coding interview they will not be able to get a job as a Software Engineer.

The article that I chose summarizes the types of questions and topics that comapanies test candidates on. And includes some resources to help candidates perform well in their interviews. Before a candidate can prepare for the specifics of an interview they have to be somewhat proficient in a high level programming language such as Java, C++, or Python. Most interviews focus on Data Structures and Algorithms. So Computer science students have a good head start on that. The article recommends GeeksForGeeks to learn more about Data Structures and Algorithms, or as a refresher for candidates that are already familiar with Data Structues and Algorithms. I personally use GeeksForGeeks pretty much every time I am coding and learning a new concept, or need a refresher. The articled also recommends the LeetCode top interview questions collection. I am personally working my way through this course now. The next step is to choose some companies, and solve problems that other interviewees were asked. The final step is to start applying and interviewing for Software Engineer roles.

I enjoyed this article, and I think it is helpful for new Engineers like myself looking for their first job. Personally, I have mixed feelings about the coding interview process. I originally thought that a CS degree with a decent GPA and some internship experience would be enough to land an entry level Software job, but that simply is not the case. Those qualifications can land a candidate an interview, but from there the candidate needs to code their way into an offer. One common complaint about the interview process is that the types of questions and Data Structures that come up in interviews are almost never used in the industry. On the other hand, companies need a way to determine if candidates actually know how to code. If a candidate cannot complete a simple Fizzbuzz question, they probably won’t be a strong contributer. Algorithm efficiency is also an important part of the interview process, and writing efficient code is extremely important in the industry. Regradless of my opinion, mastering the coding interview is part of being a Software Engineer. And preparing for interviews has made me a stronger programmer, and problem solver.

From the blog CS@Worcester – Jim Spisto by jspisto and used with permission of the author. All other rights reserved by the author.