Re: Named Integers

From: [at]} <Rex>
Date: Mon, 06 Dec 2004 16:32:19 -0600

----boundary-LibPST-iamunique-1683200258_-_-
Content-type: text/plain

Stan Warford wrote:
> (f: Frame) MarkRect (l, t, r, b, s: INTEGER; mode: MarkMode; show:
> BOOLEAN), NEW;
>
> ...The parameter list of MarkRect is _not_ self-documenting. All you know
> by looking at formal parameter mode is that it is an integer....
>
> It was a source

> of irritation to see an integer parameter in a formal parameter list and
> not
> know immediately which set of integer constants applied to it. I think one
> reason it has been a hard sell to the folks at Oberon microsystems is that
> they are so familiar with the framework that they forget what it is like
> for
> a novice to be learning BB for the first time.

        I think Stan has identified the problem exactly, except that it is not limited to novices. Indeed, almost nothing in the parameters list is self-documenting. And typically, there are rarely enough comments. That's a major problem with modern software--it's too darned time-consuming to read, and too darned hard to learn.

        Most of the target audience for any programming language or environment is people whose job only peripherally involves programming. If you appeal only to specialists, you won't even appeal to the great majority of programmers. It's impossible to make code too easy to read.


>As I understand it, 90% of the
> difficulty of implementing enumerated types is the type checking that must

> occur across modules.

        According to Wirth's paper "From Modula to Oberon", the problem is that enumerated types are difficult to extend across modules. He also opposed proliferation of types. In typical Wirth fasion, rather than implement enumerated types perfectly, he simply discarded the feature.

        Stan's proposed named integers _is_ simple and extensible, and could encourage improvement in readability of code. It loses clarity if you extend it, but after all, what are comments for?

Sincerely,
Rex Couture, Ph. D.
Dept. of Earth and Planetary Sciences
Campus Box 1169
Washington University in St. Louis
1 Brookings Dr.
St. Louis MO 63130

Voice: (314) 935-4194
Fax: (314) 935-7361
rex{([at]})nowhere.xy
--------------------------------------------

To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:
   blackbox-request{([at]})nowhere.xy

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
   owner-blackbox{([at]})nowhere.xy

Current posting policy:

a) To post you should use the same address by which you are subscribed to the mailing list. That way, the list server will recognize you as subscriber and forward your posting immediately, without creating any overhead.

b) If, for some reason, you cannot post from the address, by which you are subscribed, your message will be moderated to avoid spam. Please understand that moderation will often cause some delay, in particular over weekends or holydays.


----boundary-LibPST-iamunique-1683200258_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"

e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwIFN0YW4gV2FyZm9yZCB3cm90ZTpccGFyDQo+IChm
OiBGcmFtZSkgTWFya1JlY3QgKGwsIHQsIHIsIGIsIHM6IElOVEVHRVI7IG1vZGU6IE1hcmtNb2Rl
OyBzaG93OiBccGFyDQo+IEJPT0xFQU4pLCBORVc7XHBhcg0KPiBccGFyDQo+IC4uLlRoZSBwYXJh
bWV0ZXIgbGlzdCBvZiBNYXJrUmVjdCBpcyBfbm90XyBzZWxmLWRvY3VtZW50aW5nLiBBbGwgeW91
IGtub3dccGFyDQo+IGJ5IGxvb2tpbmcgYXQgZm9ybWFsIHBhcmFtZXRlciBtb2RlIGlzIHRoYXQg
aXQgaXMgYW4gaW50ZWdlci4uLi5ccGFyDQo+XHBhcg0KPiBJdCB3YXMgYSBzb3VyY2VccGFyDQo+
IG9mIGlycml0YXRpb24gdG8gc2VlIGFuIGludGVnZXIgcGFyYW1ldGVyIGluIGEgZm9ybWFsIHBh
cmFtZXRlciBsaXN0IGFuZCBccGFyDQo+IG5vdFxwYXINCj4ga25vdyBpbW1lZGlh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bnQgcG9zdGluZyBwb2xpY3k6XHBhcg0KXHBhcg0KYSkgVG8gcG9zdCB5b3Ug
c2hvdWxkIHVzZSB0aGUgc2FtZSBhZGRyZXNzIGJ5IHdoaWNoIHlvdSBhcmUgc3Vic2NyaWJlZCB0
byB0aGUgbWFpbGluZyBsaXN0LiBUaGF0IHdheSwgdGhlIGxpc3Qgc2VydmVyIHdpbGwgcmVjb2du
aXplIHlvdSBhcyBzdWJzY3JpYmVyIGFuZCBmb3J3YXJkIHlvdXIgcG9zdGluZyBpbW1lZGlhdGVs
eSwgd2l0aG91dCBjcmVhdGluZyBhbnkgb3ZlcmhlYWQuXHBhcg0KXHBhcg0KYikgSWYsIGZvciBz
b21lIHJlYXNvbiwgeW91IGNhbm5vdCBwb3N0IGZyb20gdGhlIGFkZHJlc3MsIGJ5IHdoaWNoIHlv
dSBhcmUgc3Vic2NyaWJlZCwgeW91ciBtZXNzYWdlIHdpbGwgYmUgbW9kZXJhdGVkIHRvIGF2b2lk
IHNwYW0uIFBsZWFzZSB1bmRlcnN0YW5kIHRoYXQgbW9kZXJhdGlvbiB3aWxsIG9mdGVuIGNhdXNl
IHNvbWUgZGVsYXksIGluIHBhcnRpY3VsYXIgb3ZlciB3ZWVrZW5kcyBvciBob2x5ZGF5cy5ccGFy
DQp9


----boundary-LibPST-iamunique-1683200258_-_---
Received on Mon Dec 06 2004 - 23:32:19 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:28:29 UTC