March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to Moritz Warning | Moritz Warning wrote:
> There is a poll in the right corner:
> "What programming language do you PREFER to work in?"
> Would be nice if they would have a "D" option.
I sent an email to the editor asking them to fix that.
|
March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to Bill Baxter | Bill Baxter wrote:
> Weird. Somebody edited the comments I posted. They basically did the edits I wanted to make but couldn't, but it still leaves me with a creepy feeling.
Mine too. Must be the elves at DDJ. Either that or Skynet.
|
March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Some more comments on reddit: http://reddit.com/r/programming/info/6c0ys/comments/ |
March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | == Quote from BCS (ao@pathlink.com)'s article
> Reply to Walter,
> > Dr. Dobb's has invited me to write a blog for them, so here's my first installment on invariant strings:
> >
> > http://www.dobbscodetalk.com/index.php?option=com_myblog&show=Invarian t-Strings.html&Itemid=29
> >
> wow, a publicly available picture of Walter!
> And on the content; you mention concatenation as working on invariant strings.
> I assume this is because you generally can't concatenate in place anyway?
Regarding D specifically, I think it is generally quite possible to append to a string in place, but doing so can be problematic for the inattentive programmer:
char[] refA = "abc".dup;
char[] refB = refA;
refA ~= "def";
refB ~= "ghi";
With mutable strings, the above will likely result (depending on the runtime and GC implementation) in
both refA and refB still pointing to the same location, which contains"abcghi". Invariant strings address
this issue by providing predictable semantics, making strings behave very much like a value type. This is
achieved through always reallocating and copying when a mutation occurs however, which I feel makes
it not suitable for all situations. It's a great default for everyday programming, but must be used much
more carefully in performance-critical applications. So in short, I'm not convinced that invariant strings
will save the world--at least not until we have zero-cost garbage collection--but they are certainly
quite easy and safe to use.
Sean
|
March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | On Fri, 14 Mar 2008, BCS wrote: > Reply to Bill, > > > BCS wrote: > > > > > Reply to Walter, > > > > > > > Dr. Dobb's has invited me to write a blog for them, so here's my first installment on invariant strings: > > > > > > > > http://www.dobbscodetalk.com/index.php?option=com_myblog&show=Invari an t-Strings.html&Itemid=29 > > > > > > > wow, a publicly available picture of Walter! > > > > > You can actually see him move, and talk, too, if you go here! http://video.google.com/videoplay?docid=-7073020265668105471 :-) > > > > I think the thumbnail pix on the /blog/ has better resolution! A better picture.. http://d.puremagic.com/conference2007/DConference_2007_group_0.html Walter is the guy font and center in the purple shirt. Later, Brad |
March 14, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Roberts | "Brad Roberts" <braddr@puremagic.com> wrote in message news:Pine.LNX.4.64.0803141239090.4104@bellevue.puremagic.com... > A better picture.. > > http://d.puremagic.com/conference2007/DConference_2007_group_0.html > What a bunch of nerds! |
March 14, 2008 Bright & Nerdy | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jarrett Billingsley | Jarrett Billingsley wrote: > What a bunch of nerds! Wierd Al did a song about our family, Bright & Nerdy: http://www.youtube.com/watch?v=-xEzGIuY7kw |
March 15, 2008 Re: Invariant strings on Dr. Dobb's | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Roberts | Reply to Brad,
> A better picture..
>
> http://d.puremagic.com/conference2007/DConference_2007_group_0.html
>
> Walter is the guy font and center in the purple shirt.
>
> Later,
> Brad
<grin size=huge> And that's me, in the back, and to the right a bit (between Don C. and Gregor R.) </grin>
|
Copyright © 1999-2021 by the D Language Foundation