ProgrammerHumor

youCant

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

Discussion

abybaddi009

Python code can have semicolons

1 day ago
realnete
:cp:

which are useless and so are girlfriends

1 day ago
Bryguy3k
:c::py:

Semicolons in python allow you to write python one liners.

1 day ago
MDivisor

Which you should never do.

1 day ago
HumbersBall

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

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

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

1 day ago
drkspace2
:py::cp::c:

It's useful when doing python -c

1 day 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
1 day ago
drkspace2
:py::cp::c:

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

1 day ago
menzaskaja

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

1 day ago
bbbar

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

1 day ago
Believeditwasbutter

I take this as a challenge.

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

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

1 day ago
pokeybill

100% agree, not for distribution

1 day ago
nickwcy

which is messed up like girlfriends

1 day ago
Yarplay11

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

1 day ago
numahu

you just need the right type of indent...

1 day ago
DDFoster96

Don't break my heart further. 

1 day ago
jmona789

But they are unnecessary and the girlfriend wants to be necessary

1 day ago
flatfisher
:ru:

r/IStartedProgrammingAWeekAgoHumor

1 day ago
DDFoster96

Disappointed that's not real (yet) 

1 day ago
Outrageous_Permit154

Still not available. I’m taking it

Edit lol too many letters

1 day ago
FjellaTheBirb

r/firstweekprogrammerhumour

1 day ago
Outrageous_Permit154

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

I made this one insteads

r/firstweekcoderhumour

1 day ago
bapt_99

God dammit.

1 day ago
Jugales

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

1 day ago
Nidoso2

In Python, no semicolon is necessary, just good intentions

1 day ago
avillainwhoisevil
:j:

And indentation.

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

1 day ago
menzaskaja

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

1 day 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

1 day 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)

1 day ago
MARO2500

That one hits home...

1 day ago
Kyouma118

Happy coding. We all start somewhere

1 day ago
PeoplesFront-OfJudea
:cp::js::ts::py:

You’re a better man than most lol

8 hours ago
Teradorto

gotta debug my way into your heart

1 day ago
Miauwkeru

She gotta give him some space(s)

1 day ago
lewisb42

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

1 day ago
MCMC_to_Serfdom
:js:

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

1 day ago
potuboi2

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

1 day ago
TheGreatCompromise

I omit semicolons from my typescript, too

1 day ago
JackNotOLantern

';'

17 hours ago
Outside-Bowler6174

Sorry, I meant I do code golf in python

17 hours ago