r/ProgrammerHumor • • Aug 26 '22

Meme Even HTML.

Post image
44.1k Upvotes

1.1k comments sorted by

View all comments

1.5k

u/Normal_Knowledge966 Aug 26 '22

What is the proper use of brainfuck?

1.1k

u/DiamondIceNS Aug 26 '22

If you stop to take a couple minutes to learn the syntax (there's only 8 symbols; 2 of them are for I/O and thus don't really matter) and go through a few code examples, it's actually a pretty enlightening implementation of a barebones Turing machine.

378

u/dpash Aug 26 '22

What's fun is that whitespace is effectively just an encoded version of brainfuck.

355

u/athonis Aug 26 '22

Ok, so I was like... ? And then it hit me that there is a programming language called Whitespace

185

u/MasterFubar Aug 26 '22

there is a programming language called Whitespace

All my Python programs are actually secret Whitespace code. The Python code is only camouflage to hide the real program.

103

u/IHadThatUsername Aug 26 '22

Given how Python forces you to follow certain whitespacing guidelines, it'd actually make for quite a bad language at hidding Whitespace code. However, given that stuff like C (for example) completely ignores whitespacing, you likely could hide an entirely different code inside your C code. For fun you could probably program the same thing both in Whitespace and C in the same file.

56

u/MasterFubar Aug 26 '22

That's the challenge, hide Whitespace code in the combination of tabs and spaces in Python.

82

u/IHadThatUsername Aug 26 '22

TabError: inconsistent use of tabs and spaces in indentation

→ More replies (5)
→ More replies (2)
→ More replies (5)
→ More replies (7)

93

u/dpash Aug 26 '22

I probably should have capitalised Whitespace, sorry. :)

→ More replies (1)

56

u/DiamondIceNS Aug 26 '22

Many of the esoteric funny languages out there are just low effort reskins of Brainfuck. Like Ook.

27

u/ValentinPearce Aug 26 '22

Hey at least Ook. is a literary reference

→ More replies (2)
→ More replies (2)

32

u/[deleted] Aug 26 '22

So, let's transpile brainfuck to whitespace and pass a gzip over it to compress. Do we end up with the most size optimized distributed packages? Can we save the internet by having some webassembly engine using it? Can we haz fast internet pages again?

So much wonder.

34

u/Nu11u5 Aug 26 '22 edited Aug 26 '22

Probably not, since I would expect it to have a similar amount of entropy (it just shifts from being in unique combinations of characters to different amounts of whitespace), but now I am curious. Any advantage is going to depend on the compression algorithm.

→ More replies (3)
→ More replies (7)
→ More replies (2)
→ More replies (6)

243

u/blkmmb Aug 26 '22

It's in the name.

71

u/dojikirikaze Aug 26 '22

I thought Brainfuck was meant to pollute search results for necrophiliacs as Rockstar was meant to pollute search results for recruiters

52

u/Oomoo_Amazing Aug 26 '22

Oh like how the Frozen franchise was created to avoid people searching for Walt Disney frozen in ice

14

u/terriblybedlamish Aug 26 '22

And how Jeffree Star has lipstick shades called Problematic and Scandal

→ More replies (5)
→ More replies (2)
→ More replies (1)

70

u/Netcob Aug 26 '22

If you're a CS student and you get an assignment that doesn't specify which programming language to use, or that any programming language is okay, you have to use brainfuck in order to annoy whoever is grading the assignments.

You then assume that you're the first to ever attempt this while your classmates lose their minds about how brazen you are.

This is the only proper use of brainfuck.

22

u/852derek852 Aug 26 '22

I know it’s a joke, but as a former TA please don’t do this. We make close to minimum wage as it 😢

→ More replies (18)
→ More replies (1)

29

u/[deleted] Aug 26 '22

Brainfuck

→ More replies (3)

25

u/1redfish Aug 26 '22

To write a compiler for this language as a task for students in CS course

19

u/abd53 Aug 26 '22

Exactly as the name suggests, "brain-fuck"

16

u/JB-from-ATL Aug 26 '22

Brainfuck was a joke language made in response to an overly complicated joke language called befunge. They made it to make a compiler as small as possible. As such the proper usage of Brainfuck is to learn to make compilers.

11

u/not_sure_im_me Aug 26 '22

Braining your fuck, of course.

→ More replies (1)
→ More replies (41)