Well, Jow Forums? Do you add comments in your code?

Well, Jow Forums? Do you add comments in your code?

Attached: 3212312412.gif (424x314, 3K)

Yes but not in an autistic way like that.

Yes, I write documentation in comments.

Attached: 1565423842751.jpg (1080x1207, 100K)

>mfw I overcomment

Only retards, apathetics, and street shitters dont add comments.

It will all be removed in compilation, so theres not much excuse other than "I am too much of a fattass/lazy/retard to do it"

>your code should read by itself bro

Imagine being so much of a brainlet you leave comments because it's a pile of spaghetti code that you literally need to spend all day reviewing to know at all what the fuck it does.
>NOOOO *soi face* YOU'RE SUPPOSED TO COMMENT EVERYTHING!!!!
Make me nigger.

>Bro, bro! I just slayed some pussy last night, wanna hit the bar and drink budwisers all night again?
>Craft beer? Spirits? You mean that nerd shit? Fuck that, I just write code, and slay pussy.

Attached: 1497478111550.jpg (700x1120, 150K)

>Imagine being so much of a brainlet you leave comments because it's a pile of spaghetti code that you literally need to spend all day reviewing to know at all what the fuck it does.

Attached: 32132424132.jpg (800x450, 44K)

i prefer ruby, my code IS comments in most cases

for me i use comments to sorta "categorize" bits of code so i can look at somethin and go "oh, that's the section that handles [x]", otherwise i only use them for things that differ from the usual way people implement things, anything that stands out pretty much. doesn't really matter a whole lot since i only do solo projects anyway and using this system i've been able to go back reading code from years ago with 0 issues so i'd say it works

Attached: 0004710848_200.jpg (200x200, 12K)

I try to write code that doesn't need comments to make sense lol. So when I actually comment its usually for references. Don't be a brainlet.

Can't you just use methods to do that?

nah because i'm talkin about stuff that's like too small to really warrant moving to another function but at the same time still helpful to have comments sorta making it easier on the eyes, it's mostly a time-saving thing since i have an easier time reading "-- OpenGL setup --" than i do manually lookin for whatever section is actually setting up opengl for instance. i also prefer this to havin another function since everything reads in a linear fashion and less like a choose your own adventure book, long functions are not inherently bad

No. I add documentation.
And not for trivial shit like this. I use the proper pattern (MVVM) to make the data flow obvious.

Always comment where necessary. You never know when you'll stop working and then resume your work. Maybe days, weeks, months, years later. You'll need some comments to guide your future self should you suffer amnesia or if you have to explain some of the functions to someone else.

jobless

yeah
makes it much easier to search through the code, especially if I've been away from a project for a bit (which often happens)

usually just a one-line comment every couple lines describing the vague process the code block does, usually with some key words

sounds gay just make a function called opengl_setup.

functions are what make ur code readable.

i'd agree if opengl_setup were like 200+ lines or something but otherwise it's literally just wasting time, functions aren't there to categorize you're code they exist to make it easier to pass around data and do stuff with said data, if there's no data involved here (using the opengl example, literally just a bunch of `glEnable()` calls and such) and these calls in total end up being like 12 lines, what's even the point?

it absolutely isn't more readable, if you read a call to opengl_setup() without being able to immediately know what's going on, then suddenly you're asking "okay, well what is it setting up? what is it initializing?" whereas with the comment thing you can literally just see "// opengl setup", look down and know exactly what it's doing. i dunno why the cia keeps teachin this bs in schools, it's like fuckin "oh no calling printf() a couple times isn't readable enough how about i just make a print_stuff() function that'll fix it"

>having to comment a block of glEnable lines with "OpenGL setup"
I think the function name speaks for itself.

Yes. There's a healthy balance of writing self-documenting code and also providing clarity in places due to various constraints you're forced to implement a bit unconventional that will trip up others when they come across the code.

I only comment when I want to grab the programmer's attention.
For example when something is error prone, or just weird/unexpected.
That way they don't get lost in a sea of unimportant comments.
Also, the higher the quality of the code the less comments I need so I actively try to avoid having to comment things by improving the code instead.

you're missing what i'm saying

glEnable() is just an example, the issue isn't "oh noes i can't understand what the code is doing", it's more like "hey i want to use this comment to briefly describe a section of code"

if you want a more realistic example then here, even if all of the function names "speak for themselves", that's kinda irrelevant. if i'm quickly skimmin through this function or just need to ctrl+f i can look for "OpenGL FBO" and change whatever i need. this is an organization thing, the comment isn't there to explain OpenGL FBOs for you, it's just there as a point of reference. there's no reason to make it a function since it wouldn't be taking in anything that can change, VW/VH are constants, and it's brief enough that it wouldn't really enhance readability, sooo i don't really see the benefit here. it's already in a function that's dealing with opengl initialization stuff so making another one called init_fbo() or w/e is kinda redundant

Attached: gay.png (627x267, 19K)

Shit code, let me FTFY.

///
/// This button gets information from a class.
///

/// The purpose of this method is to react to the user clicking a button by showing her or him
/// a message in a .
///
/// The sender.
/// The .
public void btnStrings_Click(object sender, EventArgs e)
{

// The first name of the user.
string firstName;

// The message text to show the user.
string messageText;

// Setting the message text to show the user.
messageText = "Yout name is: ";

// Setting the first name of the user to the text of textBox1.
firstName = textBox1.Text;

// Show the message.
MessageBox.Show(messageText + firstName);

}

It was hard to write, it should be hard to read.

did you just assume my pronouns