[Boulder.pm] Boulder-pm Digest, Vol 39, Issue 15

Rob Nagler nagler at bivio.biz
Tue Aug 28 10:31:50 PDT 2012


Funny, but I found a bug in your mailer (Yahoo).  It sends out an
invalid Reply-To with two addresses.  Then, Gmail fails to check that
the message is compliant, and includes two addresses on the To: on the
reply.   Not a big issue, but a demonstration that even with large
teams of supposedly "the world's best programmers" we can't even map
to an RFC which is 30 years old (just a couple of weeks ago, in
fact!).

> What's the point of version control when you just end up throwing code away?

Yup, that's the attitude, but I bet it is the places with version
control which throw away the most code, because they have the youngest
programmers.

> it Good, Fast or Cheap...pick two please.  They will tell you all three, but

Time, Scope, Resources, and Risk.  I consider myself in the risk
mitigation business, not programming.  My goal is helping customers
understand that there's always risk, and the problem is quantifying
it, not assuming that it doesn't exist or is "low" or "high".  That's
why understanding business is so important: risk is quantified in
terms of cost to the company, not things like "technical debt".  Sorry
Kate, but I don't think this actually exists despite it being a term
du jour.  Whatever happened to Design Patterns?  Oh yea, they don't
exist either.  Or is it that all design problems have been solved, and
we are just reading out of a book how to program?

> Quality is job 2 in most cases.

Quality doesn't exist either.  It's Risk.  Quality is a meaningless
concept.  We write tests, use version control, avoid comments, etc. to
minimize risk, not to improve quality.  Literate programming improves
"quality" but is risk neutral.  I don't care how pretty your program
is, sorry.  What matters is the level of coupling (explicit and
implicit) and my ability as an expert in the specific problem domain
and platform to read your code. To pick on literate programming,
here's an example from the Wikipedia page:


    <<Scan file>>=
    while (1) {
      <<Fill buffer if it is empty; break at end of file>>
      c = *ptr++;
      if (c > '  ' && c < 0177) {
        /* visible ASCII codes */
        if (!in_word) {
          word_count++;
          in_word = 1;
        }
        continue;
      }
      if (c == '\n') line_count++;
      else if (c != '  ' && c != '\t') continue;
      in_word = 0;
        /* c is newline, space, or tab */
    }

What's wrong with this code?  Let's see there's an embedded constant
0177 which isn't even "documented".  There's the redundant state of
word_count and in_word (state mismatch is #1 cause of bugs).  The
embedded "\n" and \t which of course is platform dependent.  Let's not
forget that UTF8 allows a variety of spaces.  The dearth of named
abstractions.  Inconsistent use of "else".  It's an infinite loop
(where's the "last"?).  Oh wait, "in_word" is not even used, so it
takes me this long to see dead code.

But it does look nice. :)

I had the same problem with the dude who wrote Beautiful Code.
There's very little understanding about how to write risk-mitigated
code.  It's not more costly, just requires you having to live with the
same production code for a decade or so and doing some reflection on
that experience.

> But I have to agree....academia and the real world are two different places.

I don't agree.  It's like saying sysadmin and programming are
distinct, or software architecture and coding are different. Testing,
too.  They are all the same thing: providing structure to a problem
domain.  The principles apply in academia as they do in testing.  My
schooling was as much emergent knowledge (design, or whatever) as my
work in software architecture.

> I'm not really sure what the CS degree is attempting to produce.

I still use a lot of what I learned in school over 30 years ago.  I
was lucky in that I started going distributed systems around 1980 so I
got experience that's obviously useful today, but also understanding
big O notation and combinatorics is very important to what I do.
Not to mention my compiler and operating system experience.

> itself lent itself so well to many things.

If you ask me, everything in programming is derived from lisp.  We've
been twiddling syntax since 1959 just to understand that.

> but once you did I believe the mentality of OAOO could be achieved.

Absolutely, because it is so easy to have code as data and data as
code.  Look around you and see how many times this is true.  Consider
JSON, HTML, or about:config in your browser.

> Perl in
> all of it's splendor and glory with it's TIMTOWTDI mentality could never
> achieve the eloquence of LISP.

Agreed.  You can come pretty close.  As I often say, all you need is
eval and closures, and the rest is syntax.

> However the two languages seems to share
> much in common as pointed out in Mark Dominus' "Higher Order Perl".  Maybe
> this is how I got linked up with Perl?

The problem is few people understand this.  Python, ruby, sh, Tcl,
PHP, etc. are all popular, because they are asymptotically approaching
Lisp.

> and intriguing.  The Tower of Babel.  Are we as coders/developers building
> towers of babel with our own code?

Should we?  Check out http://appliedrationality.org/rationality/ which
someone sent me a link to today.  Here's a great quote:

Humans can’t be perfect reasoners because our brains have limited
processing capacity, and because our brains are evolved kluges of
“spaghetti code” rather than optimally-designed reasoning machines.

> Will we ever be able to unite all
> programming languages into one great programming language?

Compare JSON, HTML, XML to Lisp. :)

> Why are there so
> many programming languages?

Ego, Maslov, whatever.

Rob


More information about the Boulder-pm mailing list