[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Are comments really necessary for proper code or is it just a

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 3

File: 1471451869503.png (1MB, 600x900px) Image search: [Google]
1471451869503.png
1MB, 600x900px
Are comments really necessary for proper code or is it just a bs practice like having your hands at 4 and 8 o'clock on the steering wheel?
>>
>>56169192
Go back to your second week of CS101 before you challenge the standards of software development
>>
File: reading-other-peoples-code.png (355KB, 700x575px) Image search: [Google]
reading-other-peoples-code.png
355KB, 700x575px
>>56169192
Don't use comments if you value your job security
>>
>>56169192
It depends
>>
It's necessary every time you need to go back and reuse code (a lot normally)
>>
>>56169258
Is this really true? I've heard it said before on /g/, but it doesn't sound like it would help that much. It sounds like the perfect excuse for a boss to fire an employee for not confirming to standards and just hire a new person to re-document what wasn't documented in the first place.
>>
>>56169321
They would make any excuse to fire your ass and hire pajeet
>>
>>56169321
its not, if you dont comment your code you're only fucking yourself.
>>
>>56169192
>Posting furry shit outside >>>/trash/
Get out
>>
Have you ever worked on a large project? It's absolutely important to comment your code. Most people, however, don't know how to do it. I don't need you to tell me what the code is doing. I need to know why you did it. Think about what you would want to know if somebody else wrote it.
>>
>>56169658
No comments need to be updated whenever the code changes and if they aren't then they are useless. If you can't figure out the code without a comment, write better code.
>>
>>56169676
Cant tell if you are agreeing with me or not.

Comments shouldn't need to change as long as it is refactoring, it still gives me the why.

If code is written where it cannot be understood it should be rewritten.

If code were to change in a way that changes the way the program behaves you would need to update comments. Otherwise there should be no need
>>
File: 1334064706848.png (283KB, 1256x1075px) Image search: [Google]
1334064706848.png
283KB, 1256x1075px
>Are comments really necessary for proper code

yes. believe it or not sometimes you have to go back to some code that you wrote many moons ago, and if you don't have any commenting there it's a much slower job to fix / update/ whatever that code.

beyond that, it's actually a helpful coding practice, to write in some comments what you want a method or class to do, so that later on in the project you know why you made certain design decisions or why you ordered your switch statement, anything like that.

any good coding standard at a work place should require you to at least write some skeleton comments for your stuff. i've seen code comments that are everywhere and too much, but that is less frustrating than no comments anywhere. working with a team you would comment to help the collaboration
.
i also write pseudo code and draw entity relationship diagrams, and probably over comment ,personally i find commenting my code a good part of the design and decision making process.

people think that there is that element of spaghetti code bullshit that "omg i can keep this shit job if i write code that no one else can follow" but that just makes you a fucking faggot rather than some job secure genius, you're still going to get fired for being a fag, it's just going to make it slightly more annoying / slower for the person replacing you.


you should also have your hands at 10 and 2 not 8 and 4.
>>
Rule of thumb: if you need to write comments, then you're not being descriptive enough with your function/ variable names and probably being too hacky in your solution.
Thread posts: 14
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.