this post was submitted on 10 Apr 2025
20 points (100.0% liked)

No Stupid Questions (Developer Edition)

1014 readers
1 users here now

This is a place where you can ask any programming / topic related to the instance questions you want!

For a more general version of this concept check out [email protected]

Icon base by Lorc under CC BY 3.0 with modifications to add a gradient

founded 2 years ago
MODERATORS
20
submitted 1 week ago* (last edited 1 week ago) by 3rr4tt1c to c/no_stupid_questions
 

Like if I'm using print statements to test my code. Is it okay to leave stuff like that in there when "publishing" the app/program?

Edit: So I meant logging. Not "tests". Using console.log to see if the code is flowing properly. I'll study up on debugging. Also, based on what I managed to grasp from your very helpful comments, it is not okay to do, but the severity of how much of an issue it is depends on the context? Either that or it's completely avoidable in the first place if I just use "automated testing" or "loggers".

you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 4 points 1 week ago (1 children)

Are you familiar with automated testing? From the subject line I thought this was going to be about that, but the body of the post is something else.

[โ€“] [email protected] 2 points 1 week ago

@jjjalljs @3rr4tt1c I was about to say though that if you have a print statement that you used to check something, and think you may want to check it again in the future, then you should remove it and make an automated test instead.