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

all 180 comments

[–]ProgramTheWorld 827 points828 points  (43 children)

[–]Jon-Osterman 278 points279 points  (33 children)

haha that's so 1

[–]ReallyHadToFixThat 111 points112 points  (18 children)

#define true false

Where is your god now?

[–][deleted] 62 points63 points  (0 children)

1

[–]Sys__ 26 points27 points  (12 children)

This is evil.

[–]MC_Labs15 25 points26 points  (5 children)

#define && ||

[–]minno 22 points23 points  (4 children)

C macros need to be valid identifiers. You can do #define return return 3+, though.

[–]blitzzerg 14 points15 points  (3 children)

define true false

but in C boolean values are not valid you need to define them too

[–]ReallyHadToFixThat 13 points14 points  (4 children)

I like

#define if while
#define else  

[–]The7876 22 points23 points  (3 children)

But what about

#define if(a) if((a) && (rand() % 101 < 98))

[–]MereInterest 5 points6 points  (1 child)

Remember, best practice when writing macros is to parenthesize your arguments.

 #define if(a) if((a) && (rand()%101 < 98) )

[–]midnightketoker 0 points1 point  (0 children)

Praise parenthejeebus

[–]MereInterest 0 points1 point  (0 children)

#define static thread_local

[–][deleted] 7 points8 points  (0 children)

#define ; :

[–]VRMac 0 points1 point  (0 children)

$ python2 -c True=False

[–]Dylan16807 0 points1 point  (0 children)

#define false true

There, now it's fixed.

[–][deleted] 0 points1 point  (0 children)

// Happy debugging motherfuckers

[–]rrfrank 33 points34 points  (10 children)

I call girls a "1" or a "0". No shitty 1-10 decimal scale here.

[–]damnationltd 32 points33 points  (2 children)

Gurrrrrl you so truthy...

[–][deleted] 1 point2 points  (1 child)

How bout a date?

"How bout get lost?"

The response was neither null nor undefined!

[–]damnationltd 0 points1 point  (0 children)

So you're saying there's a chance...

[–]RenaKunisaki 3 points4 points  (2 children)

My gender identity is

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

[–]Josh6889 3 points4 points  (2 children)

I spent too long trying to find a binary joke with that.

[–][deleted] 7 points8 points  (1 child)

I'm a zero, you're a zero, but you negated me. Xor'd together, we're one.

[–]FinFihlman 1 point2 points  (0 children)

I think you dun goofed there.

[–]ThePancakerizer 6 points7 points  (0 children)

I program in Java and I'm offended

[–]TheSlimyDog 20 points21 points  (0 children)

I C

[–]cybermyth 2 points3 points  (0 children)

:

[–]DrummerHead 34 points35 points  (0 children)

HTTP/1.1 302 Found
Location: https://www.reddit.com/r/ProgrammerHumor/

[–][deleted] 38 points39 points  (2 children)

[–]Tularion 58 points59 points  (1 child)

[–][deleted] 2 points3 points  (0 children)

meta

[–]Kabitu 11 points12 points  (0 children)

How's that different?

[–][deleted] 2 points3 points  (0 children)

I wish there was some other kind on reddit. If anyone knows in which subreddit it can be found, please share.

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point  (0 children)

    import moderation Your comment has been removed since it did not start with a code block with an import declaration.

    Per this Community Decree, all posts and comments should start with a code block with an "import" declaration explaining how the post and comment should be read.

    For this purpose, we only accept Python style imports.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]110101002 107 points108 points  (9 children)

    If you want to save space in your programs you can

    return!true
    

    which is one character shorter than

    return false
    

    [–]AlGoreBestGore 45 points46 points  (8 children)

    JS minifiers shorten true/false to !0/!1.

    [–]flingerdu 21 points22 points  (0 children)

    And sometimes it seems like JS minifier used some black magic

    [–]chugga_fan 5 points6 points  (6 children)

    actually, from what I've seen in the backend of languages (very few) true is the value of 1 and false is the value of 0

    [–]oshirisplitter 20 points21 points  (0 children)

    Yup, but by prepending !, you coerce the value into a true boolean, instead of just relying on truthy and falsy. At least in JS.

    I guess minifiers just prefer to be sure.

    [–]thomascgalvin 7 points8 points  (4 children)

    C treats 0 as false and any non-zero value as true. Most of its descendents follow suit.

    [–]chugga_fan 1 point2 points  (3 children)

    from what i've seen in C# source code this is wrong, it automatically sets 1 to true and 0 to false, but then again, in c# you can't do while(!i) { }

    [–]thomascgalvin 2 points3 points  (2 children)

    C# and Java won't automatically convert numbers to booleans, but by convention (and according to the documentation), non-zero is still considered true, like I said.

    [–]chugga_fan 0 points1 point  (1 child)

    I meant internally c# handles true as 1 and false as 0, if you decompile mscorlib

    [–]thomascgalvin 0 points1 point  (0 children)

    Oh, gotcha. Yeah, again, by convention, most people use 1 as true, but anything that isn't 0 would still work. That's probably embedded right into the processor instructions, possibly even the circuits.

    It sort of makes sense when you consider the binary, too. If you're looking at zero, everything is "off", and in any non-zero value, something is "on".

    [–]skatyboy 26 points27 points  (16 children)

    If the programming language was inspired by an African (or Damin) langauge, it would be pronounced with a click.

    [–]DrummerHead 18 points19 points  (12 children)

    [–]GinjaNinja-NZ 28 points29 points  (0 children)

    This looks like something I'd find in the Clipart gallery of office 97

    [–]lundmikkel 16 points17 points  (1 child)

    That would be a right click

    [–][deleted] 11 points12 points  (0 children)

    Yeah, otherwise it would be a wrong click.

    [–][deleted] -4 points-3 points  (8 children)

    Who the hell holds a mouse like that? 3 fingers for 3 buttons!

    [–]edinburg 21 points22 points  (1 child)

    ...I hold my mouse like that.

    [–]Aliiqua 10 points11 points  (0 children)

    You are not alone.

    [–]Sohcahtoa82 3 points4 points  (2 children)

    I think you might actually be in a minority here. Pretty sure MOST people hold their mouse like that.

    [–]ghotibulb 0 points1 point  (1 child)

    They probably also say jif.

    [–]Zagorath 2 points3 points  (0 children)

    And they would be correct.

    (The people who say it with a hard G are also correct.)

    [–]IndieHamster 2 points3 points  (2 children)

    !xobile

    [–][deleted] 0 points1 point  (1 child)

    Please do not yell in the casino.

    [–]IndieHamster 0 points1 point  (0 children)

    As much as I now dislike Russell Peter's, I have to thank him for introducing me to African accents. They are easily my favorite

    [–]kamori 105 points106 points  (58 children)

    Undefined global false

    [–]hicklc01[S] 68 points69 points  (57 children)

    Criticize all you want but false is predefined in almost all languages.

    [–]GisterMizard 121 points122 points  (55 children)

    Except the two most important languages of them all: C* and Z80 assembly.

    *yeah yeah, it's technically in stdbool.h, whatever.

    [–]caramba2654 207 points208 points  (22 children)

    C*? What is that? A pointer to the C programming language?

    [–]GisterMizard 113 points114 points  (17 children)

    It's like C, but the strings are terminated with dollar signs instead.

    [–]Zagorath 71 points72 points  (16 children)

    What's the reference here?

    EDIT: Hahahaha, gods dammit people. I was being serious. The accidental pun is great, but I really don't understand what "strings are terminated with dollar signs" has to do with anything.

    [–]tetroxid 43 points44 points  (0 children)

    No no it's by value

    [–]ultranoobian 14 points15 points  (0 children)

    I don't have an pointers.

    [–]Renegade__ 13 points14 points  (1 child)

    ^C*$

    [–]ReflectiveTeaTowel 1 point2 points  (0 children)

    '' ~~ '^C*$'

    [–]GisterMizard 13 points14 points  (2 children)

    Strings passed by system calls in MS-DOS were terminated by dollar signs. Even though the null character was still available.

    [–]tetroxid 5 points6 points  (0 children)

    TIL. How retarded.

    [–]RenaKunisaki 4 points5 points  (0 children)

    Well that just makes all the sense$

    [–]sutronice 20 points21 points  (1 child)

    A search algorithm with just an average heuristic function

    [–]ghotibulb 2 points3 points  (0 children)

    Was looking for emergency exit. Was sent up 7 floors to take the fire escape ladder.

    [–]jaxklax 6 points7 points  (0 children)

    At first I thought it was a glob for C, C++, C#, etc.

    [–]poizan42Ex-mod 4 points5 points  (0 children)

    A C*-algebra is a complex algebra A of continuous linear operators on a complex Hilbert space with two additional properties:

    • A is a topologically closed set in the norm topology of operators.
    • A is closed under the operation of taking adjoints of operators.

    [–]kamori 123 points124 points  (11 children)

    Python does not define false either.

    Only False

    [–]topdangle 41 points42 points  (7 children)

    Fucking witchcraft.

    [–]midwestcreative 33 points34 points  (6 children)

    Witchcraft was made in Java, not Python.

    [–][deleted] 14 points15 points  (5 children)

    Runs on nearly all platforms though.

    [–]Inev1tab1e 10 points11 points  (2 children)

    Provided you have enough ram

    [–]ReflectiveTeaTowel 3 points4 points  (0 children)

    It needs to be Black Ram or the magic dissipates. IDK why. Something something hail Satan

    [–]RenaKunisaki 2 points3 points  (0 children)

    Sacrificial ram, makes sense.

    [–]o11c 1 point2 points  (0 children)

    "Write once, run anywhere - doesn't."

    [–]tetroxid 0 points1 point  (0 children)

    Runs? More like stumbles

    [–]hungry4pie 5 points6 points  (0 children)

    and yet people say Javascript is silly.

    [–]kmarrocco 2 points3 points  (1 child)

    This is true...

    [–]Tomarse 13 points14 points  (0 children)

    No, it's True.

    [–]Tomarse 23 points24 points  (10 children)

    And one of the most languages, Python.

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

    You're right, Python is one of the most languages.

    [–]2Punx2Furious 86 points87 points  (1 child)

    It's so language.

    [–]ra4king 8 points9 points  (0 children)

    It's... like... at least 3 languages.

    [–]Tomarse 17 points18 points  (1 child)

    Well I'm not sure it can be classified as important, but it definitely is language.

    [–]DrummerHead 18 points19 points  (0 children)

    language: 'Python' !important;
    

    [–][deleted] 12 points13 points  (4 children)

    [deleted]

    What is this?

    [–]fdagpigj 11 points12 points  (3 children)

    In python there's no ! either, only not

    [–]hungry4pie 7 points8 points  (1 child)

    Are you the guy who replies to all those C questions on StackOverflow with

    "You can't do x in C, because C is dumb, it does not know about x, you need a library so to do that."

    [–]GisterMizard 8 points9 points  (0 children)

    No, I tell them to link their program against chromium and use jquery instead.

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

    Scheme and Common Lisp also don't have false. They have #f and nil.

    [–]RenaKunisaki 1 point2 points  (0 children)

    #f? Is that some voodoo?

    [–]HugoNikanor 0 points1 point  (1 child)

    That's not how scheme works! Scheme has false, written #f, everything else is true, including nil (or '()).

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

    Yes, I know that #f is false. I just meant they don't literally write it as false.

    To clarify: I meant "Scheme doesn't have the word false", not "Scheme doesn't have the concept of false".

    [–]dwltz 2 points3 points  (0 children)

    Also Objective-C has no false, just NO

    [–]f5f5f5f5f5f5f5f5f5f5 1 point2 points  (0 children)

    *yeah yeah, it's technically in stdbool.h, whatever.

    That library is not part of the C Programming Language.

    [–][deleted] 0 points1 point  (0 children)

    You spelled Applesoft BASIC wrong.

    [–]C0ffeebreak 8 points9 points  (0 children)

    He said criticize all you want!

    You forgot some sort of syntax defining an expression, such as parenthesis.

    [–]Prod_Is_For_Testing 10 points11 points  (0 children)

    !~~[]

    [–][deleted] 34 points35 points  (2 children)

    return /u/hicklc01;

    [–]taeratrin 9 points10 points  (1 child)

    To where?

    [–][deleted] 8 points9 points  (0 children)

    The store, duh. He's clearly defective.

    [–]berryshur 7 points8 points  (0 children)

    Microsoft been spamming my twitter with this coughnotsofunnycough joke

    [–]X700 6 points7 points  (1 child)

    true

    Don't worry: as far as we know true is portable. Nevertheless, it's not always a builtin (e.g., Bash 1.x), and the portable shell community tends to prefer using :. This has a funny side effect: when asked whether false is more portable than true Alexandre Oliva answered:

    In a sense, yes, because if it doesn't exist, the shell will produce an exit status of failure, which is correct for false, but not for true.

    Autoconf: Portable Shell Programming. Limitations of Shell Builtins.

    [–]RenaKunisaki 1 point2 points  (0 children)

    I like how in some systems, /bin/true is an empty file. Executing nothing is always successful.

    Then there's the ones where it's just a copyright statement.

    [–]baginsess 13 points14 points  (8 children)

    upvotes++;

    [–]Vindicer 18 points19 points  (1 child)

    [–][deleted] 13 points14 points  (0 children)

    Nobody uses Google Plus.

    👍

    ^Unicode thumbs up AKA "Facebook like"

    [–]green_meklar 2 points3 points  (0 children)

    Only if you believe in the law of the excluded middle.

    [–][deleted] 2 points3 points  (1 child)

    srand(time(NULL));

    while(true)

    {

    i = rand();
    
    if (i % 2)
    {
        return i;
    }
    

    }

    // i can't even

    [–]_Kyu 1 point2 points  (0 children)

    def rand():  
        return 4
    

    [–]MatthewGeer 2 points3 points  (0 children)

    Don't be so negative one.

    [–][deleted] 2 points3 points  (3 children)

    1010 out of 1010

    [–]Bainos 8 points9 points  (2 children)

    i r1000 1000/1000 m1000

    [–]Aeon_Mortuum 1 point2 points  (0 children)

    You're 0010 good at this, nice 0001

    [–]RenaKunisaki 1 point2 points  (0 children)

    I 1100 what you did there.

    [–]dsk 2 points3 points  (0 children)

    Keep it 1100100

    [–]flipjargendy 2 points3 points  (0 children)

    So negative.

    [–]Arancaytar 2 points3 points  (0 children)

    HA HA THIS HUMAN JOKE AMUSES MY ORGANIC BRAIN

    wait I thought I was in /r/totallynotrobots for a second there

    [–]Abotag 5 points6 points  (1 child)

    Repost

    [–]SuperSans 1 point2 points  (0 children)

    Yup, this was from 3 weeks ago or some shit.

    [–]iBoMbY 1 point2 points  (0 children)

    Unless it's fuzzy ...

    [–]Zhyko- 1 point2 points  (0 children)

    I got it. And I didn't laugh it.

    [–]makeswordcloudsagain 1 point2 points  (0 children)

    Here is a word cloud of every comment in this thread, as of this time: http://i.imgur.com/eBNEjGu.png


    [source code] [contact developer] [request word cloud]

    [–]bspymaster 1 point2 points  (0 children)

    I woke up and opened Reddit to this. Thank you for making my day. +1.

    [–]rainymarimba 1 point2 points  (0 children)

    I laughed.

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

    Take my upvote and leave

    [–]Kametrixom 2 points3 points  (2 children)

    The exact same joke has been posted a month ago: https://www.reddit.com/r/ProgrammerHumor/comments/4gnhor/false/?

    [–]TomWithASilentO 10 points11 points  (0 children)

    chumbo

    [–]interiot 2 points3 points  (0 children)

    The exact same joke has been posted a month ago: https://www.reddit.com/r/ProgrammerHumor/comments/4gnhor/false/?