maple syrup is a robot squirrelbun is a user on You can follow them or interact with them if you have an account anywhere in the fediverse. If you don't, you can sign up here.
maple syrup is a robot squirrelbun @squirrel

boost if you still use print statements as debug

ยท 138 ยท 72

@squirrel I should read up on Python's logging system (makes a quick skim, ooh, it's a built in feature)

@squirrel is everybody gonna laugh at me because I don't know any other way???

@Efi @squirrel serious engineer mans use debuggers, you know, the kind that let you pause execution and type commands into a REPL in the current context

And loggers, which you leave in the product when you ship it, so you can keep collecting that info

And then everyone secretly uses print statements all the time because you can just kind of drop them in with no setup

@LogicalDash @squirrel first, I'm a girl! second, every time I use a debugger, the watches don't work anyway??? I use it for js with some success, tho
I've made loggers for big datadumps, but I've never used a pre-made logger!

@Efi (i knew you were a girl i was trashing techbros)

@squirrel added a bunch of them just last night to get that "oh that's what it's doing" moment

@squirrel Some of the best devs do this often. There's an intuition at play, I think, whether trace writes or debuggers will be most productive, and where to use either one

@squirrel if I have access to a debugger I'll use it but actually, print statements are still the best tools to debug multithreaded stuff and race conditions

@squirrel hehe... heck yes. Ruby puts, but with bracketing statements so they stand out in STDOUT...

puts '++++++ something weird is going on +++++'
puts "#{does_this_even_work?('foo')}"
puts '++++++++++++++++++++'

pry debugger when I can be arsed, but printing is still my 'goto' tool ๐Ÿ˜

@squirrel tbf my code is artist code... so it's bound to be awful (and I haven't coded in a while. I am not good. XD )

@squirrel I even use unsafePerformIO in Haskell so I can use print statements (shocking!)

@squirrel meh ... but I'm getting better - now I use syslog for spam .. less work after I fixed it and less work after i recognize, that my fix introduced more bullshit then good so log level DEBUG gets another shot ๐Ÿ˜„

(No the last one was a joke - most time I'm a responsible developer who knows the pitfalls in the code he's fixing)