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

What’s wrong with single letter variable names? Were those variable names not associated with types that themselves have descriptive names?



I randomly opened a file in the Darcs code base and picked a line:

     mReadFilePS p = B.concat `fmap` BL.toChunks `fmap` TM.readFile p
To understand this, you need to know what "m", "PS", "B", "BL" and "TM" mean.

In Node.js, the convention is that classes are named after the modules they import-- they are full words:

    const config = require('config')
In Darcs, we find this:

  import qualified Data.ByteString      as B
  import qualified Data.ByteString.Lazy as BL
  import qualified Data.Map             as M
  import qualified Darcs.Util.Tree.Monad as TM
I guess you get used to it, but it's a steeper learning curve for contributors to memorize more items to get up to speed.


I don't understand. There is no memorisation necessary. The modules are imported, qualified by an alias.

I'll accept the learning curve for Haskell is at least longer (rather than steeper) than in most languages, but to hold this up as an example to me is just bizarre.

And I say this is someone who only knew JavaScript and PHP for some years before learning a bunch of other languages including Haskell.

Moreover, you've conveniently left out the type signature which I expect would normally accompany this function, which would tell the reader what the `p` variable is.




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

Search: