I don't think I've ever encountered a common practical programming situation where I wanted null-termination as the convention for strings.
-
-
Replying to @cmuratori
Sentinels lead to more efficient code in common cases. E.g. a lexer where the end check can be part of a char switch.
2 replies 0 retweets 1 like -
Replying to @pervognsen
Are you sure it's actually more efficient, though? Because the count remaining narrows the token possibilities quickly.
2 replies 0 retweets 0 likes -
Replying to @cmuratori @pervognsen
So I think it would depend on _what_ you were lexing. If you're ever lexing keywords, I think count might be faster?
1 reply 0 retweets 0 likes
Replying to @cmuratori @pervognsen
But yeah, I think if you're just "some short symbols and then 'identifier'", probably null terminator is faster...
1:33 PM - 28 May 2016
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.