9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "David Leimbach" <leimy2k@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] a quick and simple minded study of configure.
Date: Sat, 16 Jun 2007 08:34:30 -0700	[thread overview]
Message-ID: <3e1162e60706160834t2a4a9abauab8caec41964ad59@mail.gmail.com> (raw)
In-Reply-To: <106eb6113bc866fa7be68b228b07b0a6@9netics.com>

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

On 6/15/07, Skip Tavakkolian <9nut@9netics.com> wrote:
>
> > I'm pretty sure I'm not good at it yet but I always found this one
> > line. "word counter" impressive.
> >
> >  std::distance(std::istream_iterator<std::string>(std::cin),
> > std::istream_iterator<std::string>());
>
> it is impressive that you typed that on a blackberry!


I'm not going to tell you that it was easy :-)


it's not short, if you count the class implementation.  it doesn't
> convey the idea - the solution is not understood unless you
> understand each piece.


I disagree, to the extent that it really is short, in that it's one line :-)

I agree as your point is 100% valid that if you don't know distance,
istream_iterator, what cin is, and how it deals with "std::string", that you
wouldn't know how to write that line, and you possibly wouldn't understand
how it works.

But I suspect any person dealing with C++ has an idea how the STL and
Standard C++ Library works.  What might still not be obvious is that that
you need certain restrictions on iterators for STL to work (don't
stable_sort on list iterators, as you probably need something with random
access, not bi-directional iterators).  (ok that was a bit tongue-in-cheek)

No wonder there's so much money in C++ books  :-)

i think what Ron is bringing up is having/learning the ability to
> see through layers of filters to the exact need and providing a
> design that is just the right distance between "pie in the sky" and
> "failure of vision".
>
> Yep, I was trying to point out that sometimes less code is more headache
:-)

Of course when the plane door closes you have to shut off your phone so I
don't think I got that across very well :-).

At any rate, I'm hoping that's NOT what was meant by "Bell Labs Lines"  :-)

Dave

[-- Attachment #2: Type: text/html, Size: 2977 bytes --]

  parent reply	other threads:[~2007-06-16 15:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-15 21:15 ron minnich
2007-06-15 21:18 ` Francisco J Ballesteros
2007-06-15 21:23 ` Rob Pike
2007-06-16  1:18   ` David Leimbach
2007-06-16  4:39     ` Skip Tavakkolian
2007-06-16  5:58       ` Bruce Ellis
2007-06-16 15:34       ` David Leimbach [this message]
2007-06-17  7:06         ` Martin Neubauer
2007-06-17 23:58           ` Uriel
2007-06-18  2:25             ` David Leimbach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e1162e60706160834t2a4a9abauab8caec41964ad59@mail.gmail.com \
    --to=leimy2k@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).