In general I try to make my code readable and clean in the sense that it follows a consistent pattern that others can follow and replicate. (edit) patterns like SOLID can help accomplish that goal. Great tips, always stay learning! :)
I graduated in 1990 in Electrical Engineering and since then I have been in university, doing research in the field of DSP. To me programming is more a tool than a job.
For example, instead of 12, use numberOfMonthsInAYear. This way, everyone knows what that number means!
Moreover, it will be easier to change when the number of months will change. (Who knows? Maybe a new French Revolution will introduce 13 28-day months) 😉 (Sorry, I couldn't resist)
I have a master's degree in Computer Science from the University of the West Indies. I am from Trinidad and Tobago and I am a java full stack developer
@hectorw_tt No refactoring does not violate the open-closed principle of the SOLID. The OCP says software should be "open for extension but closed for modification." When you refactor, you're not adding new features or changing the code's behaviour. Instead, you're just improving the existing code to make it cleaner or more efficient without altering how it works. So, refactoring is still "closed for modification" because it doesn't change the functionality, it just makes the code better.
Personally the hardest tip for me to maintain is keeping functions small and DRY principles especially when your code interacts with external objects like an API or a network
Hello World!
My Name is Daniel and I'm 20 years old.
I'm an aspiring ML Software Engineer ready to discover the unknown possibilities of this technology 🤖
In general I try to make my code readable and clean in the sense that it follows a consistent pattern that others can follow and replicate. (edit) patterns like SOLID can help accomplish that goal. Great tips, always stay learning! :)
Best wishes keep maintaining best practices
Thank you! :)
Moreover, it will be easier to change when the number of months will change. (Who knows? Maybe a new French Revolution will introduce 13 28-day months) 😉 (Sorry, I couldn't resist)
Good article!!!! I have a question though.Does refactoring violate the open-closed principle of the SOLID principles?
@hectorw_tt No refactoring does not violate the open-closed principle of the SOLID. The OCP says software should be "open for extension but closed for modification." When you refactor, you're not adding new features or changing the code's behaviour. Instead, you're just improving the existing code to make it cleaner or more efficient without altering how it works. So, refactoring is still "closed for modification" because it doesn't change the functionality, it just makes the code better.
Personally the hardest tip for me to maintain is keeping functions small and DRY principles especially when your code interacts with external objects like an API or a network
Those are great tips. I'm doing this most of the time I work on projects.
@andrewbaisden that's great. I'm open to work and collaboration feel free to knock me.
I love this article. Thanks for sharing.
Thanks
Every point is to the point!
Thanks