Make const, immutable, inout, and shared illegal as function attributes on the left-hand side of a function

Sean Kelly via Digitalmars-d digitalmars-d at puremagic.com
Sun Oct 12 14:14:37 PDT 2014


On Sunday, 12 October 2014 at 19:40:56 UTC, Walter Bright wrote:
>
> Programming languages are always imperfect models, it's like 
> the 2x4's you buy at the hardware store are never straight. You 
> just learn to deal with it, because perfectly straight ones 
> would be prohibitively expensive.

Well... some of them are straight.  If you're building something 
that's built from near full-length boards then you search for the 
straight ones.  Otherwise you just take whatever.  In fact, the 
last time I was sifting through 2x4s at Home Depot, one of the 
people working there asked me to set the warped ones aside so 
they could take them out.  I'm sure they chip them and make 
press-board or whatever out of them instead.

The other tricky thing about selecting 2x4s is that once you get 
to the center of the palette the boards tend to be damp, and so 
there's a chance that they'll be straight when you buy them but 
they'll warp as they dry.  There's kind of an art to selecting 
wood for a building project.

So I guess the point is that you use the proper materials for the 
job.  With physical jobs, the leftovers can almost always be 
repurposed or remade into something suitable for a different job. 
  So there's very little actual waste.  Competent builders can 
even use salvaged materials to create an entirely new thing.  I 
have a set of record shelves that are built from salvaged deck 
beams.  Aged wood tends to be really beautiful because colors and 
textures emerge as it ages.

What I've learned about building is that, just like programming, 
there's an established process for everything.  And building new 
structures is largely a matter of assembling the pieces and 
joining them in the proscribed manner.  So you quickly start 
thinking about projects in terms of the larger problem rather 
than the complexity of constructing an individual wall section or 
whatever.


More information about the Digitalmars-d mailing list