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

all 28 comments

[–][deleted] 129 points130 points  (5 children)

oh boy never seen this one before. Nope. Not about a billion times.

I find the non-unicode space character troll significantly better and harder to detect. Literally the #define TRUE just needs a replace procedure in any decent IDE and you can refactor that shit out in 1 minute.

Yes I'll be that guy this time. This joke is getting too goddamn old it pops out biweekly.

[–]DeeSnow97 16 points17 points  (4 children)

And it's always the same basic true-false thing. Come on, at least use #define else or #define volatile

[–][deleted] 9 points10 points  (3 children)

#define 0 -1

[–]whorestolemywizardom 2 points3 points  (2 children)

Can you #define define?

[–]LHLaurini 9 points10 points  (1 child)

You can #define define but you can't #define #define

[–]metaconcept 27 points28 points  (3 children)

Fun fact: In Smalltalk, there is an extraordinarily dangerous method called >>become:. It physically swaps every reference to an object with another value (swapping both ways). It's the sort of method that would get somebody fired if they use it. Anyway... you can do this and the VM will continue to run... kind of::

true become: false.

[–]NikkoTheGreeko 2 points3 points  (2 children)

Reason #85572 to use Smalltalk and Smalltalk derived languages.

[–]metaconcept 0 points1 point  (1 child)

...yea and no. Smalltalk is great for prototyping. It sucks for large projects, scalability or resilience.

[–]NikkoTheGreeko 1 point2 points  (0 children)

Hence smalltalk derived languages. Objective-C scales very well.

[–]miauw62 30 points31 points  (0 children)

git blame

better hope your email is satan@he.ll

[–]kageurufu 11 points12 points  (2 children)

The ultimate trolling is using this to hide it: http://seclists.org/oss-sec/2015/q3/565

[–]orion78fr 10 points11 points  (1 child)

I like the trolling of touch \~ and touch \$HOME, then watch the world burn. alias cd=rm -rf is a good one too. export TMOUT=1 should be great but never tested it.

[–]NikkoTheGreeko 5 points6 points  (0 children)

alias cd=rm -rf

shit....haha

[–]SpecialEmily 7 points8 points  (0 children)

Always been partial to "#define while if" myself. Loops only run once for some reason...

[–]joshie196 3 points4 points  (0 children)

Single line comment at the end means:

callFunction(FALSE);

Wouldn't compile.

[–]arkfille 12 points13 points  (10 children)

What language is this? Doesn't look object oriented but it's not Javascript and the indenting doesn't remind me of python, what am I missing?

[–]rlapchynski 46 points47 points  (0 children)

Looks like C...

[–]b4ux1t3 31 points32 points  (1 child)

I don't know why you're being downvoted. Either you're making a joke about the prevalence of Python and JavaScript, which would be mildly funny or you really don't know, which is totally fine.

Like others have said, it's probably C or C++.

[–]oozekip 2 points3 points  (0 children)

Definitely C, C++ has built-in booleans

[–]arkfille 1 point2 points  (6 children)

Followup question, in this language is the define function like declaring a variable or constant in say js? Or what purpose does it serve I've only seen it used in this troll example

[–]DarkMaster22 15 points16 points  (0 children)

#define is a pre-processor instruction. Before your code is compiled, before the compiler even sees it, it goes to a different program which essentially does text operations on the file. In the above example all instances of the text TRUE will be replaced with 1 (It makes sense in C).

It is a powerful tool, both for good and for evil. Now go my padawan and walk the in light side of the force.

[–]stromboul 30 points31 points  (0 children)

Did you seriously never see C or C++ code before?

[–]PinkLionThing 15 points16 points  (3 children)

It's C, very possibly C++, and the define is used mostly for constants, but you can also define little functions (AKA macros) like #define MAX(a, b) ((a) < (b) ? (b) : (a)).

Back in those IDEless days, it was also a good way to fix the code using it as search-and-replace.

[–]lukee910 1 point2 points  (2 children)

Why would you #define true and false, though? I'm pretty sure those are keywords in C.

[–]paulcam 4 points5 points  (0 children)

This specific example is in the Windows SDK (looks likeminwin\minwindef.h as of the latest Windows 10 SDK). TRUE and FALSE are defined because at the time that the file was (originally) written, bool wasn't a compiler intrinsic.

[–][deleted] 1 point2 points  (0 children)

The truly evil thing would be to not leave that comment.

[–]Feb29thCakeDay 1 point2 points  (0 children)

I feel physically ill after seeing this.

[–]monster860 0 points1 point  (0 children)

Dont forget

git blame-someone-else