2 ms·
It's only clear for people who don't really understand regexes. For people with knowledge of them, it's more ambiguous as to whether a slash is being matched or
by logn 14y ago
It's only clear for people who don't really understand regexes. For people with knowledge of them, it's more ambiguous as to whether a slash is being matched or used to escape. It reminds me of commenting the end of your for loops, } //end for ... it's clear for people who come from Python and don't know Java but that's not who we should be helping.
- deleted 14y ago[deleted]
- Firehed 14y agoAre you writing this for yourself or to share? If the latter, optimize readability for people who don't understand regexes. As for commenting the end of loops - that too just improves readability, especially in long functions. If your editor doesn't show invisible characters, it can be easy to lose track if some indent is part of the 'i' loop or the 'j' loop, for example (yes, that can indicate a bigger problem, but that's not the point. I'm talking about real-world code, not idealistic academic nonsense)
- hkolek 14y agoWhy? So my grandma can read my code? That's not the way to enlightenment if you program in a professional setting.