How do you comment your code?

Pic related is what I do even for simple HTML/CSS stuff. I just like the idea of sectioning things into neat little categories.

In JS I like using functions for the same reason, it seems so tidy. I might have autism.

Attached: Screen Shot 2019-03-27 at 1.43.56 AM.png (509x743, 90K)

>I might have autism.
user, I...

i do not comment

Depends
>Jupyterlab
I try to do full notes before each section with useful links and other stuff
>Whatever text editor I'm currently using
Like yours but with other stuff in each line.

At work I rarely comment code unless it's unexpected behaviour. The codebase is quite self-documenting. Only client code is commented in a javadoc style to autogenerate docs from it.
CSS, whenever I actually touch that shit, I also categorize, but by splitting it into multiple files and using include-directives.
Focus on writing clear, concise code and structure your programs well, you'll find there isn't much to comment.

DOXYGEN
O
X
Y
G
E
N

I only ever comment on things that need explanation. Comments aren't necessary if you write easy to read code.
>// initialize car
>Car car = new Car();

>// write comment
>// initialize car
>Car car = new Car();

>//these bullets are gonna expand into lead flowers
>// write comment
>// initialize car
>Car car = new Car();

>//Random comment because im so quirky xD
>//create a new car object by initializing a new object of type car named “car”.

I don't comment. Commenting is a crutch for bad programming. You shouldn't need to comment if your code is clear and concise. It is better to not comment than to comment at all because no comment is better than an incorrect or misleading comment.

t. bad programmer

method docstring :
>// this does X
>// non-trivial I/O if necessary
>// link to wikipedia or something if the math is too hardcore for the QA guys

Class:
>// This represents A and does X
>// intended to be inherited by B, used by C, extended by D

nested loops :
>// this one is #1
>// this is #2, does X , goes to #4, back to #1

half the codebase commented out because it's bugged as hell and I don't know how to fix this shit yet :

>// don't touch that you motherfucker
>// I'll rip your balls out and shove them in your eye sockets
>// If you know how to fix that or think you do send a message to [email protected]

t. very bad programmer

>How do you comment your code?
I record myself.

>\\ repeat task until x is no longer 3
>do { // code } while (x == 3);

what this user said. Only comment what you know you wont understand in a year. This is usually logic, such as math or calculations

>if(something)//this check the fucking shit

on the line

In the real world, you're actually encouraged to not comment your code since it makes it easier for rivals to steal your code.

If your css files need commenting you're writing too messy css.

Don't you think literally anyone can understand that everything with the prefix "nav" understands it has to do with "navigation"?

You're coding like a woman. Not that that's a bad thing per say, it's good that stuff is nice and clean, but it's ultimately pointless. Explain in comments what needs to be explained, not literally everything

I just try to use variable names that make sense.
Usually removes the need for me to comment at all.

I store all of my comments in one line with line numbers to know what is what.

//
// Windows kernel style comments
//

C_ASSERT(nt > linux);

Attached: vs_c.png (1106x898, 119K)

but nobody here actually (((codes)))

>The codebase is quite self-documenting.

If I showed it to a toddler would he get it?

Attached: 1538523197858.jpg (466x493, 51K)

This thread is proof

Are you a toddler?

The code was meant for devs to read and adapt, and we don't hire toddlers.
I picked it up in a couple of days while working on it, some flowcharts being available in the source to help.
Take your documentation evangelism elsewhere.

See

>I might have autism
No you're a hypochondriac normalfag larping as an xD nerd for the Chon.
It's a good practice, commenting shit, but you're not special for doing so. Faggot.

The problem is you are a bad coder. Stop lying to yourself. I can prove it too. The 10 year law. Take your current age and subtract 10. Were you smart back then? No, you were a fucking idiot. Chances are you're a bigger idiot today, its just gonna take you 10 more years to realize it.

TL;DR: Comment your code user. You're an idiot.

3 cases:
to-do lists and possible optimizations
1-2 letter variable declarations
>int lx 0; //local
bit shifting magic

I only write comments that I feel help reason about the code. Comments have the same problem as tests: Once you have them, you need to keep them in sync with the code. Having comments saying things that are no longer true is worse than having no comments.