6 ms·
Couldn't help but chuckle at this: 'use strict'; // avoid ambiguity and sloppy errors If the line that starts (or ought to start) virtually every JS file
by fenomas 10y ago
Couldn't help but chuckle at this:
'use strict'; // avoid ambiguity and sloppy errors
If the line that starts (or ought to start) virtually every JS file you ever write can't stand without explanation, one wonders what can!
- twblalock 10y agon++; // increment n
- bbcbasic 10y agoand return the original value
- hvidgaard 10y agoI've had students that did this. It's a real pain to read code like that, and the 2nd time they handed it in, it was an automatic fail. Comments explain assumptions, and often "the why", never "the what" unless it's obscure because of optimizations.
- BinaryIdiot 10y ago> It's a real pain to read code like that, and the 2nd time they handed it in, it was an automatic fail That seems incredibly heavy handed and not helpful in the learning process. I was a professor's aid for several programming courses and many students simply made comments like that constantly because it helped them drill it into their head what it did. It's a little annoying but it doesn't hurt the readability. Automatically failing them on a second turn-in seems very anti-student and anti-learning to me. Teaching through negative reinforcement is the worst way to teach.
- kagamine 10y agoI felt when I was a student that some teachers just wanted everyone to know how clever they were and sometimes that could be achieved by putting someone else down. Someone who wasn't in a position to talk back. The good teachers gave criticism, pointed to the code standards for the course and were fair in their marking. The best teachers asked questions that made the students produce better work and took time to explain and discuss. They all knew which category they were in.
- hvidgaard 10y agoYou can see my reply to the parent comment. I always sit down and talk with the students, but for us to talk about the code, we need to be able to read the code. Unneeded comments make it significantly harder to read code. First time we talk about why I don't want "the what" comments, only "the why" comments. If they still do it in the next handin it's a fail unless they've explicitly provided me with a reasonable reason to do it.
- 10y ago