News for hackers. Stuff that matters.
Re:Why Learn Haskell? (2018) by ModernMech on Monday March 01, 2021 @11:11AM (#26304189)
The number of times students have come to me absolutely baffled as to why they can't tokenize a string twice using strtok() is the best reason for function purity I can think of. It's such an abomination of a function. The first time you call it, you give it a string and a delimiter. Subsequent times you call it, you give it a NULL and the delimiter. And then once you've tokenized the string once, you can never use it again. It's an example I hold up of how not to design functions.

There are no comments on this comment yet.