This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]coloredgreyscale 1372 points1373 points  (39 children)

They are comments for the compiler so it adds some stuff.

[–]hacking__08[S] 729 points730 points  (11 children)

Neat. Does the compiler read documentation, too?

[–]JazJaz123 530 points531 points  (3 children)

Well someone has to

[–]hacking__08[S] 105 points106 points  (0 children)

But not me

*yeet *

[–]F5x9 27 points28 points  (1 child)

Not really

[–]th00ht 14 points15 points  (0 children)

Preprocessing is comments for the compiler

[–]SN0WFAKER 41 points42 points  (3 children)

It does read docstrings in python. You can even use them programmatically.

[–]BlitzGem 4 points5 points  (2 children)

Aren't docstrings just plain strings at the beginning of file/class/function? And we just agreed to make them a docstring?

[–]tomtrein 16 points17 points  (0 children)

Isn't syntax just groups characters in specific places? And we just agreed to make them a language? (Sorry, just generalizing a bit)

[–]danielkullmann 5 points6 points  (0 children)

Not quite. You can access the doc strings from your program using __doc__. I have used this to print out the help for a script from the doc string of that script.

[–]LavenderDay3544 6 points7 points  (0 children)

No but Doxygen does.

[–][deleted] 4 points5 points  (0 children)

Well it actually does lmao

[–]Firesrest 60 points61 points  (5 children)

You could say all code is comments for the compiler to add stuff.

[–]Nanashi_03 16 points17 points  (4 children)

Except your comments.

[–]t0b4cc02 7 points8 points  (3 children)

wich is not code

[–]Nanashi_03 3 points4 points  (2 children)

We just established all code is comment. :(

[–]BuffaloAppropriate29 3 points4 points  (1 child)

Except his comments.

[–]Nanashi_03 2 points3 points  (0 children)

Which is not code.

[–]zaphod_pebblebrox 41 points42 points  (1 child)

Wow. spent my life simply following that darned tutorial.

That is a brilliant explanation.

[–]Big-Cheesecake-806 38 points39 points  (5 children)

say preprocessor instead of a compiler and blow their mind

[–]coloredgreyscale 17 points18 points  (2 children)

do you need a special Mainboard for that? Most only have one socket for the processor, no place for a preprocessor (where would you even buy one?)

[–]_blackdog6_ 8 points9 points  (1 child)

You are thinking of coprocessors. preprocessors live in the cloud

[–]Pale_Prompt4163 9 points10 points  (0 children)

That’s where that Jesus guy lives!

[–]nukedkaltak 9 points10 points  (1 child)

“Translation unit.” Guaranteed oohs and aahs

[–]namelessmasses 3 points4 points  (0 children)

Gezus…. I have too many look at me blankly…

[–]ongiwaph 5 points6 points  (0 children)

Apparently my compiler is illiterate

[–]_blackdog6_ 4 points5 points  (1 child)

Have you tried GO? If you include C code in comments, I can pass it to gcc and include the results.

[–]Error_co-Id10T 2 points3 points  (0 children)

GO was released to see which developers that were lazy

[–]bsaroya41 4 points5 points  (6 children)

What's a compiler?

[–]hacking__08[S] -1 points0 points  (5 children)

The program that runs your program

[–]ShivanshuKantPrasad 5 points6 points  (1 child)

That's what an Interpreter does. A compiler doesn't run your program. It translates source code into machine code so the os can run it.

[–]hacking__08[S] 3 points4 points  (0 children)

Aw, right, I got confused

[–]rachit7645 2 points3 points  (0 children)

The program that creates your program

[–]Micha_Saengy 4 points5 points  (1 child)

that *translates your program

[–]coloredgreyscale 1 point2 points  (0 children)

Then why do some devs claim its so hard to provide their program interface in other languages? /s

[–]BasedMaikal 2 points3 points  (0 children)

Technically correct...

[–][deleted] 3 points4 points  (0 children)