Oberon Community Platform Forum
December 15, 2017, 01:05:16 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Uppercase keywords?  (Read 11982 times)
MarcMartin
Newbie
*
Posts: 2


« on: June 23, 2009, 12:31:39 AM »

Hello,

In checking out the Zonnon compiler, it appears that the compiler does not support uppercase keywords (MODULE, PROCEDURE, etc.), even though the language report says that it should.  Will the compiler ever support uppercase keywords, or is this going to be dropped from the language?

(it seems like it would be easier to port existing Oberon, Modula-2, or Component Pascal code if Zonnon supported uppercase keywords)

Thanks,

Marc
Logged
rmitin
Moderator
Newbie
*****
Posts: 22


« Reply #1 on: June 24, 2009, 03:52:56 PM »

Dear Marc,

Uppercase keywords were a good idea when syntax highlighting wasn't available.
Supporting both in my opinion can be only an intermediate stage so eventually it should be removed from the language.
Language report will be updated.
Porting can be supported by a relatively simple tool.

Thank you!

Roman
Logged
cfbsoftware
Full Member
***
Posts: 106


WWW
« Reply #2 on: June 25, 2009, 06:22:52 AM »

Uppercase keywords were a good idea when syntax highlighting wasn't available.

There are many other reasons why they are a good idea. Some that come to mind are:

a) As long as you avoid all-uppercase identifiers you know you can use *whatever* word is the best choice for a particular variable.

e.g.
   colour := black; type := digital; case := plastic;
   now := 2009; then := 1976;
   
b) It is useful to know that if you avoid using all-uppercase characters in your own identifiers your program will never be invalidated at some future time if, and when, new keywords are added to the language.

c) The language designer has the freedom to select the *most suitable* keyword for a new feature rather than trying to avoid a word that is likely to break existing software.

d) Syntax-highlighting might be useful when working on a screen but monochrome printed program text has yet to disappear altogether.

e) Syntax-highlighting is little benefit for those who suffer from colour blindness. I believe that this problem is more common (particularly for men) than most people imagine.

I am aware that the issue of uppercase keywords has been a favourite weapon for those who wished to attempt to denigrate languages such as Oberon / Modula-2.  I believe that the only real reason for complaint might be the attendant practical difficulties of typing sequences of uppercase letters. This has always been a problem for me (a three-fingered typist) as I generally avoid using Caps Lock: I always forget it is on, use the Shift key, and end up with a lowercase letter (grrrr!).

However, once the existence of a smart IDE that is capable of syntax-highlighting can be assumed, then either:

a) auto-capitalisation (as I have implemented in the editor used in both the Armaide and CPIde development systems) or

b) automatic keyword-generating shortcut keys

are really easy ways of overcoming any such practical typing difficulties.

Quote
Porting can be supported by a relatively simple tool.

It is not necessarily as simple as it might appear at first e.g. what happens after all keywords have been lower-cased in a program that includes the following:

start := 0;
end := 100;
FOR i := start TO end DO ...

If porting was 'relatively simple' then it would also be feasible (and trivial to implement in a compiler) to allow keywords to be mixed all-uppercase and all-lowercase in the same module.

I thought the initial Zonnon idea (IIRC: only allow either all-uppercase or all-lowercase depending on the case of the word MODULE) to be an excellent compromise. I was surprised to hear that it has not been implemented that way.
Logged

Chris Burrows
Astrobe v6.0 (Jun 2016): Oberon for ARM Cortex-M4 and Cortex-M3 Microcontrollers
http://www.astrobe.com
MarcMartin
Newbie
*
Posts: 2


« Reply #3 on: June 25, 2009, 06:18:59 PM »

Yes, I often look at snippets of code on a black & white printout, and the keywords do not stand out when viewed this way.  Perhaps if the environment printed these keywords out in bold, but Zonnon code in Visual Studio does not print out this way, and Zonnon Builder doesn't even print!

Marc
Logged
cfbsoftware
Full Member
***
Posts: 106


WWW
« Reply #4 on: June 26, 2009, 04:33:16 AM »

Perhaps if the environment printed these keywords out in bold, but Zonnon code in Visual Studio does not print out this way
The good news:
You can customise VS to do just about anything you want it to do Smiley

The bad news:
There are so many different ways to customise VS that it takes an age to find out how to get it to do just what you want  Sad

To set up VS to print Zonnon keywords in bold:

1. VS > Tools > Options > Environment > Fonts and colours

2. Select:

Show settings for: printer
Display items: Keyword

3. Check the 'Bold' checkbox.

Quote
and Zonnon Builder doesn't even print!

Really?! Perhaps I should think about adding a 'ZnIde' to my list of development products  Wink
Logged

Chris Burrows
Astrobe v6.0 (Jun 2016): Oberon for ARM Cortex-M4 and Cortex-M3 Microcontrollers
http://www.astrobe.com
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #5 on: February 23, 2010, 11:35:18 AM »

Uppercase keywords were a good idea when syntax highlighting wasn't available.

Supporting both in my opinion can be only an intermediate stage so eventually it should be removed from the language.
Language report will be updated.


In which version was it dropped?

Is there a chance of reintroducing the automagic switch on encountering MODULE vs. module.

Please do not drop upper case keywords finally. I would prefer upper case keywords too.

In my opinion it eases readability ...

regards
     Bernhard
Logged
schorsch
Newbie
*
Posts: 10


« Reply #6 on: July 31, 2010, 06:28:41 PM »

Using of upper case keywords used to be an element of Oberon culture. So dropping them would just make a transition for Oberon users more difficult.
Logged
Bernhard T.
Administrator
Full Member
*****
Posts: 164


« Reply #7 on: August 30, 2011, 12:37:05 PM »

Using of upper case keywords used to be an element of Oberon culture.
So dropping them would just make a transition for Oberon users more difficult.

they are dropped and I really do not like it ...
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!