[hybi] Protocol simplicity and the "amateur programmer" standard

Maciej Stachowiak <mjs@apple.com> Mon, 26 July 2010 00:42 UTC

Return-Path: <mjs@apple.com>
X-Original-To: hybi@core3.amsl.com
Delivered-To: hybi@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id B92103A6838 for <hybi@core3.amsl.com>; Sun, 25 Jul 2010 17:42:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -105.299
X-Spam-Level:
X-Spam-Status: No, score=-105.299 tagged_above=-999 required=5 tests=[AWL=-1.300, BAYES_50=0.001, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UfJVY8IIaAM6 for <hybi@core3.amsl.com>; Sun, 25 Jul 2010 17:42:47 -0700 (PDT)
Received: from mail-out4.apple.com (mail-out4.apple.com [17.254.13.23]) by core3.amsl.com (Postfix) with ESMTP id 7CAAF3A67EC for <hybi@ietf.org>; Sun, 25 Jul 2010 17:42:47 -0700 (PDT)
Received: from relay11.apple.com (relay11.apple.com [17.128.113.48]) by mail-out4.apple.com (Postfix) with ESMTP id 236E8A547F2C for <hybi@ietf.org>; Sun, 25 Jul 2010 17:43:08 -0700 (PDT)
X-AuditID: 11807130-b7ca5ae000007de4-0f-4c4cda1b32c0
Received: from gertie.apple.com (gertie.apple.com [17.151.62.15]) by relay11.apple.com (Apple SCV relay) with SMTP id B9.7E.32228.B1ADC4C4; Sun, 25 Jul 2010 17:43:08 -0700 (PDT)
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: text/plain; charset="us-ascii"
Received: from [10.0.1.5] (c-69-181-42-237.hsd1.ca.comcast.net [69.181.42.237]) by gertie.apple.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 32bit)) with ESMTPSA id <0L6500KLO3BVOP60@gertie.apple.com> for hybi@ietf.org; Sun, 25 Jul 2010 17:43:07 -0700 (PDT)
From: Maciej Stachowiak <mjs@apple.com>
Date: Sun, 25 Jul 2010 17:43:07 -0700
Message-id: <ECF0E97F-1DA2-4662-BA48-F68B65AA8179@apple.com>
To: Hybi <hybi@ietf.org>
X-Mailer: Apple Mail (2.1081)
X-Brightmail-Tracker: AAAAAQAAAZE=
Subject: [hybi] Protocol simplicity and the "amateur programmer" standard
X-BeenThere: hybi@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: Server-Initiated HTTP <hybi.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/hybi>
List-Post: <mailto:hybi@ietf.org>
List-Help: <mailto:hybi-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/hybi>, <mailto:hybi-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 26 Jul 2010 00:42:48 -0000

I recently had an IRC discussion with Ian Hickson about the "amateur programmer" standard, and what level of programmer simplicity we should strive for: <http://krijnhoetmer.nl/irc-logs/whatwg/20100725#l-92>.

Personally, I think the "amateur programmer" standard is a misguided goal, for the following reasons:

1) There is no example of any protocol ever that had significant deployment, where even casual programmers of simple programs would regularly implement it from scratch. Even for fairly trivial protocols like IRC, most people use libraries or stock implementations. Given the lack of existing examples of a protocol that amateurs actually implement, it may be that it's fundamentally not possible to design such a thing. It would be foolish to try to do the impossible. And even if it is possible but no one has yet succeeded, it is risky to experiment like this when the stakes are high.

2) I think a large part of the complexity in implementing a protocol truly from scratch (with no help from libraries) is the need to use extremely low-level primitives like Unix system calls. Use of very low-level primitives like socket(), bind(), listen(), accept(), read() and select() is likely beyond the capabilities of a true amateur or casual programmer, even for the most trivial protocol. Even for those who are able to correctly use these kinds of primitives, they likely would prefer to use a library or server framework for a casual project.

3) My supporting evidence for #2 is that in the case of nearly any kind of programming problem, when there is a choice between building from scratch with very low-level primitives and using higher-level APIs, casual programmers almost always choose higher-level APIs. I can't think of any instance where it's common to do otherwise.


Faced with these arguments, Ian proposed an alternate standard of "Keep the protocol as simple as possible to limit the number of bugs that professional programmers make." Ian thinks this is effectively equivalent to the "amateur programmer" standard, while I and likely many others on the list would expect there to be material differences. 

For one thing, I think it will be much easier for us to evaluate complexity against this standard. I don't think we have any true casual programmers on the list. While some active participants do not primarily do programming for a living, everyone here is an outlier in technical expertise, particularly in the ares of networking and Web technology. On the other hand, we have a number of people who work as implementors of network servers, networking libraries, and network-related middleware. It seems more sensible to me to pick a standard that we can directly evaluate based on the experiences of Working Group members. It makes more sense to me to evaluate our own understanding than to try to imagine what things are like for others.

To sum up, would anyone object to the following as a standard for protocol simplicity, in place of the proposed "amateur programmer" standard:

* Keep the protocol as simple as possible to limit the number of bugs that professional programmers make.


Regards,
Maciej