ProgrammerHumor

youCant

youCant
https://i.redd.it/lbjhyzjw52ef1.jpeg
Reddit

Discussion

abybaddi009

Python code can have semicolons

18 hours ago
realnete
:cp:

which are useless and so are girlfriends

18 hours ago
Bryguy3k
:c::py:

Semicolons in python allow you to write python one liners.

18 hours ago
MDivisor

Which you should never do.

18 hours ago
HumbersBall

I sometimes test things using the command line. Why can I not use semi colons lord MDivisor?

17 hours ago
FalafelSnorlax
:py::c::cp::asm::rust:

But you wouldn't call that one liners, right? python - c is probably the main legitimate use of semicolons in python. Any code/script that you write persistently probably shouldn't have any semicolons at all.

17 hours ago
MDivisor

If you really want to do python -c "<some massive oneliner command>" on the command line I can't stop you. But you'd most likely be better off writing those commands into a file with proper formatting and then calling that file.

16 hours ago
drkspace2
:py::cp::c:

It's useful when doing python -c

17 hours ago
menzaskaja

only useful scenarios:

  • injecting malicious code
  • marking uvloop as a dependency that should only be installed on linux and macos in pyproject.toml
  • writing tests
17 hours ago
drkspace2
:py::cp::c:

? I think you're misunderstanding what python -c is/is useful for.

14 hours ago
menzaskaja

i'm talking about semicolons in python in general, not just using the -c option

14 hours ago
bbbar

It's a useful trick for a jupyther notebook to suppress the object printouts at the end of the cell executions

17 hours ago
Believeditwasbutter

I take this as a challenge.

15 hours ago
pokeybill

... unless you know exactly what you're doing.

I use inline Python frequently in bash while investigating and troubleshooting system issues or doing root cause analysis.

Its a tool like any other, people (incorrectly) say the same thing about bash one-liners but pipes and redirection an integral part of using the shell effectively.

Sometimes its awk, sometimes a Python one-liner, but one way or another if it works and is not destructive and you know exactly what everything is doing I see no issues using ad-hoc one-liners.

Would I document that and give it to a junior engineer as a best practice? No - but using the word "never" in this situation is unrealistic, for personal use one-liners are just a minified scripting syntax.

14 hours ago
MDivisor

I don't care what you get up to in the privacy of your own shell. I'm saying don't commit it into version control.

14 hours ago
pokeybill

100% agree, not for distribution

13 hours ago
nickwcy

which is messed up like girlfriends

17 hours ago
Yarplay11

And are a great tool to see if a project has been vibe coded with gemini too

16 hours ago
numahu

you just need the right type of indent...

18 hours ago
DDFoster96

Don't break my heart further. 

18 hours ago
jmona789

But they are unnecessary and the girlfriend wants to be necessary

17 hours ago
flatfisher
:ru:

r/IStartedProgrammingAWeekAgoHumor

18 hours ago
DDFoster96

Disappointed that's not real (yet) 

18 hours ago
Outrageous_Permit154

Still not available. I’m taking it

Edit lol too many letters

17 hours ago
FjellaTheBirb

r/firstweekprogrammerhumour

17 hours ago
Outrageous_Permit154

lol I couldn't make it! it's still too long!

I made this one insteads

r/firstweekcoderhumour

15 hours ago
bapt_99

God dammit.

17 hours ago
Jugales

She is a try-catch girl and I am an Ok-Err boy. It would never work.

18 hours ago
Nidoso2

In Python, no semicolon is necessary, just good intentions

18 hours ago
avillainwhoisevil
:j:

And indentation.

God have mercy on your soul if you mess up tabs vs spaces.

18 hours ago
menzaskaja

such a common thing to say, yet for what reason if you can just ruff format .?

17 hours ago
NatoBoram
:g::dart::ts:

Speaking of third-party tools being required to un-fuck the language at a fundamental level, the compiler/interpreter should come with a formatter

16 hours ago
menzaskaja

third-party tools being required to un-fuck the language

it is literally the same as the package lock in typescript or pubspec.yaml in flutter

no compiler in python :) it's an interpreted language

yeah python may be ass in some aspects (especially speed and a lot of missing features - i miss null conditional operators) but don't shit on it just because the community makes improvements.

also, never knew typescript wasn't a third party tool to un-fuck javascript!

edit: null conditional operators, not null coalescing - python has the latter in the form of or, where x or y evaluates to y if x is the number zero, the boolean value false, or an empty string/set/list/tuple (which i think is way more useful compared to C#, where bool x = null; if(!x) return "x is falsey" will fail, due to null not being a falsey value)

16 hours ago
MARO2500

That one hits home...

15 hours ago
Teradorto

gotta debug my way into your heart

18 hours ago
Kyouma118

Happy coding. We all start somewhere

17 hours ago
Miauwkeru

She gotta give him some space(s)

18 hours ago
lewisb42

You're better off, Red -- he uses tabs instead of spaces.

18 hours ago
MCMC_to_Serfdom
:js:

She wants to be forgotten more than I'd like to admit until a computer reminds me?

17 hours ago
potuboi2

Typical women wanting the end of the statement :(((

17 hours ago
TheGreatCompromise

I omit semicolons from my typescript, too

15 hours ago
JackNotOLantern

';'

5 hours ago
Outside-Bowler6174

Sorry, I meant I do code golf in python

5 hours ago