Posts

Showing posts from 2020

Clean Code: Meaningful Names

Image
     Names are everything! Files, classes, functions, variables all need a name, therefore we should cate about good names. Good names save more time than they take. Coming up with good descriptive names that don't confuse the developer who has to read the code in the future may come with no effort to some, but for others it may feel like a constant struggle. Readable, and intuitive names are a foundation of clean code. Let's take a look at some key principles that will help you come up with good names in your code. Intention Revealing      The name of a variable, function or class must answer questions. Why does it exist? What it does? How is it used? A variable named instance or number is not descriptive enough and requires the user (developer) to figure out the context and the type of the variable in order to know what it does, a better approach would be changing the names to userAccount and balance respectively. Naming should be explicit and explain...

Clean Code: Introduction

Image
Two years ago I have switched from Java/Kotlin Android development to JavaScript Full Stack web development. Because of that I have a lot of new insights that I want to share with the reader. One of the biggest realizations I have had is no matter what platform or language or framework you are using, the fundamental Clean Code principles DO NO CHANGE.  These series is dedicated to [re]discovering the Clean Code principles. Strongly influenced by "Clean Code" by Robert C. Martin, I will be covering the most important principles to writing clean, readable and maintainable code. Good developers are modern craftsman. Knowing how to make your code do what you want it to do is easy. Making that code maintainable is the real challenge. As new abstract languages and frameworks are created, and as number of programmers doubles every 5 years, knowing how to write clean code is the most important challenge for any developer. Good code matters! Working mess is NOT better than nothing. It...