News for hackers. Stuff that matters.
Re:Readability and Naming Things by Peaker on Wednesday January 26, 2011 @11:48AM (#2143845)
Names are great places to put documentation. Documentation in comments isn't as likely to stay up-to-date.

If your names are merely for binding (e.g: f(x) = .. x ..) and don't contribute much, then getting rid of them can be helpful. In Haskell, you can use "points-free" style to get rid of names like that. For example, you can replace:

    f x = 1 + 2 * x
With:

    f = (1+) . (2*)
Re:Readability and Naming Things by joe_the_user on Wednesday January 26, 2011 @02:49PM (#2144771)
That's a nice simple explanation of the points-free style, thanks!

But still, I don't feel like this approach would become useful unless/until you reached the point that it could condense a two-line formula into one line (ei, five or six applications further).

I strong suspect that in that case you'd have the kind of formula you only grasp at a glance after you'd working with it intensively for a while.

And this gets into the realm of "write only code" - code too compressed for anyone but it's original author to approach.