:: Re: [Libbitcoin] [PATCH] Implement …
Etusivu
Poista viesti
Vastaa
Lähettäjä: William Swanson
Päiväys:  
Vastaanottaja: Amir Taaki
Kopio: Libbitcoin
Aihe: Re: [Libbitcoin] [PATCH] Implement a bitcoin URI parser
On Thu, Mar 20, 2014 at 5:18 AM, Amir Taaki <genjix@???> wrote:
> Also I wouldn't worry too much about performance :) Far better is clarity,
> simplicity and directness of code. For instance the only place in
> libbitcoin I'm concerned about performance is the blockchain and maybe the
> memory overhead for the network stuff. Especially for parsing user data
> (like a URI) which you won't be doing millions of times a second, it
> doesn't matter too much. So in this case we might choose to write code
> that isn't as performant as it could be because it looks pretty.


Oops. Didn't you see this pull request?

https://github.com/spesmilo/libwallet/pull/10

I wrote my own number parser last night, so now we have two versions
of that same code. Actually, my parser is a bit shorter, is integrated
directly into the validation code, and has rounding. However, I have
just taken your invalid_amount constant, since that's a good idea.

Also, if you look at the new way I did the parsing/decoding in that
pull request, I think you will agree that it is far more elegant than
it was before. It gets rid of the parse/decode distinction while still
allowing extensibility, so it may be even simpler than what you had in
your first patch.

-William