ALL
Programming Language Readability
Lets compare some Python to Haskell for solving the same problem. The problem we’ll pick is Trie data-structure for auto-completions. We are interested not so much in the nitty gritty of the algorithm, but in the language style itself. Auto-complete has been in the programming news a lot recently; both a Python and a Haskell solver have turned up.(I suspect this post got flagged on Hacker News :( It never got on the front-page despite the rapid upvoting on a no-news night)Here’s the Python:"""A fast data structure for searching strings with autocomplete su...
2,882 0 PROGRAMMING PYTHON HASKELL READABILITY
Reducing Code Nesting
"This guy’s code sucks!" It’s something we’ve all said or thought when we runinto code we don’t like. Sometimes it’s because it’s buggy, sometimes it’sbecause it conforms to a style we don’t like, and sometimes it’s because itjust feels wrong. Recently I found myself thinking this, and automaticallyjumping to the conclusion that the developer who wrote it was a novice. Thecode had a distinct property that I dislike: lots of nesting. But the more Ithink about it, the more I realized that it’s not really something Iâ€â...