30+ years of tech, retired from an identity intelligence company, now part-time with an insurance broker.
Dev community mod - mostly light gardening & weeding out spam :)
There is a similar but possibly more helpful approach (that I am unable to find my original reference for sadly - too long ago!) whereby you assume dependent objects have the methods you need to write a complete piece of logic, so you concentrate on the one thing, then go back and fill out the dependencies later (the compiler will nicely tell you what's missing!) - avoiding getting lost in the wormhole of implementation detail. I use this a lot :)
Yeah I guess that's a very valid argument. But I don't think my approach really repeats what the code does, it summarizes what a code Block is supposed to do, so if we look at the example from my post and I decide I want to change how the name of the file is determined. Now I can tell, just by looking at the comments, that that will have to be in the first code block.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This is also known as the pseudocode approach, which has good and bad points, as @danrot90 brought up here: dev.to/danrot90/code-comments-are-... =)
There is a similar but possibly more helpful approach (that I am unable to find my original reference for sadly - too long ago!) whereby you assume dependent objects have the methods you need to write a complete piece of logic, so you concentrate on the one thing, then go back and fill out the dependencies later (the compiler will nicely tell you what's missing!) - avoiding getting lost in the wormhole of implementation detail. I use this a lot :)
Yeah I guess that's a very valid argument. But I don't think my approach really repeats what the code does, it summarizes what a code Block is supposed to do, so if we look at the example from my post and I decide I want to change how the name of the file is determined. Now I can tell, just by looking at the comments, that that will have to be in the first code block.