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

Pages: 1-4041-

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.

Name: Anonymous 2010-06-21 1:08

>>40
You sound just as incompetent as your co-workers. At the very least, you do type incompetently.
IHBT

Name: Anonymous 2010-08-16 23:31

I make my code self-documenting, using good descriptive identifier names and well-factored methods/functions. I comment about non-obvious approaches or decisions I've made in writing the code to provide rational for why I did it that way. I also use doxygen to thoroughly document the public interfaces and APIs of my libraries.

But commenting every line or every few lines of code as the OP suggests is for the novice or amateur.

Name: Anonymous 2010-08-17 0:35

>>42
Dear Sir:
Our firm represents Deckers Outdoor Corporation, 495-A South Fairview Ave., Goleta, CA, United States ("Deckers") in trademark and copyright matters. Deckes is known in the trade as UGG Australia and owns the UGG trademark for footwear, clothing, outerwear, bags, and other goods. UGG is a registered trademark in the United States (U.S. Reg. No. 3,050,925), China (Reg. No. 880518), and more than 70 other countries around the world. In the United States, the UGG mark was first used at least as early as December 28, 1979, and was first used in interstate commerce at least as early as December 28, 1979. Deckers maintains a website at uggaustralia.com where genuine UGG goods are sold using its UGG trademark, including UGG sheepskin boots,
I. Multiple images and/or text that appear on the website at ugg2all.com are unauthorized reproductions of Deckers' copyrighted works. Pursuant to 17 U.S.C. 512, we hereby request that you expeditiously remove the website located at ugg2all.com from your web search results for violations of United States Copyright law.

Pursuant to 17 U.S.C. 512(c)(3)(A)(ii), we hereby identify the following copyrighted works that are being infringed by the site at (note that this list is representative only -multiple others of Deckers' copyrighted works are being infringed by material found at
UGG Australia's Women's Nightfall (Image).

2. Pursuant to 17 U.S.C. 512(c)(3)(A)(iii), we hereby identify the following images and/or text on the website at , and provide the following representative list of materials on the website at that are infringing our clienf's copyrights:
UOG Australia's Women's Nightfall (Image).
Search query: "UGG boots"
Infringing webpage(s): < http://ugg2all.com/>;
It is noted that several additional materials on the website at are infringing our client's copyrights. However, for the sake ofbrevity and in accordance with the provisions of 5I2(c), only a representative list has been provided.

3. Pursuant to 17 U.S.C. 5l2(c)(3)(A)(iv), we hereby provide the following contact information:

[redacted] GREER, BURNS & CRAIN, LTD. Suite 2500 300 S. Wacker Drive Chicago, IL 60606 Ph:[redacted] Email: [redacted]@gbclaw.net

4. The whois information for the website at indicates the e-mail address of the owner/administration is [redacted]@whoisprivacyprotect.com. The website also provides [redacted]@ugg2all.com.


5. I have a good faith belief that use of the copyrighted materials described above on the allegedly infringing webpages is not authorized by the copyright owner, its agent, or the law.

6. I swear, under penalty of perjury consistent with United States Code Title 17, Section 512, that the information in the notification is accurate and that I am the copyright owner or am authorized to act on behalf of the owner of an exclusive right that is allegedly infringed.

In addition, investigation suggests that the website at is being used to sell counterfeit UGG goods from China and/or other foreign countries to consumers in the U.S. These counterfeit sales violate multiple U.S. laws, including Title 15 of the United States Code. 15 U.S.C. 1117(c)
For these reasons, we request the website at ugg2all.com be removed from the Google web search results. If you have any questions regarding this matter, pleas: contact us.
Yours truly,
GREER, BURNS & CRAIN, LTD.
[redacted]

Name: Anonymous 2010-08-17 4:46

No. The reason is simple. I don't want you to understand my code.

Name: Anonymous 2010-08-17 5:17

>>43
I tend to put a two- or three-word comment every 5 or so lines explaining what the batch of lines does. It makes the code very easy to skim. Code should be easy to understand without the comments, but the comments help you read through it very quickly to find what you're looking for.

Name: Anonymous 2010-08-17 5:40

>>46
# hax my anus
# read sicp
# my other car
# is a cdr

Name: Anonymous 2010-08-17 6:25

I want to document my code, but leaving it undocumented so that only I can understand it improves my job security.

Name: cheap prog boots 2010-08-17 9:22

>>44
clienf

Name: Anonymous 2010-08-17 14:14

char (*(*imafaggot)[])();
I'm going to go against the mood of the thread and ignore whether I'm being trolled or not.  This is the kind of thing I would look at someone and accuse them of "pendatry for the sake of pedantry" unless there was a good reason why this was the only solution available or that made sense.

Name: Anonymous 2010-08-18 7:02

>>50
That's because you don't actually know any C.

Name: Anonymous 2010-08-18 9:13

>>51
Despite having been using it for over ten years?

Name: Anonymous 2010-08-18 11:32

>>52
Yes, you actually know as much C as you know English.

Name: Anonymous 2011-01-31 20:44

<-- check em dubz

Name: Anonymous 2011-02-03 6:02

Name: Anonymous 2012-01-12 6:24

ya it makes it easier for me to edit it and pass it off as my own since I don't know how to code free hand.

Name: Anonymous 2012-01-12 6:47

I don't write spaghetti code.
I don't write inconsistent crap.
My code is correct and behaves as it should in all the cases.
Special cases are a sin.
My naming convention documents whether the procedure is destructive, a predicate, or pure, and whether a variable is mutable, dynamic, or constant.
My code is self-documenting, I write comments only when the implementation or interface is not completely obvious. When it happens, especially in the interface, I take it as a failure of mine for not being able to do The Right Thing.

Name: Anonymous 2012-01-12 7:37

>>1
It's a function pointer to a function that returns a char-array. How is that unclear in any way.

Name: Anonymous 2012-01-12 7:46

>>1
Source code. It's a code, encoded for the sake of obscurity.
Not. People should use typedefs.

Name: Anonymous 2012-01-12 8:08

>>59
Do you write things like notify-user! or send-message!?

Name: Anonymous 2012-01-12 9:09

>>62
It depends.

Name: Anonymous 2012-01-12 9:49

>>63
On wha?

Name: Anonymous 2012-01-12 10:07

>>64
If the only thing they do is to notify the user and send a message, and do not update anything, I'd drop the !.
I would write neither of those procedures, though.

Name: Anonymous 2012-01-12 11:43

>>65
How would you do it, then?

Name: Anonymous 2012-01-12 18:16

>>66
dice nubs

Name: Anonymous 2012-01-12 19:57

char (*(*imafaggot)[])();
It's pointer to an array of pointers to functions accepting unspecified arguments (C) or no arguments (C++) and returning a char.

Name: Anonymous 2012-01-12 20:07

``dickbar''

Name: tiffany cross pendant 2012-03-06 23:40

http://kaka-tiffany.com/                                            Tiffany and co
http://kaka-tiffany.com/tiffany-collections/tiffany-keys.html                                            diamond letter s necklace
http://kaka-tiffany.com/tiffany-co-necklaces/tiffany-letter-s-pendant-with-diamond-tfnl419.html                                            tiffany cross pendant

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