4 ms·
Alternative titles : "How to make your code unreadable in 55 minutes" "How to make your code hard to debug in 55 minutes" "How to introduce bugs by copying a
by adamconroy 13y ago
Alternative titles :
"How to make your code unreadable in 55 minutes"
"How to make your code hard to debug in 55 minutes"
"How to introduce bugs by copying a regex that you don't understand and neither did the author"
- SamReidHughes 13y agoThat's a stupid reply. Regular expressions are very useful.
- danielweber 13y agoMaybe the next fight on HN about the interview process should be whether we ought to expect the candidate to know about regexps. I know them, so of course every good developer should know them. (My proof: I am a good developer, and I know them, therefore good developers should know them!) (NB: In case it's not obvious this comment is slightly tongue-in-cheek.)
- mattmanser 13y agoRegular expressions are useful, but on a much smaller set of problems than people typically use them for. For example Chrome's script skipper in the debug tools completely unnecessarily uses regexes rather than a simple list of 'contains'. It's definitely one of the worst "everything's a nail" hammers a lot of programmers wield. And quite often they've been holding it upside down for years without even realizing it.
- SamReidHughes 13y ago> For example Chrome's script skipper in the debug tools completely unnecessarily uses regexes rather than a simple list of 'contains'. That is your example of overkill? More like, exactly the sort of scenario where you'd want to be able to specify a regexp.
- psquid 13y agoAnother situation where regexes are possibly abused - syntax highlighting. Yes, there are a lot of languages where you can sanely highlight /most/ code with regexes, but there's a non-zero number where you need a little more context, such as that provided by an AST (which would also help with autocompletion anyway if the highlighting is being done in the context of an editor).
- dllthomas 13y agoI'm consistently infuriated every time a search box in a GUI lacks regex support (which is very nearly all of the time).