<div style="text-align:left">Dmitry, very thanks for the reply!</div><div style="text-align:left"><br></div>I'm going to make a nice API and acceptance testing using some Redis tutorial. With it working well do you think that worth make project marketing considering the overall code quality?<div>
<br></div><div>Looking the sources pedantically what's wrong?<br><div><div><br></div>Pedro Lacerda<br><br>
<br><br><div class="gmail_quote">2012/3/5 Dmitry Olshansky <span dir="ltr"><<a href="mailto:dmitry.olsh@gmail.com">dmitry.olsh@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 05.03.2012 7:24, Pedro Lacerda wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
In an attempt to learn D and git I'm building a Redis client. Assertedly<br>
there are many problems in the implementation, I'd like to hear opinions<br>
pointing them or suggestions. If here isn't the place to ask these type<br>
of review, where is?<br>
</div><a href="http://github.com/pslacerda/dredis" target="_blank">github.com/pslacerda/dredis</a> <<a href="http://github.com/pslacerda/dredis" target="_blank">http://github.com/pslacerda/<u></u>dredis</a>><br>
</blockquote>
<br>
You may go for D group, though for newbie kind of thing D.learn is perfect place.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Some friend asked why I choose not to go asynchronous. It's because<br>
usually clients and servers are at a very fast connection and Redis<br>
responses are pretty fast too.<br>
</blockquote>
<br></div>
Right, and you always can go fancy later on :)<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Correct me if wrong, but I need to do nothing special at<br>
client.RedisClient to make it thread safe, right?<br>
<br>
</blockquote></div>
In a sense. I mean everything is thread-local by default so unless you plan to go _shared_ it's OK.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
token.__Bulk has an nullable array because I made distinction between an<br>
empty and a null arrays as the protocol did. The type looks fully bad.<br>
Some idea?<br>
</blockquote>
<br></div>
Just use plain Nullable!(T[]) as is? I mean there is no need to wrap wrapper type ;)<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I guess that make token.Token an struct and pass it through ref<br>
functions will make the code somewhat better, but I have no clues. Token<br>
will never be seen by the user. When should I do it?<br>
</blockquote>
<br></div>
Make it a struct, from the looks of it it's a tagged union anyway. More importantly passing it _by value_ and copying is far cheaper then allocating new objects and working with them via extra indirection.<br>
It would be almost the same as using Algebraic!(string,Exception,<u></u>long,Bulk,MultiBulk) from std.variant. Though then you'd miss your nice Type enumeration.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I guess that implement the protocol as free functions isn't a bad option<br>
because D offers this imperative style and the protocol is so small that<br>
doesn't need more a structured approach. Tell me this is wrong!<br>
<br>
</blockquote>
<br></div>
It's up to you in any case. Benefits of extra structure won't show up until the code is quite large.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
thanks from a newbie :-)<br>
Pedro Lacerda<br>
</blockquote>
<br></div>
You are welcome !<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Dmitry Olshansky<br>
</font></span></blockquote></div><br></div></div>