Using plain strings (such as "block comment end") for processing is fragile, especially if these strings are not constants. Retyping these string literals everywhere will eventually lead to mistypes and unmaintainable code. Using enums allow greater flexibility, quick and easy comparisons, and easy extension for more purposes (if needed).
Using plain strings (such as "block comment end") for processing is fragile, especially if these strings are not constants. Retyping these string literals everywhere will eventually lead to mistypes and unmaintainable code. Using enums allow greater flexibility, quick and easy comparisons, and easy extension for more purposes (if needed).