Why is this allowed?

Why is this allowed?

done
done
fi
;;
esac
fi
fi
done
fi

)))))))

what's wrong? it just werks

It's not bad yet. Still almost understandable.

>doing this
>not just writing print "}*7"

Was finishing up a group uni project the day before the deadline this week, wrote this: ()));});

Python doesn't have this problem :^)

But it does unless you're not defining anything and not using any loops within loops.

FUCK YOU! FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU FUCK YOU!

I haven't done any programming in years, but wouldn't that just write to the terminal should the loop before it be closed? That's another function, it doesn't close loops, right? At least if it's C++.

Fucking millenials

Move some of the code into separate methods

Python doesn't have curly brackets around code blocks.
So no, Python really does not have this "problem".

Nice font rendering though

Instead of doing
if (x) {
do_something();
if (y) {
do_sth_else();
}
}
do it like
if (!x)
return;

do_something();
if (!y)
return;

do_sth_else();

So, how would that deal with elseif?

Don't do this.

Javascript masterrace coming through.

I was b8ing m8. Even though python wouldn't have the trailing curly brackets, it would still be a code smell, since indentations that deep are good indicators, that code needs to be refactored.

if (!x) {
do_else_case();
return;
}
do_normal_case();

Yup, that's 28 spaces there, or 14 levels of indentation.

Alternatively: );}));};})());};

I try to avoid it, but some algorithms REQUIRE 4+ nested loops in order to remain readable and if you don't want to resort to significant whitespace in your language, you need a closing brace character.

You could also use closing keywords, but that wouldn't really change aynthing.

You can easily fix that with an autoformatting plugin.

>write sloppy code
>run plugin
>BOOM! Everything looks neat and properly formatted.

I'd rather deal with a bunch of curly brackets than having to deal with problems fixing white spaces and indentation in order to make Python work.

It's an inevitability. You could try to add some functions to reduce clutter.

No, you should never indent controlled statements without surrounding them with brackets. That's just asking for trouble. What if some idiot decided to put a logging statement before the return? Then your early return becomes unconditional.

>What if some idiot decided to put a logging statement before the return
Then that idiot should not be working on the code. He could do all kind of stupid bullshit. I shouldn't have to make my code idiot-proof.
Ideally, that would be decided for a style-guide for the project/company/group whatever.

FUCK

It happens quite easily simply because you focus on the program flow and not the syntax while reading code and searching for that place you want to insert something.

You should make your code idiot-proof, because sooner or later someone is going to let idiots loose on it. Saying "I don't need to make my code idiotproof because idiots aren't going to be working on it" is the same as saying "We don't need to carry lifeboats because the ship isn't going to sink".

>do it like
goto fail;
goto fail;

It's a consequence of closures, pattern matching adding and "everything is an expression" increasing nesting. This the logical end product when you try to graft C++ syntax on ML semantics.

>seven levels of indent

That shit should have been refactored four levels ago

Functional programming doesn't have this problem.

Functional programming techniques are a large part of why this happens in Rust.

No. It would be forbidding people to go near the edges of the ship because some idiot might jump off of it.

Code is never idiot-proof, if an idiot is working on your codebase he will fuck shit up and there's nothing you can do about it. All of the "idiot-proof" restrictions are nothing more than massive inconveniences for experienced programmers, and in the end they won't stop idiots from fucking up your code if they're ever allowed to touch it.

Functional programming doesn't have many problems because no one uses it

python doesn't have this problem.

Can do if you're using dictionary comprehension. Plus if you're sending complex POST requests it's pretty difficult not to become lost in nested JSON.

I will propose a fix.

{^x

where x is the number of brackets.

Fok i meant to put a }

if (cond)
{
for (;;)
{
while ()
{

} } }


r8

...

>putting curly braces around one-line statements is a massive inconvenience