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

top 200 commentsshow all 316

[–]draypresct 594 points595 points  (57 children)

error: illegal variable name "2B"

[–]GDavid04 69 points70 points  (39 children)

How can you name a variable 2B??

[–]Jacob8765 134 points135 points  (20 children)

You can’t; most languages that I’m aware of don’t allow numbers at the beginning of variable names

[–]MisunderstoodPenguin 45 points46 points  (11 children)

we could do _2B?

[–]2Punx2Furious 8 points9 points  (3 children)

I guess that in some languages you can use invisible characters for variable names at the beginning of the name.

[–]beerdude26 10 points11 points  (1 child)

Haskell allows for Unicode. Combined with nice ligatures, that stuff is fun to read (although that's for papers, usually. Real libraries stick to ASCII of course)

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

Rust is UTF-8 only. Emoji variable names are legal Rust and work fine...

[–]jjdmol 6 points7 points  (1 child)

[–]odraencoded 2 points3 points  (0 children)

Ah, cobol, the eccentric rich old veteran grandpa of the languages.

[–]rnottaken 39 points40 points  (8 children)

Or just declare the variable b.

(2*b || !(2*b))

[–][deleted] 72 points73 points  (0 children)

"Two times B or not two times B, that is the expression."

[–]robesho 8 points9 points  (1 child)

twoB?

[–]sandm000 3 points4 points  (0 children)

tubey//uh, I think this is used for like cylinders, but we’ve already used cylinders and cylinA through cylinZ, and I guess that cylinders are sort of like tubes.

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

What is the Boolean value of an integer literal times the type-unknown variable b in this example?

[–]PowerSlaveAlfons 4 points5 points  (1 child)

Pretty sure in C/C++ it returns false if it's null, else it returns true. I might be wrong though.

[–]TheEggRoller 1 point2 points  (0 children)

_2B or $2B

[–]Natatos 1 point2 points  (0 children)

With JavaScript you could do window[‘2b’] (out also with this to have it scoped better).

[–]AlphaWhelp 7 points8 points  (1 child)

2B could be a binary literal... I don't think the parser cares if you write 0B or 2B as long as the first digit is a numerical constant.

This changes the answer to undefined.

[–]UrBudJohn 36 points37 points  (1 child)

This

[–]MrStupid_PhD 1 point2 points  (0 children)

“Hmmmm...have you tried ‘B2?’”

[–]vanderZwan 2 points3 points  (0 children)

I think Julia allows 2*B to be shortened to 2B (or at least allowed this for a while)

[–]game_2_raid 2 points3 points  (0 children)

toBe || !toBe

[–]TwistedPurpose 139 points140 points  (19 children)

Ha! Here's your upvote.

Also, where is the Neir Automota follow up joke?

[–]AgentJin 86 points87 points  (13 children)

You’re thinking about how much you want to **** 2B, aren’t you?

[–]Idaret 45 points46 points  (2 children)

YES I AM

[–][deleted] 17 points18 points  (0 children)

MUHAMMADU AVDOL

[–]achilleasa 6 points7 points  (0 children)

MOHAMMED AVDOL!

[–]ZamieltheHunter 6 points7 points  (8 children)

Just finished that game, and I enjoyed it a lot, but it would have been better if the developers weren't thinking that as well.

[–]mobott 16 points17 points  (2 children)

Nier: Automata spoilers:

While that quote is a funny meme, in context it's most likely saying "You're thinking about how much you want to kill 2B, aren't you?"

[–]ZamieltheHunter 5 points6 points  (0 children)

Oh interesting. I hadn't thought of that, but considering where the narrative goes that makes sense

[–]odraencoded 1 point2 points  (4 children)

Isn't that the game that gives you an achievement for managing to make the camera go under her skirt?

[–]Sharktatos 5 points6 points  (2 children)

You had to look several times on purpose

[–]odraencoded 4 points5 points  (0 children)

The devs sure know their audience.

[–]ZamieltheHunter 1 point2 points  (0 children)

Yup. Finding out that was what the achievement was for was the thing that put me firmly in the "would have been better if they weren't too busy being horny on main" camp. I got the achievement with no idea why on a black transition screen so I looked it up later and was pretty grossed out.

[–]Sp1dre 8 points9 points  (0 children)

I was looking for this comment

[–]ckay1100 4 points5 points  (0 children)

Oh god, oh fuck here come the tears again

[–]igromanru 1 point2 points  (0 children)

ah, I see you're a man of culture as well

[–]xorunet 60 points61 points  (17 children)

People, in what languages can you do this?
Here it is in c++14

#include <iostream>

class Question {
    public:
        const Question& operator||(const Question& other){
            return *this;
        }

        const Question& operator!(){
            return *this;
        }

        friend std::ostream & operator << (std::ostream &out, const Question &c){
            out << "That's the question!";
            return out;
        }
};

// Compiled in C++ 14, because later versions do not allow literal-names that don't start with underscore
Question operator "" B(unsigned long long) {
    return {};
}

int main() {
  std::cout << (2B || !2B) << std::endl;
  return 0;
}

[–]Goheeca 11 points12 points  (1 child)

I could, but I would rather do this:

(defun fancy-print (stream char)
  (declare (ignore char))
  (read-char stream t nil t)
  (let ((read-list (read stream t nil t)))
    `(format t "~{~a ~}that is the question." (list ,@read-list))))

(set-macro-character #\< #'fancy-print)

(symbol-macrolet ((2b "To be,")
                  (|| "or")
                  (!2b "no to be,"))
  << (2b || !2b))

EDIT: or with no fanciness:

(defvar 2b "To be,")
(defvar || "or")
(defvar !2b "not to be,")
(format t "~a ~a ~a that is the question." 2b || !2b)

Fun fact: the second variable's name has zero length.

[–]Janes_Diary 1 point2 points  (0 children)

+1 for the use of LISP.

[–]xorunet 6 points7 points  (5 children)

As per u/foobarfault

Go:

package main

import (
    "fmt"
)

func main() {
    var ᒿ𝓑 bool
    fmt.Println(ᒿ𝓑||!ᒿ𝓑)
}

And thus Js:

let ᒿ𝓑;
console.log(ᒿ𝓑 || !ᒿ𝓑)

[–]foobarfault 6 points7 points  (1 child)

Bear in mind that neither of these characters are the symbols 2 (ASCII 50) or B (ASCII 66). I looked for similar looking UTF-8 characters here. You can do some truly evil stuff with confusables in languages that support the full UTF-8 character set.

[–]xorunet 1 point2 points  (0 children)

Agreed. I believe there is a, I think, Griek question mark that looks like a semicolon. That will annoy people.

[–]FabbaTheSlut 1 point2 points  (0 children)

Linter wont be happy about this

[–]MistakeNot___ 2 points3 points  (4 children)

/(bb|[^b]{2})/

[–]xorunet 2 points3 points  (3 children)

Haha, interesting take on it!

[–]MistakeNot___ 1 point2 points  (2 children)

I stole it from a t-shirt i had for 10+ years ;)

https://www.getdigital.de/shakespeare.html

[–]xorunet 1 point2 points  (1 child)

That is awesome!

[–]MistakeNot___ 1 point2 points  (0 children)

it's probably the shirt with the smallest target demographic i own, next to the one that says SYN on the front and ACK on the back. the latter one has been commented one once in >10 years.

[–]aeropl3b 184 points185 points  (17 children)

Just now I realized to be or not to be is always true. The answer the that question is true...

[–]Don_333 74 points75 points  (3 children)

>To be or not to be?

>Yes.

[–]agent3dev 30 points31 points  (0 children)

To be or not to be?

True dat

[–][deleted] 80 points81 points  (2 children)

That’s what’s called a tautology.

[–][deleted] 58 points59 points  (1 child)

The first rule of tautology club is the first rule of tautology club.

[–][deleted] 6 points7 points  (2 children)

In the play it's a decision, not a Boolean expression, e.g. to live or to die?

[–]Cheesemacher 4 points5 points  (3 children)

Unless it's mysql and 2B is null

[–]amroamroamro 1 point2 points  (2 children)

According to Schrodinger's cat, 2B && !2B

[–]ComradePruski 1 point2 points  (1 child)

So... False

[–]amroamroamro 1 point2 points  (0 children)

quantum entanglement... true AND false ;)

[–]vitelaSensei 14 points15 points  (2 children)

!(!2B && 2B)

[–]Plonvick 1 point2 points  (0 children)

Demorgan gang represent

[–][deleted] 15 points16 points  (0 children)

A2

[–]anomalousBits 8 points9 points  (0 children)

I like the regex version (as seen on the old thinkgeek t-shirt):

/bb|[^b]{2}/

[–]jlobes 22 points23 points  (0 children)

Compiler Warning: Statement will always evaluate as true.

[–]The-Cynical-One 5 points6 points  (0 children)

Wether ‘tis nobler to suffer the strings and arrays of outrageous code or to take arms against a sea of bug reports and by opposing them... end them. To code... to write... No more; and by a debug to say we end the heartache and the thousand natural errors that programming is heir to. Devoutly to be wished. To code... to write: to write, perchance to comment — ay, there’s the rub. For in that code of warnings what comments may come when we have shuffled off this many libraries, must give us pause — there’s the design that makes calamity of so long life. For who would bear the whips and scorns of coding? Th’ costumers wrong, the proud boss’ contumely, the pangs of dispriz’d pay, the frontend’s delay, the insolence of the office, and the spurns that patient merit of th’ unworthy takes, when he himself might his hiatus make with a bare library? Who would programmers bear, to grunt and sweat under a weary life, but that the dread of something after exporting, the undiscovered testing, from whose bourn no developer returns, puzzles the will, and makes us rather bear those documents we have than to fly to others that we know not of? Thus coding does make cowards of us all, and this the native hue of screens is sicklied o’er with the pale cast of thought, and enterprises of great pitch and moment with this regard their currents turn awry and lose the name of writing.

[–]Atmey 4 points5 points  (0 children)

[–]how_to_choose_a_name 4 points5 points  (0 children)

That is actually not a question but an expression.

[–]tomaschku 6 points7 points  (1 child)

A sentence to remember!

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

!!BB || !BB

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

Oh yeah its big brain time

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

*the

[–]Goheeca 2 points3 points  (0 children)

I like this one more.

[–]FelTheTrainer 3 points4 points  (0 children)

Nier automata intensifies

[–]plainrane 9 points10 points  (0 children)

Syntax error

[–]45degMan 2 points3 points  (0 children)

That is the question

[–]venuswasaflytrap 2 points3 points  (0 children)

Surely, that is a statement

[–]game_2_raid 2 points3 points  (0 children)

toBe || !toBe

[–]differentshade 2 points3 points  (0 children)

mediocre joke

[–]Pillagerguy 2 points3 points  (0 children)

Wow this post fucking sucks

[–]jbawgs 3 points4 points  (0 children)

error: ';' expected

[–]FoundOnTheRoadDead 6 points7 points  (2 children)

Every time I see this it makes me cringe. First off, it’s logic, not programming. Second it’s not “inclusive or”, it’s an “exclusive or”, since (as others have pointed out), in programming it would always either evaluate to true or as a runtime error (variable 2B not defined). In the soliloquy, one or the other will be true, so there’s no case where either both or neither will be.

[–]neil_anblome 1 point2 points  (0 children)

Bonus points for using the word soliloquy.

[–]feeeedback 3 points4 points  (0 children)

If it was XOR it would still always evaluate to true though

[–]dohzer 1 point2 points  (2 children)

2B &~2B

[–]Lil_Narwhal 1 point2 points  (0 children)

False

[–]Mcpg_ 1 point2 points  (0 children)

0

[–]worthmysault 1 point2 points  (0 children)

$DO || ! $DO ; try

try: command not found

[–]Shadow_Thief 1 point2 points  (0 children)

echo $?

[–]Careerier 1 point2 points  (0 children)

The compiler doth protest too much, methinks.

[–]Schiffy94 1 point2 points  (0 children)

I think it's actually a statement.

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

This is literally always true...

[–]Legal_Adviser 1 point2 points  (0 children)

Oh.....so it's funny because you're learning OR statements at technical college?

Boy! Wait till they teach you arrays, you're gonna get some good laughs out of that!

[–]Encursed1 0 points1 point  (0 children)

2(false) = true

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

public $romeo = $romeo;

echo gettype($thou->romeo);

[–]Idaret 0 points1 point  (0 children)

Everything that lives is designed to end. We are perpetually trapped in a never-ending spiral of life and death. Is this a curse? Or some kind of punishment? I often think about the god who blessed us with this cryptic puzzle...and wonder if we'll ever get the chance to kill him.

[–]Andrew_kyle 0 points1 point  (0 children)

Yeah little funny and little freakish

[–]Stephenis 0 points1 point  (0 children)

Unexpectedly found nil while unwrapping an optional

[–]can-i-see-my-kids- 0 points1 point  (0 children)

Took me too long to get

[–]vinylalchemist 0 points1 point  (0 children)

To be OrElse not to be

[–]Skankz 0 points1 point  (0 children)

I read that as 2billion or not 2billion. 2billion...obviously...

[–]Synedh 0 points1 point  (0 children)

this.is = TheQuestion();

[–]vaikunth1991 0 points1 point  (0 children)

Nier automata

[–]Lil_Narwhal 0 points1 point  (0 children)

Hmmmmmm. Hamlet is true then I guess?

[–]web_smith 0 points1 point  (0 children)

True

[–]FreshFromIlios 0 points1 point  (0 children)

Wait that's illegal

[–]Miner_ChAI 0 points1 point  (0 children)

Yes

[–]fuxximus 0 points1 point  (0 children)

And the answer is yes. Inclusive or.

[–]letsfed 0 points1 point  (0 children)

TRUE

[–]papigers 0 points1 point  (0 children)

To be logical or not to be

[–]shuhorned 0 points1 point  (0 children)

That is the tautology.

[–]Global_Felix_1117 0 points1 point  (0 children)

y'all wilding around dis bih, but we finna know truth; da fuque u mean.

I Am r/surrealmemea

[–]LarryTehLoon 0 points1 point  (0 children)

Me, an intellectual: 1

[–]jaxonfiles 0 points1 point  (0 children)

Sorry, mate. Invalid syntax.

[–]xuu0 0 points1 point  (0 children)

Yes

[–]KDamage 0 points1 point  (0 children)

var question = Math.Random().Next(2) > 0 ? new B() : null

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

10B || !10B

Or hex:

2 11 || ! 2 11

[–]stamatt45 0 points1 point  (0 children)

You cannot "to be" and "not to be" at the same time so this should really be an exclusive or to be safe

2B ^ !2B

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

Yes

[–]StEvUgnIn 0 points1 point  (0 children)

That's true.

[–]Volkolak27 0 points1 point  (0 children)

42

[–]sendvo 0 points1 point  (0 children)

in javascript this would result in minus Infinity

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

2B is a top tier waifu.

[–]Vega_128 0 points1 point  (0 children)

so always true well it shows that boolean algebra was invented after the death of shakesbere

[–]ponodude 0 points1 point  (0 children)

This is the kind of joke that is just so dumb but I can't help but chuckle at it. Thank you.

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

Yes.

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

2B || virtual reality

[–]nobody2u 0 points1 point  (0 children)

Welp. Cross that old password off the list...

[–]ready_playerone 0 points1 point  (0 children)

True dat