4 ms·
I do it because its inline. If someone is looking over the code and right above the recursion see's an example of what I am doing in my eyes makes it more read
by chrislomax 16y ago
I do it because its inline.
If someone is looking over the code and right above the recursion see's an example of what I am doing in my eyes makes it more readable.
Don't get me wrong, it's not something I do every day, I may have done it 3 or 4 times in my life but I have done it. I mainly do it for debugging purposes. If you are stepping through and you can see a string example of the output you can instantly compare it to your built string of JSON.
I am probably just being pedantic but I can see a use for commenting certain code. If i blog posted it and changed it then I would need to make an active effort to update the blog. It would be like maintaining documentation. I can just update the comment above and be on my way.
I think everyone has their own methods and I'm not saying yours is wrong, I am just saying I do see a need to put code in comments sometimes.
There are only two devs here though and we know what we are doing, if a noob came in then to be honest they wouldn't be touching my code until they understand it anyway
- random42 16y ago> I am just saying I do see a need to put code in comments sometimes. Yup, There are rules, and then, there are rules. The important thing is to realize what practice makes sense, for the given condition... and why.