Gollum@feddit.de to Programmer Humor@programming.dev · 1 year agoD or d come oni.imgur.comimagemessage-square218fedilinkarrow-up11.41Karrow-down147 cross-posted to: programmerhumor@lemmy.ml
arrow-up11.36Karrow-down1imageD or d come oni.imgur.comGollum@feddit.de to Programmer Humor@programming.dev · 1 year agomessage-square218fedilink cross-posted to: programmerhumor@lemmy.ml
minus-squarelemmonade@lemm.eelinkfedilinkarrow-up11arrow-down2·1 year agoYou could also say that down should not complete to download since those are completely different strings and you shouldn’t expect one to get you the other.
minus-squareFeyter@programming.devMlinkfedilinkarrow-up8arrow-down5·1 year agoSorry, down is a substring of download I don’t get your point either?
minus-squareHonytawk@lemmy.ziplinkfedilinkarrow-up6arrow-down2·1 year agoSubstring is not string. If they were interchangeable, then “D” & “d” should be too.
minus-squareFeyter@programming.devMlinkfedilinkarrow-up2·1 year agodown matches down* because * also includes empty string. Also download matches down* D matches D* but d is not matching D* because D is a different character than d.
minus-squarelemmonade@lemm.eelinkfedilinkarrow-up1·1 year agobut why do we have to match specifically against substr*? it’s not a law of nature, we could also match against the regex (?i)substr(?-i).* not saying that one option is necessarily better, but I don’t see a good reason for which it any one of these options is terrible
You could also say that
down
should not complete todownload
since those are completely different strings and you shouldn’t expect one to get you the other.Sorry,
down
is a substring ofdownload
I don’t get your point either?Substring is not string.
If they were interchangeable, then “D” & “d” should be too.
down
matchesdown*
because*
also includes empty string. Alsodownload
matchesdown*
D
matchesD*
butd
is not matchingD*
becauseD
is a different character thand
.but why do we have to match specifically against
substr*
? it’s not a law of nature, we could also match against the regex(?i)substr(?-i).*
not saying that one option is necessarily better, but I don’t see a good reason for which it any one of these options is terrible