stuff like that's ok for your home projects but have no place in professional projects.
If you ever programmed in languages like assembly or Miranda, you probably appreciate the value of documented code (clear variable/function names etc.) but the use of any programming style/convention depends on one thing: DISCIPLINE.
It takes a little discipline to teach yourself to document functions etc. especially when a function seems really obvious. My experience has taught me that in the long run you'll be doing yourself and others a favour. (sometimes small functions grow up to be monsters to bite you a year later when you need to apply some changes)
if you describe the purpose of a function, what it should be doing and you use variable names that reflect their use, and add some comments for the less than obvious parts, it'll actually be possible to work with the code even a year later without having to go over every line of code.
it can help but it tends to be a bit too restrictive.
What if you end up needing another type? You're forced to go over the code and change all occurances of the variable or leave it as is and end up with a variable name that doesn't reflect the type.
I have to agree here.
stuff like that's ok for your home projects but have no place in professional projects.
If you ever programmed in languages like assembly or Miranda, you probably appreciate the value of documented code (clear variable/function names etc.) but the use of any programming style/convention depends on one thing: DISCIPLINE.
It takes a little discipline to teach yourself to document functions etc. especially when a function seems really obvious. My experience has taught me that in the long run you'll be doing yourself and others a favour. (sometimes small functions grow up to be monsters to bite you a year later when you need to apply some changes)
if you describe the purpose of a function, what it should be doing and you use variable names that reflect their use, and add some comments for the less than obvious parts, it'll actually be possible to work with the code even a year later without having to go over every line of code.
Good code is readable.
it can help but it tends to be a bit too restrictive.
What if you end up needing another type? You're forced to go over the code and change all occurances of the variable or leave it as is and end up with a variable name that doesn't reflect the type.