5 ms·
Very fancy but, in my opinion, completely useless as a development tool. I can’t see how reading natural language is better than reading code.
by jopnv 4y ago
Very fancy but, in my opinion, completely useless as a development tool. I can’t see how reading natural language is better than reading code.
- Supermancho 4y ago> completely useless as a development tool. I can’t see how reading natural language is better than reading code. Isn't this a variation on "who needs comments anyway, just read the code?"
- aphexairlines 4y agoComments explain why the code is there. That's different from translating code into English.
- Supermancho 4y ago> That's different from translating code into English. That's not what this "TLDR plugin" does, because there is no magical translation. You put whatever you want in there. I think this is obvious. Ironically, you basically rephrased the title, while objecting to it's use? > Comments explain why the code is there > TLDR explains what a piece of code does
- xboxnolifes 4y agothat's their point, and why they don't think it's useful.
- Supermancho 4y ago> X does something that is commonly done, in a different way than Y. This means X is useless It's still not clear how this explanation is supposed to be sufficient to explain the conclusion. If a comment is collapsed in an IDE and you spend 1 click/key combo to expand it, versus some key combination to pull up the TLDR, the difference is what? Comments being embedded IN code could be a thing of the past. No PR necessary to maintain them. Sounds like an improvement to me.
- marginalia_nu 4y agoCarefully consider the following description of a function: The function adds 5 to i, and if j is less than three, the function sets it to 2. Does it describe this code? function f() { i = i + 5; if (j < 3) { j = 2; // <-- } } ... or does it describe this code? function f() { i = i + 5; if (j < 3) { i = 2; // <-- } } The answer is yes, and this is ultimately why we use programming languages rather than natural language to instruct computers.
- lupire 4y agoCode can have ambiguous scope too, except the compiler has a decision making process that you might not fully understand. (Closures are famous for this problem). In the English you can recognize the ambiguous parse and reject it.
- marginalia_nu 4y agoThe meaning of code is defined by rules. The only ambiguity exists in human understanding of code. Natural language doesn't have such rules. My example above isn't an example of incorrect English, there isn't a correct interpretation. The grammar is correct and both interpretations are correct.
- Zvez 4y agonope this is variation of 'don't write obvious comments to your code'. Useful comments can include the 'whys', links to design docs/decisions, references to other part of source code. Here we see the case of commenting everything for the sake of commenting. Without adding any additional knowledge/insights.
- magicalhippo 4y agoIndeed. And if well written, the majority of the code shouldn't need comments. For example, well-chosen descriptive identifier names can make code fairly self-documenting. The comments then should then be reserved for the cases where it is not obvious why or how something is done, or for assumptions that can't be expressed through code (type system or similar). So instead of having the following // set i equal to five i = 5; either skip the comment, or, since 5 might seem arbitrary, comment why 5: // first four slots are reserved i = 5;
- ffhhj 4y agoSame impression. At least in that example it's faster to read the code to understand. I'd like them to decipher some real spaghetti code.
- it_citizen 4y agoNatural language makes it easier to understand a general concept. It is, however, more ambiguous. Think about it has a general picture description vs a description pixel by pixel. Both have value depending on what you need.