Howdy!!! 🙋♀️ For today’s post, we’ll be learning about some tips that are extremely important to keep in mind for developing an application.
1⃣. Indentation above all 📝
A good indentation can make the difference between whether our code is readable or not. Let’s look at the example of both scenarios presented and think … which one can we understand faster? … 🤔 In the second scenario, we can see how a simple thing as indents, can improve the readability of our code.
2⃣. Don’t accumulate commented code, if you no longer use it delete it 🤷♀️
Please keep your code clean. Version Control Systems hold the history of the code, so If you wrote and code and then for some reason you are no longer going to use it, it’s good practice that you delete it, not stacking unused and/or commented code blocks.
Let’s imagine the example of the image above, it started by implementing the Grid with the old structure, but then the optimized Grid structure was implemented!! 🤩 For this reason, the code block of the previous Grid was commented on by the new one !! …🤔 But in the first scenario, the implementation of the previously commented structure is left. To keep our code clean we must delete that commented code, in this case, another solution was implemented with the same results, therefore there is no reason to have those lines of code that we will no longer use.
3⃣. Use intuitive names for xmlns namespace prefix
Naming is an important aspect of writing cleaner code, it’s important that developers that read your code understand what does it do, so, when adding a namespace it’s important to use an intuitive name for it, so that throughout our code we fully understand why we are using it.
4⃣. Naming of Pages and ViewModels
In both when creating a Page or a ViewModel, make sure of the following points:
➖ The name must be intuitive and consistent with the functionality / Design.
➖ Additionally, at the end of this name, add the word “Page” or “ViewModel” respectively. For example: TalentPage or TalentsViewModel.
Thanks for reading !!