[Ur] Client-side programming style
Artyom Shalkhakov
artyom.shalkhakov at gmail.com
Fri Jan 22 11:19:13 EST 2010
Hello Adam,
2010/1/22, Adam Chlipala <adamc at impredicative.com>:
> Artyom Shalkhakov wrote:
>> After looking at the example dlist module, I noticed that it was much
>> more elaborate. What is the reason for that?
>
> The biggest reason is performance. With the naive list-based technique,
> consider what happens when you want to change one element of the list:
> you must regenerate the whole page section for the list. With Dlist,
> only the section for the particular element is recomputed.
>
> There are also a few observable side effects of recomputation. For
> instance, the cursor position in a textbox will be reset, even if that
> textbox isn't part of the rendering of the list element you've changed.
> If you want to avoid these consequences, you might prefer Dlist or a
> similar approach.
Thanks for noting this.
>> Also, I found that code
>> hard to follow; is there a nice metaphor or something to help making
>> sense out of that code?
>>
>
> Did you try to understand the signature first? It's meant to be easy to
> understand as an alternate presentation of lists with extra reactive
> functionality.
I was talking about the implementation, sorry for being confusing.
Please disregard this question.
Cheers,
Artyom Shalkhakov
More information about the Ur
mailing list