You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, as a part of a software desing curse I was tasked with searching for repositories on github and give refactoring ideas to the owner/s of the project based on code smells. I read you code and the only smells that i could find were "Long Method" and "Primitive Obsession"
The importance of refactoring is that it can make the code have better organization and lower dificulty to upkeep it, for more info on refactoring, https://refactoring.guru has a lot of info on this topic.
Here are the examples of the souce code and the implementation of refactoring tecniques.
Primitive Obsession
Initial code
refactored code
Here "Replace Data Value with Object" was used to reduce the amount of primitive data in the Player class by combining some of the fiend in a class that can be used.
Long method
Initial code
refactored code
Here "Extract Method" was used to make the method shorter by taking some parts in the partition() method and moving them to a new method and in their place there would be a call to that method.
Your code is still good and it thaught me some things about game development so I´m gratefull that your team wrote it with proper documentation.
that´s all, thanks.
The text was updated successfully, but these errors were encountered:
@Jecanart Wow! This is a project I worked on in High School many years ago. I was still learning then just as I am still learning now. I completely agree with your assessment, those would be two great improvements. I have no idea how you stumbled upon this old repo but I'm glad you did. Good luck to you with your studies!
Hey, as a part of a software desing curse I was tasked with searching for repositories on github and give refactoring ideas to the owner/s of the project based on code smells. I read you code and the only smells that i could find were "Long Method" and "Primitive Obsession"
The importance of refactoring is that it can make the code have better organization and lower dificulty to upkeep it, for more info on refactoring, https://refactoring.guru has a lot of info on this topic.
Here are the examples of the souce code and the implementation of refactoring tecniques.
Primitive Obsession
Initial code
refactored code
Here "Replace Data Value with Object" was used to reduce the amount of primitive data in the Player class by combining some of the fiend in a class that can be used.
Long method
Initial code
refactored code
Here "Extract Method" was used to make the method shorter by taking some parts in the partition() method and moving them to a new method and in their place there would be a call to that method.
Your code is still good and it thaught me some things about game development so I´m gratefull that your team wrote it with proper documentation.
that´s all, thanks.
The text was updated successfully, but these errors were encountered: