DEV Community


Discussion on: How To Write Comments

daviddalbusco profile image
David Dal Busco

Oh pretty cool tips and tricks 👍

Do you use // TODO: and // FIXME: "only" or any other granularity?

Thread Thread
ekeijl profile image
Edwin • Edited

// @TODO for things that should be improved/refactored in the future.
// @FIXME for things that are in a broken/buggy state.

There is a risk that nobody will ever look at these comments again and they remain there to rot in the codebase. This works best if you add a ticket number from your issue tracker (Jira/GitHub issues) so any developer can find context information about it, so:

// @FIXME #321: Temporary fix for XYZ, remove when this ticket is done

Thread Thread
alexanderjanke profile image
Alex Janke

I use this one here
Apart from TODO and FIXME I also use // HACK: 😆 That's about it

Thread Thread
daviddalbusco profile image
David Dal Busco

@alexanderjanke : Haha I might use the // HACK: way more often than it should be allowed 😅. Thanks for feedback, might probably gonna try to enrich my todos with these ideas.

@ekeijl : Agree with you, works best with a ticket number, if not even a must