If before every bit of coding a statement of intent and idiot proof explanation would it slow the program by the mass of data | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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

2nd Feb 2017, 9:46 PM
Carl H von Ohlen
Carl H von Ohlen - avatar
9 Answers
+ 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.
2nd Feb 2017, 9:52 PM
jay
jay - avatar
+ 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
2nd Feb 2017, 9:59 PM
jay
jay - avatar
+ 4
On very large projects it would be compulsary. But again. Only obscure code which is not obvious to a professional programmer.
2nd Feb 2017, 10:11 PM
jay
jay - avatar
+ 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.
2nd Feb 2017, 10:08 PM
jay
jay - avatar
+ 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
2nd Feb 2017, 10:16 PM
jay
jay - avatar
+ 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
2nd Feb 2017, 10:03 PM
Carl H von Ohlen
Carl H von Ohlen - avatar
+ 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
2nd Feb 2017, 10:14 PM
Carl H von Ohlen
Carl H von Ohlen - avatar
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
2nd Feb 2017, 9:58 PM
Carl H von Ohlen
Carl H von Ohlen - avatar
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
2nd Feb 2017, 10:09 PM
Carl H von Ohlen
Carl H von Ohlen - avatar