772
print('here1'); (lazysoci.al)
all 46 comments
sorted by: hot top controversial new old
[-] henfredemars@infosec.pub 137 points 1 month ago

All the debugging tools in the world doesn’t beat an excellent sense of intuition and putting that print statement exactly where it needs to be.

[-] ryannathans@aussie.zone 66 points 1 month ago

As linus says, if you need to use a debugger your code is too complicated

[-] flying_sheep@lemmy.ml 38 points 1 month ago

He works on Linux where he controls the whole stack down to the metal and I love that for him, but other people have to call library code, and them debug that if it doesn't work as they thought it would.

[-] rbits@lemm.ee 20 points 1 month ago

Well then obviously if you use libraries, your code is too complicated

[-] Traister101@lemmy.today 10 points 1 month ago

Yep that's why I refuse to use standard libraries. It just makes my code too complicated...

[-] BleatingZombie@lemmy.world 2 points 1 month ago

Tell that to my employer

[-] zalgotext@sh.itjust.works 5 points 1 month ago

Right, the amount of times I've had to put breakpoints in Django/DRF code to figure out what's causing that weird undocumented behavior is concerningly large

[-] Theharpyeagle@lemmy.world 11 points 1 month ago

Dude can pry my debugger from my cold, dead hands.

[-] Cubes@lemm.ee 5 points 1 month ago

The problem is that sometimes it's not your code that you're debugging

[-] xmunk@sh.itjust.works 49 points 1 month ago

echo __LINE__ . "Moo\n";

Honestly if you're not including the LoC in your debug statement I don't even fucking understand you.

But yeah, senior devs know the power of breadcrumb debugging (because most of us were deeply scarred by gdb).

[-] CanadaPlus@lemmy.sdf.org 25 points 1 month ago

Did GDB do something bad at some point?

[-] Sphks@lemmy.dbzer0.com 17 points 1 month ago

Yes. It breaks points.

[-] quink@lemmy.ml 9 points 1 month ago

That's console.trace() for all you JS devs out there.

[-] alqloe@lemmy.dbzer0.com 3 points 1 month ago* (last edited 1 month ago)

I always combine that with objects with the shorthand notation. So you always know what variable has what value without having to remember in what order you printed the variables.

console.trace({i, list});
// {i: 1, list: [0, 1, 2]}
[-] lemmesay@discuss.tchncs.de 1 points 1 month ago

I also use group and groupend to nicely collapse different logs. and table when i'm feeling funny.

[-] psud@aussie.zone 7 points 1 month ago* (last edited 1 month ago)

Don't you want it to look a little nicer? echo __LINE__ . ": Moo!";

I mean, presuming cowsay is unavailable

[-] flying_sheep@lemmy.ml 6 points 1 month ago

dbg!() for Rust users

[-] GammaGames@beehaw.org 30 points 1 month ago

And when you need something more complex

console.log(1);
[…]
console.log(2);
[…]
console.log(3);
[-] mattd@programming.dev 24 points 1 month ago

More like

console.log('shit');
[…]
console.log('fuck');
[…]
console.log('ass');
[-] fosho@lemmy.ca 11 points 1 month ago

yeah and then you forget about one that makes it into a release and then see it in the console.

[-] arendjr@programming.dev 11 points 1 month ago

This is the real reason we have linters.

[-] SteveFromMySpace@lemmy.blahaj.zone 27 points 1 month ago

I feel kind of bad for shooter on the left just using stuff a lot of competitive shooters use and getting roasted for it incessantly lol

[-] tyler@programming.dev 60 points 1 month ago

wait she's getting roasted for it? I haven't seen that. It just looks like people are making fun comparisons to me.

[-] SteveFromMySpace@lemmy.blahaj.zone 24 points 1 month ago

I guess it feels kind of implied but maybe that’s just me!

[-] lunarul@lemmy.world 28 points 1 month ago

She looks cool af in that pic, I can't take the comparison as a roast.

[-] eighty@lemmy.world 38 points 1 month ago

Might just be me but I think this looks cool/cute af especially with the little plush

[-] psud@aussie.zone 19 points 1 month ago

That's her 5 year old kid's. Super sweet :)

[-] Gsus4@mander.xyz 4 points 1 month ago

Yea, her demeanour reminds me of Motoko from Ghost in the Shell in that photo angle.

[-] Gsus4@mander.xyz 11 points 1 month ago* (last edited 1 month ago)

Anybody who knows about this: how do those gizmos help? E.g. earplugs are useful without performance-enhancing.

[-] kboy101222@sh.itjust.works 26 points 1 month ago

Once you're at this level, you're looking to get improvements of a fraction of a percentage. I don't know the specifics cause I'm not a pro shooter despite being American, but from other high level skill people I know, you hit a point where improvements basically plateau and you have to resort to increasingly niche products to obtain non skill improvements. If you want proof of that, check out calligraphy and fountain pen communities. The amount of money some people spend on things I didn't know existed is wild.

(No bad judgement to those folks, I've gotten hard into map making and 3d printing lately, so I'm right behind you)

[-] variants@possumpat.io 11 points 1 month ago

Adjustable frames help keep the lens at the correct angle for your eyes if you tilt your head a certain way from my understanding. So if you tilt your head at a certain angle you can adjust the frame to keep your prescription from getting out of focus at that specific head tilt

[-] virku@lemmy.world 5 points 1 month ago

It is also an adjustable, external retina that allows you to let just enough light through, apparently.

It’s all about directing eyes and blocking distractions

[-] psud@aussie.zone 2 points 1 month ago
[-] zero@lemm.ee 1 points 1 month ago* (last edited 1 month ago)

if you look closely you can actually see a literal blinder over her left eye! the reason it helps is because precision shooting is all about repeatability, and both eyes open is a more repeatable position than closing one eye exactly the same way every time

[-] GBU_28@lemm.ee 18 points 1 month ago

Beep

Boop

Gloop

Glorp

Yeet

Yo

[-] Aabbcc@lemm.ee 5 points 1 month ago

"Hello worl" if I need something quick

"AAAAAAAAAAAAAAAAA" if I'm lazy and don't want to have to hunt the output logs for it

[-] sheepishly@fedia.io 2 points 1 month ago

That's me..... I do that...................

[-] Klear@sh.itjust.works 17 points 1 month ago

This is why I find shaders scary as fuck

[-] pkill@programming.dev 10 points 1 month ago

tfw I recently worked on a side project where I was too lazy to change the log level but not sloppy enough to use raw printf so I'd just throw stuff into info and then remove the statements once I solved my issue

[-] noproblemmy@programming.dev 3 points 1 month ago

After all, that's why git is there, to help me remember the shit I put all over the place. (Ok, it might have some other uses.)

[-] veganpizza69@lemmy.world 3 points 1 month ago* (last edited 1 month ago)

[[[[[[[[[ TEST ]]]]]]]]]

[-] Kojichan@lemmy.world 7 points 1 month ago

Ahhh, my favourite debugging combo...

echo "<pre>"; print_r( "We are here, we are here!" ); echo "</pre>"; die();

Also fun at parties, hanging out asynchronously, is the ever popular PHP Mail to see if something ran in the background properly, or to get output.

[-] pimeys@lemmy.nauk.io 7 points 1 month ago

dbg!(1) all the time...

this post was submitted on 02 Aug 2024
772 points (97.8% liked)

Programmer Humor

19187 readers
1198 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS