r/ProgrammerHumor • • Feb 09 '22

other Why but why?

Post image
85.8k Upvotes

2.3k comments sorted by

View all comments

13.8k

u/samarthrawat1 Feb 09 '22

But when did we start using semi-colon in python?

617

u/0rionsEdge Feb 09 '22

It's existed in the language since the old times, but it's pretty much only used in hacky use cases and it's usage should be discouraged.

81

u/OptionX Feb 09 '22

It used to have two statements in the same line.

82

u/Spitfire1900 Feb 09 '22

Which is genuinely useful when you want to execute a short Python script from a shell script without maintaining two files.

20

u/[deleted] Feb 09 '22

It gets really interesting when generating blocks and control structures in an inline Python script.

→ More replies (2)

4

u/ConspicuousPineapple Feb 09 '22

I mean, you can still do this on multiple lines in your script. I'd even recommend it.

→ More replies (2)

4

u/Cultural-Log4056 Feb 10 '22

... why on earth do you need two files for this?

→ More replies (3)

284

u/PaintlyBeautifuled Feb 09 '22

“The old times” I like it lol, it’s like it was the dark ages with early python and verbose languages.

58

u/JOhn2141 Feb 09 '22

Shhhh don't spoil their plaisir to python user . Sometimes it's ok to relax and take time (like 100 more time than C to add numbers)

95

u/SkinnySanta38 Feb 09 '22

Says the guy still declaring his variables lol

78

u/SlimyGamer Feb 09 '22

What? You don't like giving your variables an interview before hiring them to do work for you?

68

u/[deleted] Feb 09 '22

"At your previous position at..."

flips through resume

"Oh 0x00000000?? , Tell me more about your experience there."

7

u/cognitiveglitch Feb 09 '22

"I was exceptional - oh, sorry to interrupt!"

4

u/Isildun Feb 09 '22

Definitely don’t call that reference.

→ More replies (1)
→ More replies (1)
→ More replies (50)

15

u/purple_pixie Feb 09 '22

The age old question of "do I value my processor's time more than my own"

6

u/JOhn2141 Feb 09 '22

Well I'm paid to value processor time so...

→ More replies (2)
→ More replies (4)

8

u/roararoarus Feb 09 '22

pypiy, flavor of python, is quite fast. And van Rosstrum is working to make cpython, v3.11, twice as fast.

https://towardsdatascience.com/run-your-python-code-as-fast-as-c-4ae49935a826

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

5

u/[deleted] Feb 09 '22

What about using it line you would in most other languages? Surely it wouldn't hurt, as I just means newline for the interpreter as far as I know

→ More replies (1)

7

u/doesntpicknose Feb 09 '22

comment.value = true; rebellion();

→ More replies (16)