In Ruby (and many other programming languages), developers use comment tags to annotate their code for various purposes. These tags help in identifying different types of comments, which can be particularly useful for maintaining and navigating large codebases. Here are some common comment tags you can use:
Indicates something that needs to be done in the future.
# TODO: Implement the authentication logic here
Identifies a known bug in the code.
# FIXME: This method fails when input is nil
Identifies a known bug in the code.
# BUG: This calculation returns the wrong value for negative inputs
Indicates a place where the code could be made more efficient.
# OPTIMIZE: This loop can be optimized for better performance
A workaround or temporary solution that needs to be revisited.
# HACK: Using a hardcoded value here until we get proper input
Provides additional information or context about the code.
# NOTE: This method is only used in the admin panel
Marks code that should be reviewed, often used during code reviews.
# REVIEW: Ensure this logic covers all edge cases
Marks code that is outdated and should not be used in new development.
# DEPRECATED: Use the new authentication method instead
Highlights an important aspect of the code that should not be overlooked.
# IMPORTANT: This API call must be idempotent
Draws attention to security-related aspects of the code.
# SECURITY: Validate user input to prevent SQL injection