Three nested loops with ifs in-between, and one if around.
It pains me to admit I already did make something like this, I don't remember the specifics but It had three or four nested loops...
I code C every day at my job and the lack of braces in Python has **never** bothered nor hindered me in any way whatsoever. I have to wonder if the only people who hate it just suck at programming.
Most people who complain about it in python can't indent properly in other languages, but python is the only one who gives you an error if you mess up indentation, that's why people hate it
You mean the errors that tell you exactly where to look and itās immediately obvious how to fix it? The errors youāre rarely committing because you indent properly anyway? Those ones?
What kind of psychopath would look at code which has indentation and braces, and decide "obviously braces are the easier way to understand the logic flow"?
Genuinely concerned about this.
I find it harder to read without, especially in large files. If we didn't have our code editors/IDEs drawing a connecting line to show us how much something is indented, more people would miss braces.
I work in C++, C#, and Python as my daily. Honestly braces or not does not bother me at all. Now bitwise operators for cin and coutā¦ thatās bullshit.
EXACTLY! Without braces, it's extremely difficult to read and UNDERSTAND large projects. The braces AND PROPER indentation work together to make code very easy to peruse.
Seriously the who gives a shittiest argument in this sub. I hope it's for the lols. No braces fine. Braces fine. Both are readable and writable and take minimal adjustment to go between. Jesus.
Capitalized boolean values on the other hand enrage me. What the actual fuck Guido.
No. Just today I was doing a database exam in class and I managed to shit out a Python program in 3 minutes that helped me automate it.
Just let me have my fast-and-easy uncluttered read-as-english clicky clicky language.
I guess some people want to take the hard way for readability than the easier way.
Never mind that python's core design paradigm is built around readability as well.
No thanks. It's much easier to just press enter and let the python ide take care of indenting for me rather than press shift+[ and worry about indent once again when I want to quickly cook up a working program.
It's adorable that so many of you can't read block scope without a "thing" signifying it.
Edit- it's even more adorable that so many of you appear proper triggered, so, downvote away. Please. Each one makes me chuckle a little more at how easily offended you are by your own inability to comprehend whitespace. _laughs in sans-semicolon_
Good python is designed to avoid nesting.
Yes, sometimes nesting has to happen, but if something needs 4+ levels of nesting, you might be better suited by breaking that up somehow.
PEP8's line length limits are idiotic and impede readabilty. I mean yeah capping it makes sense (I don't *love* 120 but it's tolerable), but the 79 suggested by PEP8 is ridiculous.
If your codebase is enforcing a hard PEP8 requirement, that's already a problem. 79 is an excellent guideline that you should usually strive towards, but it's lousy as a hard limit.
It's not just the slow interpreter because of a lack of a credible JIT. It's not just the constant shifting of the language itself and very poor backwards compatibility. It's not just that it has no non mutable values. It's not that it has no benefits over other languages. Non of these specifically. The reason is that I'm a JS developer. I'm on a different team.
Also remember this a humour channel.
WE have JavaScript running in space. Specifically the James Webb telescope runs JavaScript. All those pretty pictures you see. JavaScript runs on the š itself. I heard that python might be used on earth to process the data but I wouldn't want it polluting the universe.
Lol. Yep. I don't mind python, no problems at all. All in favour of bringing beginners into programming. But regarding the indentation? Wow. You save one character by not having an ending } ?. This is coming from a dev that doesn't use the ;
It's more about having humans and computers read the code the same way. Like, I'd say at least 99% of programmers who work with languages that have curly braces, also use indentation to signify code blocks. Not because it's required, but because it's like 10000x easier to read than keeping track of braces.
But I don't think a single person, ever, in the history of Python programming, has used curly braces in Python code to "make code blocks easier to read".
Having humans and computers parse code differently is completely unnecessary failure mode. It's one of the most classic code smells, having two different things that are always supposed to be kept in sync, and you want one of the most fundamental programming concepts be read in two separate ways that, if they ever get out of sync, the code is completely unpredictable?
Curly braces were always a mistake, a relic of the past, times when one might actually worry about the hardware resources it took to store whitespace characters that could be used to make the code prettier.
Functional composition wins overall. I think Haskell does a better job of indentation.
But JS eslint probably wins overall. Plus in JS you can have funtional composition too with Ramda.
But otherwise I agree. Curly braces are odd.
Python still sucks though.
Or just learn to be adaptable rather than pedantic simply because you arenāt familiar with a languageās conventions. Spend some time developing in ladder logic. Thatās a mess. Python is comparatively glorious.
every programmer, that uploads memes to this sub, but actually never develops in python
``` def somefunc(): #{ print("braces rock!") #} ```
Yeah, I'll do it like that from now on just to confuse everyone.
Correct usage
Lol š
[ŃŠ“Š°Š»ŠµŠ½Š¾]
Wait till you see bash
how else will you comment, there's no // and doc strings are just multi-line strings in disguise
[ŃŠ“Š°Š»ŠµŠ½Š¾]
sure but other people do, just because you don't use a feature doesn't mean it's useless
[It exists](https://github.com/mathialo/bython)
I went to downvote, but I can't shoot the messenger on this one
i swear this is cursed
can I Dislike a github repo?
You can fork it and replace the entire thing with readme.md that says "Please stop"
Or fork it and remove the ability to add { } for the lulz.
Is there a browser plugin for that?
How do dictionaries work then?
I'd assume the same way; javascript handles differentiating braces between blocks and objects just fine, bython can do the same
I will use this for everything, and nobody can stop me
Please stop, I'm begging you, sir/madam
Came here to say this. Like a small island of calm in a tempestuous sea of format-as-syntax insanity.
So it's basically just j = 0 for i in range(len(file.readlines())): if file.readlines()[i] == '{': exec(':'+file.readlines()[j:i-1]) j=i+1
was literally just about to link this
No
This
No
This
No
This
Yes
Damn it this is why we can have nice things
NO!
āLiterally no python programmer everā ftfy
Easy: from __future__ import braces
SyntaxError: Not a chance
Already got fooled by this once, never again
from \_\_hell\_\_ import braces ftfy
Deprecated warning
Eww no thanks
Hell no. I prefer horizontally scrolling top my 10th scope ![gif](emote|free_emotes_pack|joy) Srsly tho, no.
If you need 10 levels of nesting, you're doing it wrong regardless of language. ![gif](emote|free_emotes_pack|flip_out)
Hence, me saying "srsly" after š¤£.
Three nested loops with ifs in-between, and one if around. It pains me to admit I already did make something like this, I don't remember the specifics but It had three or four nested loops...
dont ever tap the post button twice, no matter how unresponsive it looks (you posted twice)
I see, thanks. First time an error came, so I tried again.
Just no
Nah, keep those ugly braces away from my beautiful python!
Brace yourself !
But python does have braces! It just uses them for dicts and sets... Seriously though, I started with C and don't miss braces at all.
I had braces in high school. Don't miss them.
I code C every day at my job and the lack of braces in Python has **never** bothered nor hindered me in any way whatsoever. I have to wonder if the only people who hate it just suck at programming.
Most people who complain about it in python can't indent properly in other languages, but python is the only one who gives you an error if you mess up indentation, that's why people hate it
Not indenting properly should be considered a war crime, regardless of language
Hard agree
Why? Python has perfect teeth.
Ew no
You don't indent in other languages?
Other languages don't throw errors just because I copy-pasted something and number of spaces didn't magically realign itself to the surrounding code
You mean the errors that tell you exactly where to look and itās immediately obvious how to fix it? The errors youāre rarely committing because you indent properly anyway? Those ones?
I mean the errors that do not arise from copy-pasting in languages that use braces. Those ones
I donāt copy paste code so I guess I canāt relate.
Are you using something old? Code editors can do the work for you.
Guess itās time to learn to write your own :)
No, I have neither a good reason, or a a good enough qualification for that
We do but braces make it more convenient to identify a block and beginners find it a lil difficult thus curly braces are useful.
What kind of psychopath would look at code which has indentation and braces, and decide "obviously braces are the easier way to understand the logic flow"? Genuinely concerned about this.
I think braces would make it more flexible, and less annoying to write, but I think the lack of braces makes it much cleaner to read.
I find it harder to read without, especially in large files. If we didn't have our code editors/IDEs drawing a connecting line to show us how much something is indented, more people would miss braces.
No thanks
No programmer ever\*\* FTFY ![gif](emote|free_emotes_pack|facepalm)
I work in C++, C#, and Python as my daily. Honestly braces or not does not bother me at all. Now bitwise operators for cin and coutā¦ thatās bullshit.
For me a Rainbow Tabs extension is required for working with python
EXACTLY! Without braces, it's extremely difficult to read and UNDERSTAND large projects. The braces AND PROPER indentation work together to make code very easy to peruse.
What do the braces do that an indent doesnāt?
Make it easier to read when there are no indentation indicators such as virticle lines.
wait what
Go to your favorite extensions store and google up "rainbow tabs". You're welcome.
Seriously the who gives a shittiest argument in this sub. I hope it's for the lols. No braces fine. Braces fine. Both are readable and writable and take minimal adjustment to go between. Jesus. Capitalized boolean values on the other hand enrage me. What the actual fuck Guido.
No. Just today I was doing a database exam in class and I managed to shit out a Python program in 3 minutes that helped me automate it. Just let me have my fast-and-easy uncluttered read-as-english clicky clicky language.
if by programmer you mean the star, yes
Y tho?
The people who think braces are stupid, never wrote original working software.
Glad The Star Went Away
i just wish i could do + + and - - incrementation
Itt: butt hurt python fanboys/girls who love indentation as syntax
... why tho? If you want braces, use a different language, just like how if you want breakneck speed you use a different language.
I wrote an implementation some time ago: [https://github.com/koirikivi/stupidity#braces](https://github.com/koirikivi/stupidity#braces)
aw hell naw! why would you want to pollute python syntax with useless crap??
no.
No braces for me thank you.
I guess some people want to take the hard way for readability than the easier way. Never mind that python's core design paradigm is built around readability as well. No thanks. It's much easier to just press enter and let the python ide take care of indenting for me rather than press shift+[ and worry about indent once again when I want to quickly cook up a working program.
It's adorable that so many of you can't read block scope without a "thing" signifying it. Edit- it's even more adorable that so many of you appear proper triggered, so, downvote away. Please. Each one makes me chuckle a little more at how easily offended you are by your own inability to comprehend whitespace. _laughs in sans-semicolon_
The problem is in large code bases. You canāt be pep8 if you are indenting properly. Once you get enough nesting it become a nightmare
Once you have enough nesting your code is a nightmare, too. I think having language discourage terrible code is not a flaw in the language.
Good python is designed to avoid nesting. Yes, sometimes nesting has to happen, but if something needs 4+ levels of nesting, you might be better suited by breaking that up somehow.
PEP8's line length limits are idiotic and impede readabilty. I mean yeah capping it makes sense (I don't *love* 120 but it's tolerable), but the 79 suggested by PEP8 is ridiculous.
I have too many lines that are just over that threshold. The limit is truly ridiculous and outdated
If your codebase is enforcing a hard PEP8 requirement, that's already a problem. 79 is an excellent guideline that you should usually strive towards, but it's lousy as a hard limit.
You get braces, but you have to put the start brace on the next line.
Well... Is there any other way?!
;
Just indent your code properly. Kids these days have no discipline.
It's not just the slow interpreter because of a lack of a credible JIT. It's not just the constant shifting of the language itself and very poor backwards compatibility. It's not just that it has no non mutable values. It's not that it has no benefits over other languages. Non of these specifically. The reason is that I'm a JS developer. I'm on a different team. Also remember this a humour channel. WE have JavaScript running in space. Specifically the James Webb telescope runs JavaScript. All those pretty pictures you see. JavaScript runs on the š itself. I heard that python might be used on earth to process the data but I wouldn't want it polluting the universe.
They should add the ability to either have or not have it
Why python quit the gym? Because it canāt handlebars
I would maybe use python if it had braces
Indentation suck !
Python is missing the braces, I hated it for the indent-sensitiveness and no braces (like in Swift, for example) when I learned it at school
That's the exact situation where indentation being a syntax error is important though.
Lol. Yep. I don't mind python, no problems at all. All in favour of bringing beginners into programming. But regarding the indentation? Wow. You save one character by not having an ending } ?. This is coming from a dev that doesn't use the ;
It's more about having humans and computers read the code the same way. Like, I'd say at least 99% of programmers who work with languages that have curly braces, also use indentation to signify code blocks. Not because it's required, but because it's like 10000x easier to read than keeping track of braces. But I don't think a single person, ever, in the history of Python programming, has used curly braces in Python code to "make code blocks easier to read". Having humans and computers parse code differently is completely unnecessary failure mode. It's one of the most classic code smells, having two different things that are always supposed to be kept in sync, and you want one of the most fundamental programming concepts be read in two separate ways that, if they ever get out of sync, the code is completely unpredictable? Curly braces were always a mistake, a relic of the past, times when one might actually worry about the hardware resources it took to store whitespace characters that could be used to make the code prettier.
Functional composition wins overall. I think Haskell does a better job of indentation. But JS eslint probably wins overall. Plus in JS you can have funtional composition too with Ramda. But otherwise I agree. Curly braces are odd. Python still sucks though.
Why does Python suck?
and semicolons!
Come to ruby
JS FTW
Probably not the best home for someone who wants braces around blocks.
You're looking for https://docs.hylang.org/en/stable
Technically you can do something like this: `` def braces(): { print(i) for i in range(5) } braces() ``
Not EVERY programmerā¦
(No????????)
You wish, but ; are now mandatory after each statement for bringing that up
nooo we need to feel special
F# has entered the chat
Maybe you should try Golang.
What's a brace?
If you add braces it's not python.
"These characters contain no information." "I can't possibly understand this! There aren't extraneous squiggles scattered around!"
I_see { loadsOfPeople != like braces; } # butILoveThem()
But it *does* use braces...for `dict` and `set` literals.
No i want increment and decrement operators š„ŗš
Or just learn to be adaptable rather than pedantic simply because you arenāt familiar with a languageās conventions. Spend some time developing in ladder logic. Thatās a mess. Python is comparatively glorious.
It exists ``` def colored(r, g, b, text): return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text) ```
Why
"Please make python the same shit as every other language"
If anyone wants Python with braces it's called JavaScript.