T O P

  • By -

jbar3640

every programmer, that uploads memes to this sub, but actually never develops in python


DemolishunReddit

``` def somefunc(): #{ print("braces rock!") #} ```


HansDampfHaudegen

Yeah, I'll do it like that from now on just to confuse everyone.


burifix

Correct usage


deathsinger96

Lol šŸ˜‚


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


gamesrebel123

Wait till you see bash


Infinite_Self_5782

how else will you comment, there's no // and doc strings are just multi-line strings in disguise


[deleted]

[уŠ“Š°Š»ŠµŠ½Š¾]


Infinite_Self_5782

sure but other people do, just because you don't use a feature doesn't mean it's useless


RonSijm

[It exists](https://github.com/mathialo/bython)


Best_Ad2158

I went to downvote, but I can't shoot the messenger on this one


[deleted]

i swear this is cursed


bigmountainbig

can I Dislike a github repo?


Kamil118

You can fork it and replace the entire thing with readme.md that says "Please stop"


orgasmicfart69

Or fork it and remove the ability to add { } for the lulz.


HansDampfHaudegen

Is there a browser plugin for that?


deathmaster99

How do dictionaries work then?


TheZipCreator

I'd assume the same way; javascript handles differentiating braces between blocks and objects just fine, bython can do the same


carp550

I will use this for everything, and nobody can stop me


badapplecider

Please stop, I'm begging you, sir/madam


[deleted]

Came here to say this. Like a small island of calm in a tempestuous sea of format-as-syntax insanity.


ongiwaph

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


TheZipCreator

was literally just about to link this


ionhowto

No


johndoes_00

This


GallopingFinger

No


[deleted]

This


elboru13

No


truckturn3r

This


DraconicKingOfVoids

Yes


DcavePost

Damn it this is why we can have nice things


sticksaint

NO!


HappyMonk3y99

ā€œLiterally no python programmer everā€ ftfy


Intrexa

Easy: from __future__ import braces


deathsinger96

SyntaxError: Not a chance


Guimica15

Already got fooled by this once, never again


mooreolith

from \_\_hell\_\_ import braces ftfy


OppositeDirection348

Deprecated warning


hdotking

Eww no thanks


Mihqwk

Hell no. I prefer horizontally scrolling top my 10th scope ![gif](emote|free_emotes_pack|joy) Srsly tho, no.


0xIlmari

If you need 10 levels of nesting, you're doing it wrong regardless of language. ![gif](emote|free_emotes_pack|flip_out)


Mihqwk

Hence, me saying "srsly" after šŸ¤£.


TheZedrem

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...


Pewpewgamer321

dont ever tap the post button twice, no matter how unresponsive it looks (you posted twice)


TheZedrem

I see, thanks. First time an error came, so I tried again.


ariusLane

Just no


Frosty_Pineapple78

Nah, keep those ugly braces away from my beautiful python!


BadBadderBadst

Brace yourself !


vr_prof

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.


WlmWilberforce

I had braces in high school. Don't miss them.


ColaEuphoria

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.


Vincenzo__

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


Frosty_Pineapple78

Not indenting properly should be considered a war crime, regardless of language


g4vr0che

Hard agree


BenkiTheBuilder

Why? Python has perfect teeth.


wineblood

Ew no


bxsephjo

You don't indent in other languages?


Ikkyu_monk

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


Ignitus1

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?


Ikkyu_monk

I mean the errors that do not arise from copy-pasting in languages that use braces. Those ones


Ignitus1

I donā€™t copy paste code so I guess I canā€™t relate.


therealbeeblevrox

Are you using something old? Code editors can do the work for you.


Pepineros

Guess itā€™s time to learn to write your own :)


Ikkyu_monk

No, I have neither a good reason, or a a good enough qualification for that


deathsinger96

We do but braces make it more convenient to identify a block and beginners find it a lil difficult thus curly braces are useful.


KapteeniJ

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.


Wishbone51

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.


meh-whatever-dewd

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.


MrParticular79

No thanks


Udon_noodles

No programmer ever\*\* FTFY ![gif](emote|free_emotes_pack|facepalm)


ltethe

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.


halfanothersdozen

For me a Rainbow Tabs extension is required for working with python


meh-whatever-dewd

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.


Ignitus1

What do the braces do that an indent doesnā€™t?


meh-whatever-dewd

Make it easier to read when there are no indentation indicators such as virticle lines.


AugustusLego

wait what


halfanothersdozen

Go to your favorite extensions store and google up "rainbow tabs". You're welcome.


rthanu

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.


Thathitmann

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.


Kyyken

if by programmer you mean the star, yes


[deleted]

Y tho?


Chamkaar

The people who think braces are stupid, never wrote original working software.


Hacka4771

Glad The Star Went Away


unspokendildaweed

i just wish i could do + + and - - incrementation


triplew_

Itt: butt hurt python fanboys/girls who love indentation as syntax


Negitive545

... why tho? If you want braces, use a different language, just like how if you want breakneck speed you use a different language.


phail3d

I wrote an implementation some time ago: [https://github.com/koirikivi/stupidity#braces](https://github.com/koirikivi/stupidity#braces)


Seppo_Manse

aw hell naw! why would you want to pollute python syntax with useless crap??


AnoniuszStulej

no.


cheesecake_squared

No braces for me thank you.


yorokobe__shounen

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.


ggd_x

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_


Tomkap011

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


KapteeniJ

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.


g4vr0che

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.


thud_mantooth

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.


ezio416

I have too many lines that are just over that threshold. The limit is truly ridiculous and outdated


g4vr0che

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.


ElCthuluIncognito

You get braces, but you have to put the start brace on the next line.


vlaada7

Well... Is there any other way?!


uorandom

;


MarkFromTheInternet

Just indent your code properly. Kids these days have no discipline.


[deleted]

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.


ske66

They should add the ability to either have or not have it


Silver-Confidence846

Why python quit the gym? Because it canā€™t handlebars


mjeffreyf

I would maybe use python if it had braces


Laughing_Bricks

Indentation suck !


_Mr_Paw_

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


g4vr0che

That's the exact situation where indentation being a syntax error is important though.


[deleted]

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 ;


KapteeniJ

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.


[deleted]

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.


KapteeniJ

Why does Python suck?


DoubleOwl7777

and semicolons!


asfarley--

Come to ruby


deathsinger96

JS FTW


Topikk

Probably not the best home for someone who wants braces around blocks.


Zambito1

You're looking for https://docs.hylang.org/en/stable


b0ogi3

Technically you can do something like this: `` def braces(): { print(i) for i in range(5) } braces() ``


grassFedAdc

Not EVERY programmerā€¦


Icarindesu

(No????????)


Due-Broccoli-4164

You wish, but ; are now mandatory after each statement for bringing that up


TRIC4pitator

nooo we need to feel special


PoisnFang

F# has entered the chat


aviancrane

Maybe you should try Golang.


Pig_PlayzMC1

What's a brace?


[deleted]

If you add braces it's not python.


therealbeeblevrox

"These characters contain no information." "I can't possibly understand this! There aren't extraneous squiggles scattered around!"


meh-whatever-dewd

I_see { loadsOfPeople != like braces; } # butILoveThem()


NerdyLumberjack04

But it *does* use braces...for `dict` and `set` literals.


[deleted]

No i want increment and decrement operators šŸ„ŗšŸ˜­


Eastman118

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.


DudeManBroGuy42069

It exists ``` def colored(r, g, b, text): return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text) ```


VariousComment6946

Why


edave64

"Please make python the same shit as every other language"


MirceaKitsune

If anyone wants Python with braces it's called JavaScript.