Agree 100%, print/console.log is only a temp debug tool and does not belong in your Git repo. Always review your changes before you commit, and take the print statements out.
I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
I don't think there's anything wrong with having debugging statements in your repo, as long as they're in a feature branch, but you should clear them out before merging back to the main branch (usually develop).
There shouldn't be a fear of committing anything, because committing isn't just about sharing your work with the project, it's also for you as an individual. If you go home and work from a different computer, you're going to want the changes you made earlier in the day.
You can squash your commits if you don't want any record of your work-in-progress or debugging attempts to appear in the VCS history.
Agree 100%, print/console.log is only a temp debug tool and does not belong in your Git repo. Always review your changes before you commit, and take the print statements out.
I don't think there's anything wrong with having debugging statements in your repo, as long as they're in a feature branch, but you should clear them out before merging back to the main branch (usually
develop
).There shouldn't be a fear of committing anything, because committing isn't just about sharing your work with the project, it's also for you as an individual. If you go home and work from a different computer, you're going to want the changes you made earlier in the day.
You can squash your commits if you don't want any record of your work-in-progress or debugging attempts to appear in the VCS history.
Agreed!