Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

COMMENT YOUR GOD DAMN CODE

Name: Anonymous 2010-06-15 11:46

Hi.

It has come to my attention that you faggots need to learn to comment your code. I'm looking at you, C fags, with your unreadable declarations.

char (*(*imafaggot)[])();

Tell me what this is and you win a prize.

Programs should be written for people to read, and only incidentally for machines to execute. - SICP 101

Name: Anonymous 2010-06-15 11:49

Read it from the inside out.

Name: Anonymous 2010-06-15 11:50

char (*(*imafaggot)[])();
A pointer to a an array of arrays of function pointers where the function take no arguments and returns a char.

You can keep your prize. Read K&R.

Name: Anonymous 2010-06-15 11:51

Name: Anonymous 2010-06-15 11:52

It's really not hard to comment your code, but I feel as though OP has used a bad example as the majority of C coders know (should know) what that statement means

Name: Anonymous 2010-06-15 11:55

thats an array of gays

Name: Anonymous 2010-06-15 12:29

In Java this statement would be ten times larger, execute ten times slower and waste precious ten times ram. This compact piece of code would generate just several opcodes.
You don't like it because you haven't learned pointers, casts and C declaration structure deeply enough.

Name: Anonymous 2010-06-15 14:07

Hi.

It has come to my attention that you faggots need to learn to use [code] tags. I'm looking at you, >>1, with your non-formatted code.

Name: Anonymous 2010-06-15 14:20

Unsurprisingly, most people whining that code doesn't have enough comments are just trying to shift the blame for their own incompetence. Thanks for the demonstration, >>1.

Name: Anonymous 2010-06-15 16:41

Properly written code is self-documenting.
OP is a faggot, who doesn't belong here if he can't figure out that declaration.

Name: Anonymous 2010-06-15 16:57

I always follow the rule of document ``why'', not ``what''. If you can't tell what it does by looking at it, re-write it to be clearer.

Obviously things are different for platform/library code, where users don't necessarily want or need to read the code. In that case it's still not verbosely describing ``what'', but summarizing. Even then, well written APIs should be fairly obvious.

Name: Anonymous 2010-06-15 17:23

I thought you documentation nazis might like some documentation so here you have some documentation. That enough documentation for you?
Please do not think about anal intercourse while reading this documentation. Thank you.


addEventListener
Registers an event listener, depending on the useCapture parameter, on the capture phase of the DOM event flow or its target and bubbling phases.
Parameters
type of type DOMString
Specifies the Event.type associated with the event for which the user is registering.

listener of type EventListener
The listener parameter takes an object implemented by the user which implements the EventListener interface and contains the method to be called when the event occurs.

useCapture of type boolean
If true, useCapture indicates that the user wishes to add the event listener for the capture phase and target only, i.e. this event listener will not be triggered during the bubbling phase. If false, the event listener must only be triggered during the target and bubbling phases.

No Return Value
No Exceptions

Name: Anonymous 2010-06-15 17:53

expert programmers like to make things as terse as possible, so that it can only be appreciated by other expert programmers

Name: Anonymous 2010-06-15 18:08

>>13
Turd is pretty terse.

Name: Anonymous 2010-06-15 20:03

So when is it a good idea to comment your code? and how much should you comment about it?

Name: Anonymous 2010-06-15 21:48

Programs should be written for people to read, and only incidentally for machines to execute.

Who said this garbage?

Name: Anonymous 2010-06-15 21:53

>>16
It's one of those lies-to-children that only make sense when applied to beginners, which is the context in which the Abelson used it. Sadly, some people miss the point and want to apply it to everyone. Knuth is one of these idiots, and so is >>1.

Name: Anonymous 2010-06-15 22:24

It's a declaration for the function imafaggot which returns an array of pointers to strings. Or you could think of it as a 2D array of strings.

Name: Anonymous 2010-06-16 1:11

>>15
comment enough so that the next guy to maintain your code doesn't want to break in your house with an axe and chop your head off.

that's the guideline I usually go for.

Name: Anonymous 2010-06-16 3:57

>>18
imafaggot
Yes. Yes, you are. You are also wrong.

Name: Anonymous 2010-06-16 7:04

Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.

Name: Anonymous 2010-06-16 9:49

>>21
I'm quite a placid psychopath.

Name: Anonymous 2010-06-16 14:51

>>21
I do. And I am. So I do. And therefore I must.

Name: Anonymous 2010-06-16 15:50

Name: Anonymous 2010-06-16 16:16

>>21
What if you are the violent psychopath?

Name: Anonymous 2010-06-16 16:22

>>25
I have some experience in this field, and I can tell you: it's a moot point. My code is inevitably of much higher quality than that of anyone around me, so nobody ever has cause for complaint even if I don't comment at all.

Name: Anonymous 2010-06-16 16:43

>>24
Your point?

Name: Anonymous 2010-06-16 16:55

//SHUT THE FUCK UP

Name: Anonymous 2010-06-16 18:13

>>28
The content of your message disagrees with your lack of sage, regardless of which purpose you ascribe to sage. Are you some sort of idiot?

Name: Anonymous 2010-06-16 18:23

>>29
I AM THE ANTI-SAGE. FEAR MY WRATH!

Name: Anonymous 2010-06-16 18:35

>>30
wat

Name: Anonymous 2010-06-19 21:36

>>12
I lol'd.

Name: Anonymous 2010-06-19 22:24

>>1

This is not a valid declaration according to the defacto C standard.

The symbol is way too identifiable (it describes what it is [I] and what it does [fag stuff]) and therefore meaningful. Every good 1337 C programmer knows that you must keep your symbols short and only meaningful to the programmer up to 5 minutes after they decide on it.

If you want to be a 1337 n00b you could go with an initialism:
char (*(*iaf)[])();
But that is still kinda script kiddy because there is a chance, no matter how slight, someone might infer the intended meaning. But it is good enough to fake your way past an expert C code reviewer.

Also, this is 3 times slower than just giving it 1 letter as any excellent C programmer knows. The shorter it is, the more efficient it is.

char (*(*i)[])();

That is the best C declaration anyone can hope for.

Name: Anonymous 2010-06-19 22:44

>>33
Turnkey best practices Java ``programmer'' detected.
Also, WHBTC.

Name: Anonymous 2010-06-19 22:47

>>34
World Harvest Bible Training Centre

Name: Anonymous 2010-06-20 0:02

>>35
Wexford Harbour Boat and Tennis Club

Name: Anonymous 2010-06-20 6:04

>>34
>>35
>>36
Wyoming Hair and Beard Trimming Championship

Name: Anonymous 2010-06-20 8:13

>>35-37
Still not funny

Name: Anonymous 2010-06-20 9:22

ya it makes it easier for me to steal code and pass it off as my own since I dont know how to write code from scratch.

Name: Anonymous 2010-06-20 19:37

...but, but perhaps, I DON'T WANT OTHERS TO READ MY GODDAMN GOD!

If you ever worked in a place while the incompetent idiots run the place and your incompetent coworkers rely on you for every GOD DAMN STATEMENT and despite this you are still PAID THE SAME and RESPONSIBILITY falls on YOU AND ONLY YOU  than perhaps you will understand.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List