0
If before every bit of coding a statement of intent and idiot proof explanation would it slow the program by the mass of data
by stating the intent of the coder wouldn't it help him to run the project and clarify his objectives and anybody else looking at the program would be in no doubt as to what they were looking at and how to interpret code I understand this would be more data in the program would it actually have a detrimental effect on the speed of the program? this could help standardise programming so any programmer could look at another program and quickly understand it
9 ответов
+ 5
in compilable languages such as c++ comments like whitespace are ignored by the compiler therefore do not add to the size of the executable.
+ 4
Programmers are notoriously lazy :) They 'should'. Best practise is to comment but not overly. I find when I code I often forget to comment
+ 4
On very large projects it would be compulsary. But again. Only obscure code which is not obvious to a professional programmer.
+ 3
meh.. its not selfish per se. I would stick with lazy. Most code is closed source which is only ever meant to be seen by the programmer/s. It is a bad practise I agree.
But commenting every bit of code is overkill and would add alot of time to a project. If it is a large open source program which has functions that are not self explanitory then yeah *that* is indeed selfish as someone else someday may have to deal with that.
+ 3
Here is a link to suggested best practises when coding. They are generally accepted rules adopted by the wider community. May help in your journey
https://code.tutsplus.com/tutorials/top-15-best-practices-for-writing-super-readable-code--net-8118
+ 1
don't you think that is very short-term thinking and quite selfish really I'm a complete novice and know next to nothing about this but I do know how to make life easier and standardisation has happened in every other industry in the world even resistors these days don't have coloured bands they have the resistance written on them and bronze silver or gold bands depending on the tolerance
+ 1
thank you for explaining that I see what you're saying that day 2 day programming needs no explanation just the specialised or unconventional need to have comments to explain thank you I can see the bigger picture a bit easier now
0
thanks Jay so do coders not use lots of comments to protect their programme.or why aren't more comments used?c++ that is as I have looked at some complicated large programme source code with no comments at all
0
am I right if I say the programs these days are absolutely massive so it wouldn't be best practice to make comments I think it should be compulsory because I'm sure but please correct me if I'm wrong these massive programs are modular