On Wed, Aug 31, 2016 at 5:31 PM, Rex Kerr <
ich...@gmail.com> wrote:
>
> In practice I don't find this to be much of an issue, for two reasons.
> (1) I make my window wider and/or have my editor wrap lines in
> display.
What I meant is that in most cases the RHS is not aligned, so the
operator gets lost in the noise.
> (2) I know what should return a value and what should have a side-effect
> so I go looking for the operation
That doesn't help when I read other people's code, or write code that
others should read.
> That the different statements end up better-aligned with this approach
> is, I think, a significant advantage too.
I'm guessing that you're talking about similar lines lining up since
there's no extra operator on the second line as in:
blah blah
+ blah blah
That's true, but there are indentations that can still make them line up
(see my example), and of course there's alternative syntaxes (as in Lisp
sexprs).
On Wed, Aug 31, 2016 at 5:57 PM, Kevin Wright <
kev.lee...@gmail.com> wrote:
>
> In practice, that method would be a one-liner and - if only used in this one
> place - would be defined as close as possible to the use site
Not really... See how the extra syntactic baggage in your example
(function name, argument names, types) are roughly the same size as the
actual body.
> (remember, we can nest function definitions in Scala).
(Yes; I'm new to Scala, but I'm extremely familiar with FP/PL/Lexical
Scope.)
> case Fork(left, right, _, _) =>
> def betterConvert(side: Type, prefix: Int) = convert(side) map { case (k,
> v) => (k, prefix :: v) }
> betterConvert(left, 0) ++ betterConvert(right, 1)
> case SomethingElse =>
And indeed the result is (again -- IMO) much harder to read.
(Abstraction of code that is used only twice can be a problem that leads
you down to omega and from there to the Y combinator... See my
signature.)
In any case, I'll stop replying on the list now, sorry for the noise.