Category Archives: CS-348

The Principles of Writing Clean Code

In the realm of software development, the challenge of deciphering convoluted and tangled code, often referred to as “spaghetti code,” has persisted. This final blog explores the significance of writing clean code—a practice that not only caters to machines but, crucially, facilitates human collaboration, ensuring project success.

I selected this resource since it delves into the importance of clean code in software development. i feel as though it emphasizes readability, consistency, and meaningful naming conventions, addressing the challenges posed by complex and unclear code structures. The text advocates for clean coding practices that enhance collaboration and ease of understanding among developers.

i picked this since it stood out due to its comprehensive coverage of clean coding principles, ranging from intuitive code structure to the strategic use of comments and robust error handling. Its relevance lies in providing practical insights into writing code that is not just functional but also maintainable and adaptable, aligning with the collaborative nature of software development.

The content underscores the pivotal role of developers in the software industry and how clean code is indispensable for creating software with easy usability. Consistency, meaningful names, simplicity, strategic comments, and robust error handling are identified as key components of clean programming. The emphasis on collaborative practices, such as code reviews and refactoring, highlights the continuous learning and improvement inherent in writing clean code.

The use of AI in code reviews and automated testing aligns with current technological trends, enhancing the efficiency of maintaining clean codebases. The resource effectively communicates that writing clean code is not just a good practice but a fundamental aspect of sustainable software development.

This material reinforces the profound impact of clean coding on the collaborative and productive aspects of software development. It has heightened my awareness of the long-term benefits of investing time and effort in writing clean code. I understand that clean code is not just about pleasing aesthetics; it’s a strategic approach that ensures maintainability, efficiency, and scalability throughout the software development lifecycle.

https://reflectoring.io/clean-code/

From the blog CS@Worcester – CSTips by Jamaal Gedeon and used with permission of the author. All other rights reserved by the author.

Code Documentation

One of the most important aspects of code is to make sure that others who work on or are reading your code can understand what is happening. In class, we have been discussing clean code and improving readability which is where the correlation comes into play which is what inspired me to read further onto the fine details of what entails good code documentation. The blog post I chose for this week’s post was “Shaping better software: The benefits of effective code documentation” by Anabelle Zaluski. The goal of the post was to discuss the importance of having good code documentation and what qualifies as good code documentation.

The blog post starts off with explaining why code documentation is very important as it is like a map for your code. Good code documentation is what allows people to navigate your code effectively and efficiently. According to Zaluski the main information that should be included to qualify as effective code documentation is: “Dos and Don’ts, Clear explanations of each aspect of the application, Illustrative images, including sequence and entity relationship diagrams, and API documentation explaining each class, method, and return value”. She then explained the different types of code documentation as internal, external, low-level, walk through and high-level. With the end of the post explaining the benefits and challenges of implementing good code documentation into your team’s work routine. Some of the benefits included improving team collaboration, supporting maintenance and bug fixing, as well as increasing organizational growth. However, some of the challenges mentioned were staying up to date, managing documentation of non-linear code, and knowing how to document things for various knowledge levels.

I chose this blog post since we have been discussing what clean code is and why we should be using it in our own work. Due to that I thought this blog post was perfect to allow me to connect other ways I should be working to improve the quality of my work. To me this blog post was a very useful lesson reinforcing key points about documentation as well as teaching me aspects that I was unaware of. As we are learning more and more about how to structure our code to improve the quality as well as the efficiency of our team based code. From this blog, I feel like I will be able to implement the strategies and qualities mentioned for good code documentation to improve how I document my work in the future.

https://www.notion.so/blog/code-documentation

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.

Writing Clean Code

Overview

It is very important for every software developer to be able to write clean, understandable, and maintainable code. Writing clean code will not only be confusing to the user, but it can also confuse the author who is still in the process of writing the code. In my opinion, organization and neatness is the foundation of reaching success in anything. The two main components that will decide if your code is clean are the naming of variables and how functions are written. An article I read by Yiğit Kemal Erinç explained this well.

Naming Variables

We give variables names because they are far easier to remember than its memory address, which is a mixture of numbers and letters. Names give you more information about the variable as well. Someone using your code would likely have a tough time understanding a variable just by the memory address.

The name of a variable should be meaningful. If you need to attach a comment next to the variable to explain its purpose, then you need to rename the variable. The name should already tell you the variable’s purpose and why it exists, and how it should be used. If a name requires a comment, it does not reveal its intent. 

When naming variables, it’s important to avoid disinformation. For example, a variable that has the suffix “-list”  should be a linked list. For a variable to have the “-list” suffix and not be a linked list would be disinformation and lead to confusion.

Writing Functions

There are plenty of tips for how to design clean, easy-to-follow functions. One very helpful tip is to keep the functions small. Functions should be nowhere near 20 lines long. The longer a function gets, the more likely it is to do multiple things and have side effects. From the article, the most important concept was to make sure that your functions only do one thing. If your function only does one thing, it is guaranteed that your function will be small. A good way to check if your function is doing multiple things is if you can create another function out of it. As for side effects, unintended consequences of your code. Side effects can involve changing passed parameters and global variables, which will leave your code tangled up.

Conclusion

Clean coding is not a skill that you learn overnight. Like anything else you want to be good at, it takes practice and repetition. When you write code, make a habit of the clean code principles, so it becomes second nature.

Source

https://www.freecodecamp.org/news/clean-coding-for-beginners/

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

What is an API, and why have they become so controversial?

In February of 2023, controversy struck when new Twitter owner Elon Musk announced that developers using the previously-free Twitter API would now be required to pay for its use. The cheapest package was announced to be $42,000 per month for access to 50 million tweets, which unsurprisingly has driven off an enormous amount of researchers and developers who can no longer afford to use the tool. In April of the same year, Reddit.com also announced that their API would no longer be free, charging $12,000 per 50 million requests. This decision too was met with intense criticism, as developers of multiple third-party apps were forced to shut down their services due to the cost.

Rather than trying to weigh in on this debate, let’s look at what an API is, why they are so essential for many of these third-party developers, and why they have quickly become unaffordable.

Firstly, an Application Programming Interface, or API, is an agreed-upon set of protocols that allow for the transfer of data between applications. It functions as an intermediary between systems, allowing for companies to open their application’s data to other pieces of software. This works by providing the framework for the external system to request specific data (known as a “call”), and receive the requested info (the “response”). Let’s look at Reddit for an example.

The Reddit API allows for third-party apps to request and receive data such as posts, comments, videos, etc. to be used on their own application. The app RedReader, for example, pulls information from Reddit and displays it in a way that is more accessibility-friendly than the normal site. To do this, the app must make calls for data to be sent from Reddit servers, which it uses to update its own app.

Here lies the debate regarding paid vs. free APIs; they provide the valuable ability to integrate proprietary software with external applications, the controversy surrounds how valuable this ability actually is. On one side, an API should ideally be profitable for the company designing it to offset the cost of development and to monetize the use of the company’s data. On the other hand, the trend of extremely high prices set by platforms such as Twitter and Reddit have kicked out many smaller development teams, especially those who use the data for non-commercial work. In an interview with Wired, Kenneth Joseph, an assistant professor at the University of Buffalo, explained that his work of analyzing how people use Twitter has effectively been ended by the eye-watering costs of use.

The correct answer to the question of how valuable an API is can often depend entirely on which side of the argument you’re on: company executives will state that the use of their data is something that cannot be provided for free, while developers and researches are adamant that such extreme pricing has made their use unaffordable. In the future, as the amount of available data continues to grow, this debate is surely to come around again.

Works Cited

Binder, Matt. “Twitter’s API Keeps Breaking, Even for Developers Paying $42,000.” Mashable, 29 June 2023, mashable.com/article/twitter-api-elon-musk-developer-issues-apps.

IBM. “What Is an Application Programming Interface (API) | IBM.” Www.ibm.com, 2023, http://www.ibm.com/topics/api.

Red Hat. “What Is an API?” Redhat, 2 June 2022, http://www.redhat.com/en/topics/api/what-are-application-programming-interfaces.

Roach, Jacob. “Why Everyone Is Freaking out about the Reddit API Right Now.” Digital Trends, 14 June 2023, http://www.digitaltrends.com/computing/reddit-api-changes-explained/.

Stokel-Walker, Chris. “Twitter’s $42,000-Per-Month API Prices out Nearly Everyone.” Wired, 10 Mar. 2023, http://www.wired.com/story/twitter-data-api-prices-out-nearly-everyone/.

From the blog Butler Software Construction, Design, and Architecture by Griffin Butler and used with permission of the author. All other rights reserved by the author.

Git for Web Designers: A Guide to Smoother Collaboration

In the dynamic world of web design, managing projects efficiently is a constant challenge, and collaboration between team members is key to a successful management of projects. Without a strong version control system, things can quickly get out of control, leading to lost files, overwrites, and the dreaded conflicts between front-end templates and back-end functionality. In this blog post, we analyze the insights presented in the article “Introduction to Git for Web Designers” explore the benefits of version control and take a deep dive into the world of Git, an open-source version control system that has become a staple for web developers and designers alike.

The Power of Version Control

Version control, also known as Revision Control or Source Control Management, is a game-changer for web designers working in collaborative environments. The basic concept involves a central repository for project files, allowing team members to check out, make changes, and commit them back to the repository. This systematic approach tracks changes, timestamps them, and provides a clear history of revisions. The advantages include preventing file overwrites, maintaining a common repository, facilitating simultaneous collaboration, and offering the ability to revert to previous versions if needed.

The Developers’ Current Struggle

Before diving into Git, many developers manage their files using a crude version control system. Picture a folder filled with various versions of PSDs and other large binary files, an approach that works for static designs but falls short when managing the source code for a dynamic website.

Git: Your Ultimate Version Control Companion

Among the various version control systems available, Git stands out as a powerful, distributed version control system originally created by Linus Torvalds for Linux kernel development. Unlike its predecessors, Git ensures that every user has a complete copy of the repository data stored locally. This distributed nature brings several advantages, including offline work capabilities, resilience against a single point of failure, and faster processes.

The Learning Curve

While Git has a slightly steeper learning curve compared to some alternatives, the benefits far outweigh the initial challenges. Installing Git may seem daunting at first, but there are many online resources and guides to assist users on different operating systems.

Getting Started with Git

Once Git is installed, transitioning an existing folder into a Git repository is a straightforward process. Through simple commands in the terminal or command prompt, users can initialize a directory, add files, and commit changes. Visual tools like Git GUI, GitX, and TextMate with a Git bundle provide user-friendly interfaces for those less inclined towards the command line.

A Peek into a Sample Git Workflow

A web designer’s daily interaction with Git involves checking for the latest changes, making edits, committing changes locally, and pushing them to the master repository. Tools like GitX and TextMate’s Git bundle offer efficient ways to organize commits and visualize changes.

Learn More and Level Up

For those eager to delve deeper into Git, a variety of resources are available. Git cheat sheets, tutorials, and online guides can help developers become proficient in this essential tool. Embracing version control is not just about file management, it represents a fundamental change leading to effective teamwork and project triumph.

Conclusion

In the fast-paced world of web design, mastering version control is an essential skill. Mastering version control with Git isn’t just about files – it’s about smooth teamwork and awesome projects. Git gives you the tools to collaborate without the chaos. So, dive in, make friends with Git, and enjoy a design journey with fewer headaches.

Reflecting on the blog:

In summary, the article “Introduction to Git for Web Designers” stands as a guide for design professionals maneuvering the detailed world of version control. With clear explanations, it unravels the seemingly complex realm of version control, emphasizing Git as a crucial tool for bringing organization and collaboration to the field of web design.

References

https://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/#more-7224

From the blog CS@Worcester – The Bits & Bytes Universe by skarkonan and used with permission of the author. All other rights reserved by the author.

Blog #2: Work Structuring

When our class was being introduced to GitLab, and how to post topics on an issue board there were a couple of terms present within the menus that we didn’t go over in class. These terms are story, epic, and initiative, all of which relate to each other. Conveniently all of these terms build off the formers’ progress, and can easily be slotted into a DevOps-esque working environment.

The first of these terms, a story, is what we are most familiar with as it’s another term for an item selected from the Sprint Backlog. A story is a unit of work that can be completed in a one to two-week span. These often come from user feedback, meaning that the product has seen some use outside of development, however stories can originate internally (just like items on a Sprint Backlog). Stories are supposed to be smaller so developers can take multiple during one sprint with the goal being a handful of stories contributing to an epic.

The next term, an epic, is composed of several stories and aims to explain something larger during the development cycle. For example, if you are developing an app that doesn’t have features such as colorblind compatibility, text zoom, and a narrator, then each of these additions could be a story (can be an epic itself depending on the workload). The epic here would be ‘Improving accessibility’.

The final term, an initiative, similar to the former is composed of the prior terms, in this case an initiative is formed of several epics. These run for a minimum of half a year and can continue well past one. These serve to highlight the direction in which the project is aiming to head towards. Continuing the example from the previous term, if we add epics such as ‘Marketing towards non-likely users’ and ‘sign-on bonuses’ it can fit into an initiative that may be ‘increasing user engagement’.

For the purpose of this class, stories are going to be what we encounter the most, with maybe an epic or two depending on the scale of a project. What I’m curious about is whether these terms can be applied to the capstone project course. That course specifically will focus on working on a much larger scale project, so keeping track of tasks via stories/epics/and initiatives could prove to be effective. A reason why I understand these terms not being taught within the course is due to scaling. We focus on learning agile development as it is much more flexible for both smaller and larger projects, meanwhile an epic-based development process may only see great benefits from working on a larger project.

-AG

Source:

https://www.atlassian.com/agile/project-management/epics-stories-themes

From the blog CS@Worcester – Computer Science Progression by ageorge4756 and used with permission of the author. All other rights reserved by the author.

Blog #1: DevOps Defined

While searching for a first topic to write about, the question in mind I wanted to answer was “What is the formal definition of the processes we have been following” and “How does it all relate to what we’ve learned”. This question was answered by the following article which introduced me to the term DevOps, which is abbreviated for Development and Operations.

The following article grants a brief definition of what DevOps is, but most importantly shows the core values that all tie this subject together. Most of these core values we went over in great detail within our class, such as Continuous Integration and Deployment, while others were completely new to me such as Infrastructure As Code (IaC). This simply put focuses on how we interact with Infrastructure and looking at areas in which it can increase efficiency through automation.

Beyond showing the core values, this article speaks on the best ways these are applied. Some of these topics are implied such as collaboration through Agile Development and Continuous Integration and Development, but there was one I did want more clarity on and that is automation. Fundamentally I understand that teams can use automation to increase efficiency, however it does seem counterintuitive in an environment that promotes teamwork. On one hand, you can increase efficiency by letting automation ‘do its thing’ with little supervision, but that may create future errors. These errors and subsequent corrections will reduce efficiency later in development. If you allocate one (or more people) to frequently supervise the automated process, then there’s less of a risk of something going wrong, but you lose the efficiency that one (or more) people could’ve provided. By arguing this I’m not stating that automation does not have a place within DevOps, but that it may be a dangerous inclusion if not accounted for correctly.

Overall I found this article useful in expanding my knowledge of what we’ve learned throughout the semester, the visual(s) provided showing each component of the DevOps processes did help too. One thing that I would suggest for future semesters is maybe looking into how automation can be integrated into DevOps and appending it to your current lectures/activities? I think the curriculum for CS-348 is very good as of now, but adding a unit about automation could maybe help answer some of the questions I asked and potentially could help future students be ready for what they may see in the workforce (beyond college). Lastly, the source in which I retrieved this information seems to be a post on LinkedIn by a company named Quality Matrix Group, so there seems to be plenty of credible information within the post.

(Bonus points for them being based locally in Westborough MA!)

-AG

Source:

From the blog CS@Worcester – Computer Science Progression by ageorge4756 and used with permission of the author. All other rights reserved by the author.

The Importance of Clean Code

Ever struggle to read another developer’s code? Code should be easy to follow along with, especially for a reader entirely new to the codebase. However, sometimes developers write “spaghetti code”, with random variables or methods mixed together in a non-understandable manner. 

Gary Espinosa of Reflectoring.io believes that clean code is the best code, and it’s super important for companies and coworkers. He lists suggestions such as variable names being descriptive, methods shortened, code broken up, etc. Let’s dive into what he suggests.

Espinosa discusses the huge importance of clean code, and how it can make or break a codebase. Not only is code the flesh and blood of a program, but it is also a form of communication between collaborating developers. It helps enable easy understanding of code and editability without errors. Companies who need to ensure their code is clean often spend time and resources just making it easy to comprehend.

Clean code should be readable; this involves grouping similar functions and classes together, similar variables, etc. The document should flow like an “engaging narrative from top to bottom” (Espinosa). If possible, one idea per line and one action per statement is key.

You should also be able to keep your code consistent. There must be a standard for writing code, variables, and methods. Examples of this would be using camelCase for all your variable and method names, using specific indentation rules, and more. A unifying language reduces differences.

One should strive for simplicity, but with descriptive language as well. Variables, methods, and classes should have meaningful names that describe the point of themselves easily. For example, you shouldn’t use a name like “x1” or “yY” as they don’t provide the reader any insight as to what they’re for.  

I selected this resource because it lines up with what we’re currently learning, and it is a key importance to being a software developer in the industry. If you want to have your pull requests approved, write clean, understandable code. This topic intrigued me because it’s quite simple but I wasn’t sure if there were any specific industry standards for clean code. There are definitely certain uniforms industry-wide, but I’m sure that it depends from company to company.

Espinosa’s article was informative, and explained what’s important and why about clean code. It’s useful to those new to programming, or those who are experienced in coding but just entering the professional industry.

I learned how important clean code actually is, not only to the programmer but to their coworkers and the company as a whole. Alongside this, the article taught me how to effectively organize and write code in a clean and understandable manner. This led to an increase in my confidence in my ability to clean up my code. I want to apply this knowledge to my future jobs and perhaps go back and clean up my old projects to make them easier to comprehend.

Article: https://reflectoring.io/clean-code/

From the blog CS@Worcester – Josh's Coding Journey by joshuafife and used with permission of the author. All other rights reserved by the author.

The Steep Curve of Game Development and its Tools

I’ve taken programming classes for over five years, however, just programming is not my end goal. My goal has been to get into the field of game development. 

Classes that tackle game development are rather rare and aren’t offered at most schools, so I haven’t had the opportunity to learn in a classroom environment. This means that my goal depends on my drive to learn game development in my own time. After looking into what makes a game, specifically the technical aspects of it, I found that I have much to learn. 

Development of a game can be divided into five general sections: the engine, programming, visuals, audio, and testing.

Engines are software platforms that provide “the core functionalities and features for developing and running games.” The most popular game engines today, such as Unreal Engine and Unity, are extremely versatile and allow the whole or most of the game development process to be done in that platform alone. 

Any game, at its core, is a bunch of code. And while you can develop games without programming knowledge, it becomes very difficult at the higher, more professional levels. Programming language is usually up to user preference, although some tools may require specific languages.

Visuals and audio are rather similar in the fact that both require great creativity and are crucial to games today. Any model, texture, sound effect, and music are created from scratch or borrowed from some library. Software for both categories are typically used by artists of all kinds; music producers, artists, graphic designers, and such.

Finally, testing is the “last” process of developing the game. This could be seen as the verification and maintenance steps of software development. Making sure that there are no bugs and that every other section is working properly is crucial to a better user experience.

That’s a lot of things to do in order to create a game. So many processes, so many programs and tools to learn, and so many skills I need to learn. Learning a tool is one thing, mastering one takes so much time and effort. It makes me think about how I want to tackle my goal, do I focus on one section of game development? Do I learn a decent bit of every section? I have no clue.

It feels like the path to achieve what I want becomes longer and longer. Procrastination, poor time management, and lack of dedication only worsen that. 

If you want to achieve things, you have to take the first steps towards them. I want to land a career in game development and in order to do so, I need to learn. In my free time, I will spend some of it learning online and tinker around with free game development tools until I feel confident in my ability. I could then develop my own game and take those next steps toward my goal.

https://www.linkedin.com/advice/0/which-technologies-tools-do-you-use-game-development#:~:text=Some%20of%20the%20testing%20tools,analytics%20to%20improve%20your%20game.

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

Week 12

This week we talked about development environments and what they are used for. A development environment is the space where developers can work, experiment, and test without worrying they’ll interfere with the experience of real users. One important environment commonly used in the developing world is Visual studio code. We looked at some of the extensions needed in VS code to run a program successfully. Visual studio code also has a dev container. Containerization has helped developers install particular operating systems and dependencies with particular version numbers with tools like docker. This has solved the problem of developers running different operating systems and having different versions of dependencies installed. Another development environment we looked at is Gitpod. It is a cloud development environment that lets you develop in pre-built development containers, running on their cloud infrastructure, and use a variety of IDEs in your browser. Therefore, you don’t need to install docker or any IDE, and your development doesn’t depend on your local machine’s resources.

Gitpod enables developers to immediately start coding, debugging, and testing their code. We also looked at command scrips mainly a build script and a lint script. Build scripts are used to create artifacts or packages for later development. They do this by getting code from a source code repository like git, then running tools like MSbuild or Gradle to compile and test the code. Build scripts are used for projects that are complicated to build because we don’t have to remember all the details in which to run multiple commands. A lint script is a tool that scans your code with the goal of finding issues that can lead to bugs or inconsistencies. For the blog I chose, it talks about what development environments are and how to get started with them. Development environments allows software developers to create, run, and test their application code in a way that’s adequately realistic and safe. It is important for development environments to offer isolation to developers. This means that they can do whatever they need in their environment without concern that they are breaking someone else’s work.

I chose this resource because it goes more into detail about development environments and why they are important to developers in the real world. These different environments help developers be able to do their work without interfering with the user experience. Developers also must keep the environments as close to each other as possible and containers are a great technology for enabling that.

References.https://www.plutora.com/blog/what-development-environment-how-get-started-now

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