Blog Post #1

Hi, my name is Jiehui Huang. I am taking the senior capstone class this term, and it is my second term. As we look back to our coding, it might be different than the coding that we are doing today. Because we learn the new algorithms on calculations, which it improves the quality of coding. When we make the code to be more appropriate for other people to read, it helps them to understand the logic of algorithms better, especially the comments on coding. I read two articles about the clean code and refactoring, and it helps me to have better understandings about how to structure the coding style.

According to the article of clean code, it states “I know of one company that, in the late 80s, wrote a killer app. It was very popular, and lots of professionals bought and used it. But then the release cycles began to stretch. Bugs were not
repaired from one release to the next. Load times grew and crashes increased. I remember the day I shut the product down in frustration and never used it again. The company went out of business a short time after that.” The management of the code quality is important to the software development, and it helps you to develop the function easier in the future. If we do not have appropriate management for the code quality, it will be more work to do if we have more data in the future. The role of automatic process is important to software, and we do not want people to enter the data manually if we have more data over time. It would be great if we can have automatic process that can handle the data into the database.

Here is an example of clean code:

Bad:

if (student.classes.length < 7) {
   // Do something
}

Good:

if (student.classes.length < MAX_CLASSES_PER_STUDENT) {
    // Do something
}

We can see the differences between two codes, and it sets the comparison between the value and conditional variables. The conditional variables can be easy to change, but the value has to be edit each time if we have more data.

One thing that I would like to start doing is to set the variables more clearly instead of just given the value for the comparison statements, and we should consider the future use when we write the code. Because it will be less work for management if we have more data over time. One thing that I want to avoid doing is write the simple variables name, and we should think about the variables name when we set the variables. It can helps the developer to understand why the variable exist, and what it uses for. It helps developers to understand the coding easier in software development.

References:

1.Erinç, Yiğit Kemal. “Clean Code Explained – a Practical Introduction to Clean Coding for Beginners.” FreeCodeCamp.org, FreeCodeCamp.org, 19 Oct. 2020, https://www.freecodecamp.org/news/clean-coding-for-beginners/.

2.Martin, Robert C. Clean Code: A Handbook of Agile Software Craftsmanship. 1st edition, Pearson, 2008.

 

Print Friendly, PDF & Email

Posted

in

by

Tags:

Comments

One response to “Blog Post #1”

  1. OSU Avatar

    Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Leave a Reply

Your email address will not be published. Required fields are marked *