Author Archives: debugducker

Computer Programming and My Future

Hello Debug Ducker here, and this one is going to be a lot less focus. As I near the end of my college fall semester, I come to realize that I am nearing completion of college, and will hopefully come out with a bachelors degree in Computer Science. With this in mind I did some reflecting about my choice in the field and how have my classes helped me.

For this semester, I did a CS course called Software Construction, Design and Architecture. To best describe it, its like applying the fundamentals of computer science, while understanding new techniques to build better software . I remember at the beginning we review some CS concepts such as Polymorphism, Abstraction Inheritance, and Encapsulation, and when studying it I was surprise to see I was still familiar with the subjects. Even funny that I recently applied for an internship with a company that had me do a test involving those subjects It made me feel more confident with my abilities. Also with the way the class was setup I was a lot more engage with the subjects.

I also learn some new things that involve CS such as UML class diagrams that basically meant to outline the program class structure. Here is an example that I did for class assignment

This was meant for some appointment application, I just did a diagram of it. I can see this being helpful in the field to help people understand what exactly going on with classes if they are new to a project.

I also learn about API work and I am not exactly clear on how it all works but I say I understood a little. I relearn the HTTP methods during that time, which I needed cause it has been a while since I had experience with them. Funny, that one of the HTTP method names is just GET, which just gets you information from a database. Anyway I hope to return trying API so I can get a better grasp on it.

That is a review on the class work but about my efforts. I say I did quite well despite some difficulties. Some unexpected hurdles came but I was able to jump over them to the other side and learn some new skill as a result. Though time waits for nobody and I may have missed some things but hopefully that could be mended.

Now that I am typing these I would like to use to blog for other purposes in the future but we’ll see. Have a nice a holiday and thank you for your time.

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

What is up with Error Codes for HTTP Methods

Photo by Vie Studio on Pexels.com

Hello Debug Ducker here, and I have a question. I am sure you are familiar with a 404 error code, as you may have run into it while surfing the web. 404 Not Found means that the server on the other end couldn’t find what it was looking for, and this is cause the URL is not recognized. This can happen when the webpage is no longer available and you tried connecting to it. 404 is quite the common error, that I believe many have seen at least once but would you be able to tell me what other errors you may have encountered in the web, there is quite a few and some obscures ones you may have never seen.

Perhaps you also wondered why 404 is even an error number, why the number is the way it is, why use those specific numbers. Well you see 4xx is specifically for client errors, which means they are errors on your end and not the server. If a server would to have an error than it would use 5xx instead. For example, there is the 500 error code that is an internal server error which just means something messed up in the server and sent you that as a response. Basically each response code are in different categories, with the error categories coming entirely from 4xx and 5xx.

Now here are ones you know and some obscure ones

400: Bad Request, as in the server could not process the request, either because of a syntax error such as misspelling something

402: Payment Required, says what is on the tin you need to pay, not often used

409: Conflict, the request conflicts with something within the server

414: The URI too long, the URI is long and the server is not willing to handle it

418: I’m a teapot…yeah I don’t understand this one, and yes this is real

There are many of these errors code for 4xx and I would recommend you check it out with the link below.

There are also some 500 server errors, that are interesting such as

501: Not Implemented, as in the request has not been implemented, so exactly what it says

503: Service is Unavailable, just means the server are down.

And Many More.

Thre are a fascinating amount of error codes for some interesting stuff and I reccomend you see a bunch in the link below.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status

Anyway have a nice error free day day.

MozDevNet. “HTTP Response Status Codes – HTTP: MDN.” MDN Web Docs, developer.mozilla.org/en-US/docs/Web/HTTP/Status.

“HTTP Status Codes: All 63 Explained – Including FAQ & Video.” Umbraco, umbraco.com/knowledge-base/http-status-codes/#http-status-code-categories.

From the blog CS@Worcester – Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Discovering Design patterns

Hello Debug Ducker here again and have you ever thought about how your code is structured? I mean you probably have been doing simple code etiquette, but have you ever thought about how you could make it less say more manageable and neater to save yourself the trouble

Here is an example of a code design on UML from a programming assignment

The basic gist of this is that we are making ducks and applying qualities to them. As you can see there are different types of duck especially my favorite the rubber duck. But I am sure you can see a problem with this. Despite them being all ducks, not all the attributes of a duck can apply to certain ones as shown with decoy duck and rubber duck. Their quack and fly methods would be different, So we have to override them to do something else. This can get tedious especially if we were to add more ducks. Also makes the abstract class feel pointless because of this. So this is where Design Patterns are implemented

Instead of overriding the fly and quack methods in the different types of ducks, we add functions that can apply the behaviors themselves without needing to modify methods within ducks. The Relevant design pattern here is known as Strategy Pattern, and that’s when we get into the real meat of things. 

Design Patterns as the name suggests are designs that programmers can utilize to fix certain problems in their code, whether it’s readability, managing the code, or streamlining a process. Strategy Pattern is the design pattern that splits the specifics of a class into other methods, such as the example of the fly and quack behaviors which were originally a part of several other ducks with different qualities. This helps us whenever we want to add a duck with a different behavior, one of the behavior methods could be applied. There are several other design patterns out there such as factory design which creates objects through what called a factory method, for example, if the rubber duck method is made then an object with rubber duck qualities will be made

Here is code of an example of what a factory method would look like

There are a lot more patterns to choose from that can help you with all your coding problems. Geeksforgeeks has a great article explaining them and even more of the patterns to show

https://www.geeksforgeeks.org/software-design-patterns/

Design patterns can be useful for many coding problems, whether It’s to restructure your code to make working on it easier or refactor it to make the functionality better. I can see myself using theses whenever I would encounter a problem.

“Software Design Patterns Tutorial.” GeeksforGeeks, GeeksforGeeks, 15 Oct. 2024, http://www.geeksforgeeks.org/software-design-patterns/.

Guru, Refactoring. “Strategy.” Refactoring.Guru, refactoring.guru/design-patterns/strategy.

From the blog CS@Worcester – Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Why Git

Why is it always git

Photo by RealToughCandy.com on Pexels.com

The version control system that every programmer uses. Even in my computer science class, we had lectures dedicated to Git, the commands in Git, how Git is used, what Git is used for, and just so much Git. The funny thing, is there are other version control systems such as Mercurial, but they aren’t ever brought up they are there but feel overshadowed by git. So the question I am asking now is why Git. So I did some investigating.

The question: what does Git do that is so special compared to other version control systems? Now version control systems can do all sorts of things such as allowing developers to see what has been changed, enable collaborative work, and branch and merge changes to a repo. If multiple can do this, then what does git do differently? An article from Geeks For Geeks lists several. Git can be worked on offline and is resilient because multiple developers can have copies of the repo, and any local repo can be used to restore a project. It also comes with conflict resolution that’s allows one to handle merge conflicts by providing tools to solve those problems. So what about the other systems. Well, GFG got that covered. Here are some comparisons.

Subversion

Compared to Git, the architecture is centralized, one single central repo

Fewer branching and merging options

Better performance

Mercurial

Smaller community compared to Git

Not as much flexibility as Git

Perforce

Can handle very large code base

Not as flexible as Git in terms of merging

Git is Open Source and Free, while Perforce isn’t

That is a decent amount of reasons to use Git over other VCS. I think the community part is important for such a popular system, because if you aren’t too familiar with the commands that come with Git, then you have a lot of people that can help. There are a lot of forums and articles about Git tools out there if you ever need it.

I also feel that the collaborative aspect of Git is, very helpful. A lot of projects have a lot of people working on them, so having something like Git that can handle it and make the task easier is great. Also, the fact that it is accessible helps with that too.

Git being so popular makes a lot of sense now, accessibility, community, and collaboration are what a lot of developers require, and I have to say Git provides that well.

GeeksforGeeks. (2024, September 19). Git vs. other version control systems: Why Git stands out? https://www.geeksforgeeks.org/git-vs-other-version-control-systems-why-git-stands-out/

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Assessing Clean Code Etiquette from the Master

Hello Debug Ducker here, and today this piece will be a bit different. I want to share my opinions and others about on a somewhat controversial figure in the coding community. Robert Cecil Martin also known as Uncle Bob is a well-known software engineer. He is known for many things such as the subject to today’s topic, “Clean Code” a book written by him that discusses and shares what clean code is. it offers advice on how to structure and write code for it to be “clean”.

From my experience from reading excerpts from the book and trying some of his advice on an old project of mine, I have found that it has made the code a lot more readable. However there is some advice that I don’t agree with. To paraphrase, Uncle Bob mentions that a function should avoid having more than one argument or have none at all. He saw that the more arguments, the less clear it is. I understand what he means but personality I feel this may not apply to all cases when writing code, especially if you need multiple arguments to achieve something, so the advice is situational. It made me curious to do a bit of research myself on what others may think of his advice, and I found an article that shares similar sentiments about the advice given by Uncle Bob.

The blog is from a username qntm, who is a novelist but also a programmer. The blog entry is called “It’s probably time to stop recommending Clean Code”, and as the name may suggest, is an opinionated piece on the book of the same name by Uncle Bob. The blog entry had critiques about the book, such as the advice from Uncle Bob that said functions should only be about 3–4 lines. The user qntm found this bizarre, and frankly, I did too as I find this very restrictive for making functions.

That is just one of the many examples from the blog entry, and I would advise you to check the blog yourself to read the full thing. I’ll provide a link below and perhaps search for his other entries as well. I wanted to show you this because the definition of clean code perhaps can’t be defined by one person. Though I have found some of Uncle Bob advice to be helpful, I don’t think all of it should be taken as gospel. Apply his teachings where it may help and perhaps consider finding other ideas of clean code elsewhere because Robert is just one man who wanted to share some advice, I am sure others have different ideas that may help you as well.

Here is the blog entry by qntm about the subject for those curious

It’s probably time to stop recommending Clean Code. Things Of Interest @ Things Of Interest. (2020, November 28). https://qntm.org/clean

Martin, R. C. (2016). Clean code Robert C. Martin. Addison-Wesley Professional.

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Software Licenses

Telling the Do’s and Don’t of your own code

Photo by RDNE Stock project on Pexels.com

Hello Debug Ducker here again, and it’s time to talk about legal stuff involving software. Now I am not a lawyer but I am a coder and this is related to that. It still may require some independent research on your behalf but what I have to say is still important. Copyright, love it or hate it is here to stay. Copyright is involved in a lot of things such as movies, products, and even software. Yes, software can have a copyright applied to it, how can this be the case? Well, it is rather simple, if you make the code, as in you wrote it , you are the sole copyright holder of that code. “So why does this matter”, which is what you are probably thinking. It matters because then copyright laws would apply meaning that their are restrictions on someone using your code. “Well, I don’t care, let them use it”. They can’t cause copyright won’t allow them to do so, and some don’t want to risk legal issues. So this is where licenses come in. 

License are a set of guidelines on how a person can use and redistribute the software and it is an essential tool for the field. Now licenses are something you can grab, and put in a section of your software and not something you make yourself.  You shouldn’t make your own license yourself, ever, as that can cause legal troubles. If you want your code to be free to use with almost no restrictions, there is a license for that, if you want a bit of restriction on what they can use it for there is also a license for that. You can pick what suits your needs and should be all set. I won’t go too in-depth about all the licenses cause there are quite a bit, but there are a few resources I can share that can help you find the right license for your work

https://choosealicense.com/

The site above can help guide you on the many different licenses that are out there and can give a gist of the guidelines in the licenses. It is helpful too for developers who just need a quick way to find the right license for what they want to achieve with their software. I can see myself using such a tool in the future. Hope you enjoy this talk about the use of licenses, I hope this was helpful. Thank you for your time.

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Scrum

Pushing the Ball Forward Together

Photo by Ollie Craig on Pexels.com

Hello Debug Ducker here and recently I studied a framework used by Software Developers referred to as Scrum. Scrum is a framework that is meant to help teams find adaptive solutions for complex tasks. In layman’s is, it is a way to get hard things done small pieces at a time.

If you are wondering if Scrum is an acronym, well no it is a reference to a scrum in rugby in which teams in rugby work together to move the ball forward, which relates to teams working together to move the product forward.

The idea of Scrum is based on empiricism which is a theory that knowledge comes from experience and lean thinking to which means to focus on the essentials. The Scrum framework consists of the Scrum Team which encompasses the Product Owner, Developer, and Scrum Master who have different accountabilities on a project.

There are also very important pillars to take into account when talking about sprint which are Transparency, Inspection, and Adaptation, which can’t work well without each other. Inspection and adaption work as there is a lot of ongoing feedback during the process.

I was interested in the topic as I have recently learned about it in my software processes class and wanted to share my thoughts on it. As my understanding of it goes, it is based on reducing complexity by having different roles and small teams to handle the task. It also has steps that should be followed that are in specific time boxes, time boxes being the maximum amount of time the step can go on. The Scrum involves a time length for the task, referred to as a Sprint, that goes on specifically for 1 month or less.

I can see myself using this framework in the future, as it helps make those complex tasks easier to handle, especially in group projects. If a task is too great, then perhaps Scrum should be used to make sure the task is not as bad and easier to handle for the groups’ sake. Even though Scrum in this instance refers to Software Development, I can see it being used in other possible fields that involve working together, but that’s just me. There is more to Scrum than just what is referred to here, there is a free guide online that I recommend any viewer interested in software development to check up known as the Scrum Guide that can guide you through it. The link to is down below.

The Scrum Guide

 That will be all from, have a nice day.

The 2020 scrum GUIDETM. Scrum Guide | Scrum Guides. (n.d.). https://scrumguides.org/scrum-guide.html#the-sprint

What is Scrum?. Scrum.org. (n.d.). https://www.scrum.org/resources/what-scrum-module

From the blog CS@Worcester – Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

What is Technical Debt

The Future you Problem

Photo by cottonbro studio on Pexels.com

Hello and welcome to a new week on this beautiful blog of mine. Today is a topic that is of interest to me and possibly everyone reading this. It could also be something you ran into during a coding project. It is called Technical debt, which is the concept of delaying or omitting work to complete a project but cause more work to do in the end. 

Let me give you an example that I have dealt with, and that you may have also dealt with. So you got a coding assignment to do right and that deadline is coming fast. So you set out to do it in the quickest and easiest way possible without a care for code layout or etiquette, it is just you working on it after all. The next day, you think to yourself that you may need to rework some facets of the code to make it run better or make it look neater. You then open up the project and look in horror at the mess you made and realize that it would take more time and effort to make it neater or run better than it would be to just continue on and get the project done. That is technical debt and yes it accrues interest.

The example was more personal and not that bad when you realize that the only price you paid is something you can’t stand to look at and also something that will take a long amount of time to fix. Like I said before it is just you working on it and as long as it works it’s fine…but what if you weren’t alone, say what if you were working in a team of 2 or 4 or perhaps a whole company amount. Then we have problems. Cause not only the debt is put upon others, but even money can be a problem if it is a company involved. 

There is also types of technical debt. Planned Technical Debt is meant to establish one presence in the market or gather feedback from customers, kinda like prototyping from my understanding. There is also Inadvertent Technical Debt when the developer is unsure of market requirements or aware of the architecture. 

Many things can cause technical debt to happen, such as poor management or the code not being reviewed well enough.  So to avoid such things it’s a good idea to 

  • Understand the Requirements
  • Understanding Decision Consequences
  • Supervising the Process

So be careful when coding a project as it may come to bite you in the future, so take into consideration the future you and help you out.

Be a Better Dev. (2020a, October 5). What is Technical Debt? (as a software developer). YouTube. https://youtu.be/2nDxKYIajoU?si=crpLGeoCewYZ_kEj

Eye on Tech. (2020b, October 7). What is Technical Debt and Why Does Tech Debt Matter?. YouTube. https://youtu.be/cdzUXv8SpjY?si=FHZ0Vl6ZVkhuSNeE

From the blog Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.

Introduction of Me

What is a debug duck?

SONY DSC

Hello and welcome to my blog. Refer to me as the debug ducker. The purpose of this blog is to detail my computer science journey and maybe some other stuff if possible. As of now, I am a going into senior year and ready to graduating so I’ll be documenting tons of stuff.

Now my name. It sounds silly right, but the name is based on a code debugging technique that is an coding industry practice.

The basics are that you’ll need a rubber duck or anything inanimate, and when you run into a code problem you need to debug try explaining what the code does to your duck, tell it what programs you’re running within the code, and the purpose of the code. The idea is that when you explain and go over the code with the duck, it’s supposed to help you catch what’s wrong as you explain it.

I used to do this back in high school and found it helpful. I remember my other peers doing the same thing, and they found it helpful as well. Though I haven’t used it as I progress my programming career, the technique stuck with me. Mostly because it sounds silly talking to a rubber duck but don’t knock it till you try it. So whenever you encounter a coding problem, talk to a rubber duck or any inanimate object about it and see if you can catch any errors.

From the blog CS@Worcester – Debug Duck by debugducker and used with permission of the author. All other rights reserved by the author.