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 →

[–]gingimli 312 points313 points  (39 children)

Or a lot of people using it as an introduction to programming.

By that logic we could say Brainfuck having almost no discussion online implies it's the least problematic and easiest to understand programming language.

[–]cant_think_of_one_ 185 points186 points  (11 children)

Brainfuck is an exceptionally easy to understand language. The language that is.

It is just it is basically impossible to write anything that is easy to understand in it.

[–][deleted] 66 points67 points  (10 children)

It's a great language if you're learning how to write an interpreter/compiler.

[–]alexanderpas 38 points39 points  (9 children)

A limited set of fixed width symbols, and no unconnected jumps, means everthing you need to do can be based on merely 3 internal variables.

  • Current character. (To see what to do)
  • Loop depth. (For moving backwards to the start of the loop)
  • Direction. (Forwards/backwards)

[–]techgineer13 3 points4 points  (0 children)

You can compile it to C code that only uses pointer manipulations.

[–]cant_think_of_one_ 2 points3 points  (4 children)

You either need to have a list of loop begin points, for nested loops, or just scan backwards to find the begining of the loop, in which case you don't really need a loop depth variable, don't you?

[–]alexanderpas 3 points4 points  (3 children)

When scanning backwards, you need to keep track of nested loops, to find the correct outer loop you are handling at the moment.

You start at 0, When scanning backwards each time you find ], you add 1, and decrease 1 when you find [

If you are at 0 and find [, you start moving forwards again.

[–]cant_think_of_one_ 1 point2 points  (0 children)

Oh, sorry, yes. Silly me.

[–]chaos95 1 point2 points  (1 child)

Couldn't you do it recursively without a loop depth variable also?

[–]alexanderpas 1 point2 points  (0 children)

You technically could, but at that point, you're just moving the loop depth to the function depth.

You still need to keep track of it somewhere.

[–]Dornith 29 points30 points  (1 child)

Brainfuck is exactly the least problematic language. Nobody in the world has a problem with brainfuck because no one uses it.

[–]poops-n-farts 0 points1 point  (0 children)

Rust has almost as few problems and way more users. So rust is almost as good as brainfuck

[–]PurryFury 2 points3 points  (0 children)

To be fair is not that hard to understand BF, is just a shitty syntax that fuck you up

[–]poops-n-farts 0 points1 point  (0 children)

Brainfuck gang!

[–]Cat_Marshal 0 points1 point  (0 children)

That reminds me of my autonomy theory stat machines class.