Hacker News new | past | comments | ask | show | jobs | submit login

The factual inaccuracies in the Strings chapter, covering encodings and Unicode, are horrific enough. Confusing UCS-4 and UTF-32, getting historical orderings wrong, completely forgetting to mention Latin-1, and worst, failing to directly outline the connection between encoded streams of bytes, and Unicode strings, in clear and direct language.

Also, the horrific RE abuse at the beginning of Chapter 6 is a remarkable standalone example of Doin' It Wrong:

  import re

  def plural(noun):          
    if re.search('[sxz]$', noun):            
        return re.sub('$', 'es', noun)        
    elif re.search('[^aeioudgkprt]h$', noun):
        return re.sub('$', 'es', noun)      
    elif re.search('[^aeiou]y$', noun):      
        return re.sub('y$', 'ies', noun)    
    else:
        return noun + 's'



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: