When writing programs in Basic (I'm teaching it to my son), I find I want to put a lot more comments in the code. The comments are roughly English translations of the program I'd write in a powerful language, and my source code is roughly the resulting object code.
-
-
Sorry Paul - can you explain this a bit to me? I comment code mostly to explain to other devs what I'm doing, or to write an outline of what I am about to do to guide myself and help myself QA parts of the code quickly.
-
I'm trying to understand your point b/c I kind of am not sure what you mean and I kind of feel like I probably should.
- Show replies
New conversation -
-
-
Example?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
That's such a good point. In a perfect language, comments would be redundant.
Bookmarked. -
I think you will probably still want to document sometimes 'why' a certain piece of code is there. This usually goes beyond clean code and powerful languages. The book 'Clean Code' from
@unclebobmartin has a great chapter on this. - Show replies
New conversation -
-
-
Once read a program with instruction "set a=1" with comment "sets a = 1" its the why not the what is the need
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Some level of dilution happens when we express any ideas in a written language too. That is the reason we often need so many words to explain simple things. I doubt, programming languages that are much more constrained will ever be fully expressive.
-
For me commenting is about building clarity of what I am doing. I often look at comments at 2 levels - story outline of what this program/module is doing and 2 the technical details where the code statements are not self explanatory.
End of conversation
New conversation -
-
-
insightful! Imagining if we added comments to our speech so we knew what it meant... in what language would we comment? Why wouldn’t we be using THAT language in the first place?
#HackersAndPainters -
We do that in PowerPoint- speakers notes are comments!
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.