Interesting to see your opinion on how commenting shouldn't be mandatory. I specifically go the extra mile to ensure my code is readable for everyone, by naming my variables and functions to be as self-explanatory as possible and breaking down long expressions to store chunks in variables. This is why I was feeling confused as to what more I could add to explain my code better, though I must admit there are still considerable complex portions in some of my projects that would appreciate similar simplification.
jonathanvmv8f
I believe you confused the 'how' of commenting the 'why' with 'why' of commenting the 'why', if that makes sense.
I am already aware of and totally agree with the need to document your code in this fashion for the convenience of others and self. What I am troubled about is its implementation in real life. How does one write comment that explains the 'why' of the code? How would I know if I haven't accidentally written something that explains the 'what' instead or anything that is simply redundant? It seems like this portion is left out 'as an exercise for the reader'.
Asking as a newbie programmer: how do you suggest we write comments that explain the 'why' part of the code? I understand writing comments explaining the 'what' part makes them redundant, but I feel like writing it the former way isn't adding much help either. I mean, if I created code for a clock, is writing "It helps tell what time it is" better than writing "It is a clock" ?
It would really help if someone could give a code snippet that clearly demonstrates how commenting the 'correct' way is clearly better than the way we are used to.
Thank you so much! I checked that he starred in the show 'Severance' which I just watched recently, which is why I could recognise his face.
Who's the guy in the second panel? I swear I've seen this guy somewhere recently and it's been seriously bugging me
I am seeing this comment right after I finished 'Life is Strange'...
Tap for spoiler
I think I will stay away from time travel for now
I need more blog posts like these...
Is it good to be engaged enough to be recognised in Lemmy? I don't know if the big players around here are just spending their entire day on Lemmy as many people on Redditors do. There is a small part of me that too wishes to be recognized as an active member in this community but I don't want it at the expense of my real life.
Yeah, I didn't consider this reason, but it is plausible.
TIL they show ads for guns. What exactly do they advertise?
I was just referring to my original question i.e. how I should write comments in my code to explain its working if I have already done so in the code itself