Showerthought: kept putting off f-strings because they looked like more typing, finally used one last Tuesday and I feel like an idiot | Coding For Beginners - Chatter Central
Showerthought: kept putting off f-strings because they looked like more typing, finally used one last Tuesday and I feel like an idiot
I've been writing print("Total: " + str(total)) for like 8 months now in my little budgeting script. Saw f-strings mentioned a bunch of times in the Python sub and every time I skimmed past it thinking it was just some style thing people argue about. Then last Tuesday I was fixing a bug where my output had a space in the wrong spot and someone in a Discord server said "just do f'Total: {total}'" and it was one line instead of three. I sat there for a second. I've been doing extra work for almost a year because I assumed the new way was more complicated. It's less complicated. It's literally less of everything. Now I'm going through old files changing stuff and it's honestly kind of fun, which is a weird thing to say about string formatting. What's the thing you avoided for months because it looked harder and then took 30 seconds to learn?
This is the same reason I used a plunger for the first time last month instead of calling a plumber. We build stuff up in our heads as this big thing and then it's like, oh, that's it? The doing is almost always easier than the dreading.