- Uppercase Keywords (was BB: The future: Is there one?)

From: CFB Software <"CFB>
Date: Sun, 21 May 2006 23:39:33 +0930

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

> -----Original Message-----
> From: blackbox{([at]})nowhere.xy
> Behalf Of CFB Software
>
> > -----Original Message-----
> > From: blackbox{([at]})nowhere.xy
> > Behalf Of Les May
> >
> > The case sensitivity and the
> > use of upper
> > case for keywords is a nuisance. How nice it would be to have
> > an editor
> > which accepts any case and changes it to upper case automatically.

> > Perhaps BB has one already and I just have not found it.

> >
>
> I wrote a keyword convertor that takes an existing text and
> converts all
> of the lowercase Component Pascal keywords and reserved words to
> uppercase. If you cannot find anything else and are interested I can
> make it available.
>

Since my earlier reply I've carried out a few tests and decided that a
non-discriminating keyword convertor is not such a good idea after all.
I used it on a random sample of half-a-dozen Component Pascal source
code examples written by different authors and compared the conversion
with the original. They should have been identical. However, that was
not the case as they all happen to make use of lower-case equivalents of
keywords as valid identifiers, e.g. 'type', 'mod', 'size' and 'of'. Time
taken fixing up the mistakenly converted identifiers negates any
advantage of the tool.

A simpler less-automatic solution is a case-conversion 'hotkey' which
just converts the current selected word. I think you'll find such a
function in Fyodor Tkachov's Epse21 project in Helmut Zinn's Component
Pascal Collection:

http://www.zinnamturm.de/
 
Personally, I find it easier to accept a particular situation if I feel
that there was some careful reasoning behind the design rather than it
being the result of an arbitrary decision or whim. In the case of

anything designed by Wirth this can usually be safely assumed.

My experience with the convertor highlights one of the advantages of
Component Pascal - as long as you avoid using all uppercase when naming
identifiers you will never clash with a reserved word, either now or in
the future - even if the language is extended in an unforeseen way.

Other advantages associated with the use of case-sensitivity and
uppercase keywords include readability, faster searches, fewer false
search results and quicker compilation times. These are likely to have
been the main design considerations when Oberon was initially designed.

Admittedly, however, these issues are no longer quite as significant as
they were then - about twenty years ago. Colour, instead of monochrome
screens are now the norm, so colour has taken the place of uppercase for
highlighting keywords. Also, it is now much easier to get away with
processing inefficiencies because of the exorbitant amount of computing
power we have at our fingertips.

--
Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp
--- BlackBox
--- send subject HELP or UNSUBSCRIBE to blackbox{([at]})nowhere.xy----boundary-LibPST-iamunique-1333654407_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJuXGZjaGFyc2V0MCBDb3VyaWVyIE5ldzt9fQ0Ke1xj
b2xvcnRibFxyZWQwXGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTI1NTt9DQpcdWMxXHBh
cmRccGxhaW5cZGVmdGFiMzYwIFxmMFxmczIwID4gLS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS1c
cGFyDQo+IEZyb206IGJsYWNrYm94QG9iZXJvbi5jaCBbbWFpbHRvOmJsYWNrYm94QG9iZXJvbi5j
aF0gT24gXHBhcg0KPiBCZWhhbGYgT2YgQ0ZCIFNvZnR3YXJlXHBhcg0KPiBccGFyDQo+ID4gLS0t
LS1PcmlnaW5hbCBNZXNzYWdlLS0tLS1ccGFyDQo+ID4gRnJvbTogYmxhY2tib3hAb2Jlcm9uLmNo
IFttYWlsdG86YmxhY2tib3hAb2Jlcm9uLmNoXSBPblxwYXINCj4gPiBCZWhhbGYgT2YgTGVzIE1h
eVxwYXINCj4gPlxwYXINCj4gPiBUaGUgY2FzZSBzZW5zaXRpdml0eSBhbmQgdGhlIFxwYXINCj4g
PiB1c2Ugb2YgdXBwZXIgXHBhcg0KPiA+IGNhc2UgZm9yIGtleXdvcmRzIGlzIGEgbnVpc2FuY2Uu
IEhvdyBuaWNlIGl0IHdvdWxkIGJlIHRvIGhhd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aXRlIGFzIHNpZ25p
ZmljYW50IGFzXHBhcg0KdGhleSB3ZXJlIHRoZW4gLSBhYm91dCB0d2VudHkgeWVhcnMgYWdvLiBD
b2xvdXIsIGluc3RlYWQgb2YgbW9ub2Nocm9tZVxwYXINCnNjcmVlbnMgYXJlIG5vdyB0aGUgbm9y
bSwgc28gY29sb3VyIGhhcyB0YWtlbiB0aGUgcGxhY2Ugb2YgdXBwZXJjYXNlIGZvclxwYXINCmhp
Z2hsaWdodGluZyBrZXl3b3Jkcy4gQWxzbywgaXQgaXMgbm93IG11Y2ggZWFzaWVyIHRvIGdldCBh
d2F5IHdpdGhccGFyDQpwcm9jZXNzaW5nIGluZWZmaWNpZW5jaWVzIGJlY2F1c2Ugb2YgdGhlIGV4
b3JiaXRhbnQgYW1vdW50IG9mIGNvbXB1dGluZ1xwYXINCnBvd2VyIHdlIGhhdmUgYXQgb3VyIGZp
bmdlcnRpcHMuIFxwYXINClxwYXINCi0tXHBhcg0KQ2hyaXMgQnVycm93c1xwYXINCkNGQiBTb2Z0
d2FyZVxwYXINCmh0dHA6Ly93d3cuY2Zic29mdHdhcmUuY29tL2dwY3BccGFyDQpccGFyDQotLS0g
QmxhY2tCb3hccGFyDQotLS0gc2VuZCBzdWJqZWN0IEhFTFAgb3IgVU5TVUJTQ1JJQkUgdG8gYmxh
Y2tib3hAb2Jlcm9uLmNoXHBhcg0KfX0AMTI6NA==
----boundary-LibPST-iamunique-1333654407_-_---
Received on Sun May 21 2006 - 16:09:33 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:59 UTC