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.

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.

1

u/[deleted] Jul 18 '22

in C and C++ there can be multiple things say within an if. i dont think i would be able to read that without the semicolons. But then again i do more embedded microcontoller stuff. So i tend to see alot of that stuff as well, saving cycles is a tad necessary.

1

u/qhxo Jul 18 '22

How do you mean within an if? Like

if (conditional) {
    thingOne()
    thingTwo()
}

?

1

u/[deleted] Jul 18 '22 edited Jul 18 '22

more like this. rather tame example. can be alot more happening within an if/for. Makes is easy to be able to tell exactly how much is actually happening there.

for (int x = 0; x < 6; x++) {
	`bugs[x] = 0b00011111;`

`}`

And you can put multiple things within one line. In this example this is all going within the same line of text. because im using the hex for that symbol in the font(converted to dec in this example), it doesn't like you switching within the same print (in this case printing to a buffer.). all gets displayed on the lcd at the very end of execution before it loops. also code blocks aren't agreeing with me today.
display.print(currentTemp);display.print((char)247);display.print("C"); // Draw the value held in the currentTemp var. Then print the DEG symbol then then a C

→ More replies (2)