If there is one rule that gets broken more than most it has to be the 'do one thing', been there and guilty of that. Then when you suffer at the hands of you're own code, you suddenly realize why it's a thing.
SOLID principles is great for writing testing friendly code..!!
Glad you liked it.
I will post the next chapter soon.
Good job! For me, the code legibility is the principal skill to great developers.
Glad you liked it. Yep, that is the most valuable skill for sure.
Tabs or spaces? :)
Sometimes depends on the language being used, sometimes depends on the person. I can't say that there is a Real/Definitive answer but my preference is spaces.
I always map my tab key to spaces. Why? I use python mostly and tabs may vary depending on the system, this could lead to an enormous amount of issues, a space is just one column. Of course, you need to learn how to navigate through the code independently of the selected method to avoid using right/left arrows.
Python == Spaces and so on.
If you share code with other developers, you must agree on a standard no matter your choice.
If you want to use tabs and you are comfortable with it, it's just ok. But, I'm an astronaut(space person ;) )
Does it matter :)
Tabs of course
Very good advices, I have seen implementing this guideline helped me solve like most of my mutations in my code, so really useful and worth the time spent!
Glad to hear that.
I always forgot about the "one thing" in every projects thanks for those tips!
Do you separate scope of function definition somehow, e.g. defining sub-functions in the main function closure or moving them into separate module?
Pythons catch is except btw :)
this depends on what framework, structure, etc, you are using. If I need to implement a concept with multiples features and it is quite complex, I create a module for him.
Being verbose is hard when you know that doing so is not the fastest way to code. Knowing in advance that you'll take twice as long is a really good way to never get started at all.
Hi, thx for your comment.
I disagree with you, this only should applies in programming contests where you have 3 hours to solve puzzles.
In my case and experience, beign verbose never going to take twice the time. In fact, you’ll need to review the code again, so, do you prefer spending time trying to understand your code because you used variables as: i, j, k, a, ? And if you are working with a team, imagine how painful could be. Of course this is not just easy, it requires practice but this is part of having good practices. Who doesn’t want to improve ?
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.