[prev] [thread] [next] [lurker] [Date index for 2007/02/01]
------=_Part_1920_29957789.1170291150137 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm not really hating length being part of the structure of the string. I'm hating the fact that in BSTR's, the pointer points to the first character, while the four bytes indicating length exist *before* the pointer, _as well as_ the whole string being NULL-terminated. http://msdn2.microsoft.com/en-us/library/ms221069.aspx On 1/31/07, A. Pagaltzis <pagaltzis@xxx.xx> wrote: > > * blah blah <qwerty1602@xxxxx.xxx> [2007-01-31 09:40]: > > Don't forget BSTR's, the best of them all. Typedef'd as a WCHAR > > *, so you'd think they are the same, yet the four bytes before > > the first character contains the length of the string. Greatest > > idea ever. > > > > Hate. > > I am not disputing the hatefulness of false cognate typedefs. > Pascal strings however *are* in fact a great idea for a tiringly > long list for reasons -- better than C strings in every > conceivable way bar one or two. > > (My trajectory as a programmer was BBC BASIC -> Pascal -> Forth > -> x86 assembler -> C. When I first heard how strings worked in > C, I thought "now that's stupid." I was but a greenhorn, but my > intuition was clearly already decent; even a greenhorn can tell > that C strings blow.) > > Regards, > -- > Aristotle Pagaltzis // <http://plasmasturm.org/> > ------=_Part_1920_29957789.1170291150137 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm not really hating length being part of the structure of the string. I'm hating the fact that in BSTR's, the pointer points to the first character, while the four bytes indicating length exist *before* the pointer, _as well as_ the whole string being NULL-terminated. <br><br><a href="http://msdn2.microsoft.com/en-us/library/ms221069.aspx">http://msdn2.microsoft.com/en-us/library/ms221069.aspx</a><br><br><div><span class="gmail_quote">On 1/31/07, <b class="gmail_sendername">A. Pagaltzis </b> <<a href="mailto:pagaltzis@xxx.xx">pagaltzis@xxx.xx</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">* blah blah < <a href="mailto:qwerty1602@xxxxx.xxx">qwerty1602@xxxxx.xxx</a>> [2007-01-31 09:40]:<br>> Don't forget BSTR's, the best of them all. Typedef'd as a WCHAR<br>> *, so you'd think they are the same, yet the four bytes before <br>> the first character contains the length of the string. Greatest<br>> idea ever.<br>><br>> Hate.<br><br>I am not disputing the hatefulness of false cognate typedefs.<br>Pascal strings however *are* in fact a great idea for a tiringly <br>long list for reasons -- better than C strings in every<br>conceivable way bar one or two.<br><br>(My trajectory as a programmer was BBC BASIC -> Pascal -> Forth<br>-> x86 assembler -> C. When I first heard how strings worked in <br>C, I thought "now that's stupid." I was but a greenhorn, but my<br>intuition was clearly already decent; even a greenhorn can tell<br>that C strings blow.)<br><br>Regards,<br>--<br>Aristotle Pagaltzis // < <a href="http://plasmasturm.org/">http://plasmasturm.org/</a>><br></blockquote></div><br> ------=_Part_1920_29957789.1170291150137--There's stuff above here
Generated at 23:01 on 06 Feb 2007 by mariachi 0.52