On Wed, Jul 2, 2014 at 10:42 AM, Ryan O’Hara <[email protected]> wrote: > On Wed, Jul 2, 2014 at 7:30 AM, Lee Fallat <[email protected]> wrote: >> On Wed, Jul 2, 2014 at 10:21 AM, Charlie Kester <[email protected]> >> wrote: >>> On Wed 02 Jul 2014 at 04:49:23 PDT FRIGN wrote: >>>> >>>> >>>> Yes, highlighting comments makes sense, as even the article suggests, >>>> but this is not a central issue if you know how to encapsulate your >>>> comments: >>>> >>>> /* >>>> (...) >>>> (...) >>>> (...) >>>> */ >>>> >>>> is more error-prone and hard to read than >>>> >>>> /* >>>> * (...) >>>> * (...) >>>> * (...) >>>> */ >>>> >>>> once the comments get longer. >>> >>> >>> Agreed. But I'm often reading someone else's code and they're not >>> always so considerate. >>> >>> >> >> Why would the former be more error-prone? Or even harder to read?...In >> my opinion they both have equal readability. >> >> The only issue I have with syntax highlighting is that many people >> rely on it to know if what they're typing is correct syntax (which >> means people have no idea what they're doing- in a sense training >> wheels), and to visually scan source (why scroll through the entire >> source looking for function f() when you can just run ctags or a >> similar tool?). As people have pointed out too, compilers will usually >> tell where you've made a mistake in syntax. >> > > Quick, tell me whether /^http:(\/\/(?:[^/]+\/)+[/]final)$/ parses in Ruby. > How about in JavaScript? > > The answer is obvious if you know your language and are able to do a > quick scan through the literal, but syntax highlighting removes the > effort entirely. >
You make a very good point. The thing with regular expressions though is people usually take a good minute or more to craft them (not something like [0-9], but more like the example you gave). I would say yes that parses in Ruby (if I was reading the code), because it was there already. It's too bad though that the assumption all code works as intended (or at all) is wrong...
