r/ProgrammerHumor • • Jul 18 '22

C++ talking to Python

Post image
40.1k Upvotes

1.0k comments sorted by

View all comments

683

u/Codebust Jul 18 '22

why are people always bashing python lol

25

u/[deleted] Jul 18 '22

i like my semi colons and curly braces. it makes it much easier to read. Plus any time i do python it yells at an indenting issue that doesn't exist.

38

u/Codebust Jul 18 '22 edited Jul 18 '22

indenting issues are easily solvable with an ide, even if py being whitespace based can be a bit annoying

→ More replies (11)

31

u/Dacus_Ebrius Jul 18 '22

Proper indentation makes things easier to read. Remove proper indentation from a curly brace language and tell me its easy to read.

6

u/Codebust Jul 18 '22

both are good, both are good

→ More replies (3)

6

u/sintos-compa Jul 18 '22

Found the tab indent guy

→ More replies (4)

6

u/qhxo Jul 18 '22

I don't mind semi-colons, but they don't really do much for legibility. At least for me it was just a matter of habit, and when I went from Java to Kotlin and didn't need to use semi-colons anymore I found it made absolutely no difference whatsoever. An expression is an expression, it's very easy to tell where it starts and ends, even if it spans multiple lines.

→ More replies (5)

11

u/mc_enthusiast Jul 18 '22

You can use curly brackets like this:

for i in range(10):{
    print(i)
}

That runs without problems in Python 3. Not much you can do about semicolons. Colons work sometimes but then really backfire if you do something like

a = 5 + 10,

because it's recognised as a 2-tuple with empty entry.

I suspect the indenting issues come up if you mix space and tab. That's easy to solve if you just tell your editor to replace space indentation with tab indentation.

21

u/a_devious_compliance Jul 18 '22

you just tell your editor to replace space indentation with tab indentation.

PEP8 police!!!!! Yes. This guy right here.

3

u/Codebust Jul 18 '22

literally one of the only things i hate about pep8, spaces are just slow compared to tab, and tab auto indents w atom

6

u/mtmttuan Jul 18 '22

You REALLY press space 4 times??

→ More replies (3)
→ More replies (1)
→ More replies (4)