Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > standard colour for C++

Reply
Thread Tools

standard colour for C++

 
 
Chor Lit
Guest
Posts: n/a
 
      01-04-2007
Hi,

I asked Bjarne Stroustrup about the idea of adding colour standard for
C++, and he said that it is very difficult for compiler vendors to
change their IDE. But do you think it is possible ? Note that the
proposed colour standard is not just merely to ease the eye only as
what presently is in C++ compilers, but to aid in syntax disambiguation
and other advantages.

Here are a few advantages that I can think of:

1. By allowing keywords and literals in different colours, C++ can
introduce new keywords easily because they are now living in different
'space'.

2.Colours can even be used to differentiate between the operator '>'
from the angle bracket '>' in template.

3. Also, names such as '1ABC' and '.ABC' will be acceptable because we
can always differentiate character '1' and '.' from thier usual type,
no confusion.

4. We can even drop the comment '//' and '/* */' since comment can also
be assigned a unique colour.

5. We can also assign a special colour to all overloaded operators to
differentiate from normal operators and dropped the keyword 'operator'
in the definition.

I believe there are plenty more advantages in using colours in C++.
There are a lot of details in C++ that I can't think of that might
benefit from using colour scheme in C++. I hope this will spark an idea
to the committee. What do you think ?

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      01-04-2007
Chor Lit wrote:
> I asked Bjarne Stroustrup about the idea of adding colour standard for
> C++, and he said that it is very difficult for compiler vendors to
> change their IDE. But do you think it is possible ? [..]


Everything is possible. What you're talking about, however, has nothing
to do with the language itself, really. It has everything to do with
products (like IDE or text editors) that exist independently of C++ as
a language. Most of them nowadays, however, provide some kind of colour
differentiation for elements of the language[s] (keywords, operators,
punctuation, types, variables, literals, etc.)

There is no "adding colour to C++" or "standard colour for C++". C++
is a _language_ with a bunch of syntactic and semantical rules, just
like English. How do you set standard colour for English, for example?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
Geo
Guest
Posts: n/a
 
      01-04-2007

Chor Lit wrote:
> Hi,
>
> I asked Bjarne Stroustrup about the idea of adding colour standard for
> C++, and he said that it is very difficult for compiler vendors to
> change their IDE. But do you think it is possible ? Note that the
> proposed colour standard is not just merely to ease the eye only as
> what presently is in C++ compilers, but to aid in syntax disambiguation
> and other advantages.
>
> Here are a few advantages that I can think of:
>
> 1. By allowing keywords and literals in different colours, C++ can
> introduce new keywords easily because they are now living in different
> 'space'.
>
> 2.Colours can even be used to differentiate between the operator '>'
> from the angle bracket '>' in template.
>
> 3. Also, names such as '1ABC' and '.ABC' will be acceptable because we
> can always differentiate character '1' and '.' from thier usual type,
> no confusion.
>
> 4. We can even drop the comment '//' and '/* */' since comment can also
> be assigned a unique colour.
>
> 5. We can also assign a special colour to all overloaded operators to
> differentiate from normal operators and dropped the keyword 'operator'
> in the definition.
>
> I believe there are plenty more advantages in using colours in C++.
> There are a lot of details in C++ that I can't think of that might
> benefit from using colour scheme in C++. I hope this will spark an idea
> to the committee. What do you think ?


And how would this work on my white on black VMS terminal ?

 
Reply With Quote
 
John Carson
Guest
Posts: n/a
 
      01-04-2007
"Victor Bazarov" <(E-Mail Removed)> wrote in message
news:enj5p0$j3j$(E-Mail Removed)
> Chor Lit wrote:
>> I asked Bjarne Stroustrup about the idea of adding colour standard
>> for C++, and he said that it is very difficult for compiler vendors
>> to change their IDE. But do you think it is possible ? [..]

>
> Everything is possible. What you're talking about, however, has
> nothing to do with the language itself, really. It has everything to
> do with products (like IDE or text editors) that exist independently
> of C++ as a language. Most of them nowadays, however, provide some
> kind of colour differentiation for elements of the language[s]
> (keywords, operators, punctuation, types, variables, literals, etc.)
>
> There is no "adding colour to C++" or "standard colour for C++". C++
> is a _language_ with a bunch of syntactic and semantical rules, just
> like English. How do you set standard colour for English, for
> example?



I believe that the OP was proposing that the user have the ability to
manually color source code and that the compiler would interpret source code
differently depending on the color chosen. Color can in principle be as much
a part of a language as letters.

--
John Carson


 
Reply With Quote
 
Eberhard Schefold
Guest
Posts: n/a
 
      01-04-2007
John Carson wrote:

> I believe that the OP was proposing that the user have the ability to
> manually color source code and that the compiler would interpret source code
> differently depending on the color chosen. Color can in principle be as much
> a part of a language as letters.


You're contradicting yourself. Either the specific /markup/ (distinct
for "comment", "variable" etc.) is significant and stored and only
presented in the user's color scheme. Or the actual /color/ is significant.

In the first case the markup would become part of the language standard,
not the color. Since everything has eventually be stored as a digital
file, storing the markup would simply mean a change in the language,
like tags. I don't think that would be very attractive.

In the latter case we would all have to use the same colors which would
have to specified with the language. I can't believe that you're
actually contemplating this idea for just one second. What about
developing on devices that don't support color? What about printing
code? What about posting code to a newsgroup? Books? Photocopies?
Microfiche? What about colors that are reserved socially/religiously in
a given culture? What about people who are color blind? How do you even
store the colors in a file (we're back to the tags here)? What if I
don't like red for a comment?

It's a joke, right?
 
Reply With Quote
 
Simon G Best
Guest
Posts: n/a
 
      01-04-2007
Chor Lit wrote:
> Hi,
>
> I asked Bjarne Stroustrup about the idea of adding colour standard for
> C++, and he said that it is very difficult for compiler vendors to
> change their IDE. But do you think it is possible ? Note that the
> proposed colour standard is not just merely to ease the eye only as
> what presently is in C++ compilers, but to aid in syntax disambiguation
> and other advantages.
>

....
>
> I believe there are plenty more advantages in using colours in C++.
> There are a lot of details in C++ that I can't think of that might
> benefit from using colour scheme in C++. I hope this will spark an idea
> to the committee. What do you think ?


Bad idea, I think, for various reasons (some of which are obvious, such
as colour-blindness).

One reason, that's perhaps not obvious to most people, is that it could
actually cause confusion for those with some kinds of synesthesia. It
would be like colour-coding the days of the week, and finding that those
with weekday-to-colour-scheme synesthesia (such as me) tend to miss
meetings, and turn up for meetings on the wrong days. Colour-code
something blue, on the basis that it's going to happen on Monday, and I
might actually miss it as a result. For me, Monday is most definitely
red. Depending on the shade of blue, I might even turn up for it on
Thursday!

Simon

--
What happens if I mention Leader Kibo in my .signature?
 
Reply With Quote
 
=?ISO-8859-15?Q?Juli=E1n?= Albo
Guest
Posts: n/a
 
      01-04-2007
John Carson wrote:

> I believe that the OP was proposing that the user have the ability to
> manually color source code and that the compiler would interpret source
> code differently depending on the color chosen. Color can in principle be
> as much a part of a language as letters.


Given that the source code is a stream of characters, there are no other way
to "add color" than to codify it. There is no difference between that and
adding keywords or punctuations.

And if you like colors, the IDEs are already able to paint them. I see no
substantial difference between a menu entry called "paint in green the
selection" and other called "comment out the selection". You just need an
option to hide the "/*" and the "*/" when syntax coloring is on, if you
dislike to see him. Same for any other color usage. You can also draw icons
or colored shapes in the menu entries.

Certainly color, shape, or any other thing (even whitespace) can be used as
syntactically significant elements. There are a bunch of esoteric
programming languages that do. But mainstream languages use just streams of
characters.

And let's not forget the many types of color blindness. And monochrome
listing devices.

--
Salu2
 
Reply With Quote
 
Markus Svilans
Guest
Posts: n/a
 
      01-04-2007

Chor Lit wrote:
> Hi,
>
> I asked Bjarne Stroustrup about the idea of adding colour standard for
> C++, and he said that it is very difficult for compiler vendors to
> change their IDE. But do you think it is possible ? Note that the
> proposed colour standard is not just merely to ease the eye only as
> what presently is in C++ compilers, but to aid in syntax disambiguation
> and other advantages.
>
> Here are a few advantages that I can think of:
>
> 1. By allowing keywords and literals in different colours, C++ can
> introduce new keywords easily because they are now living in different
> 'space'.
>
> 2.Colours can even be used to differentiate between the operator '>'
> from the angle bracket '>' in template.
>
> 3. Also, names such as '1ABC' and '.ABC' will be acceptable because we
> can always differentiate character '1' and '.' from thier usual type,
> no confusion.
>
> 4. We can even drop the comment '//' and '/* */' since comment can also
> be assigned a unique colour.
>
> 5. We can also assign a special colour to all overloaded operators to
> differentiate from normal operators and dropped the keyword 'operator'
> in the definition.
>
> I believe there are plenty more advantages in using colours in C++.
> There are a lot of details in C++ that I can't think of that might
> benefit from using colour scheme in C++. I hope this will spark an idea
> to the committee. What do you think ?



I'm going to have to go ahead and get you to forget that idea.

Thanks.

 
Reply With Quote
 
Max M.
Guest
Posts: n/a
 
      01-04-2007
Chor Lit wrote:
>
> What do you think ?


Not too funny. You should elaborate more, and write it in the form of an
academic paper. Stroustrup's article on whitespace overloading was much
funnier.

Max











 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      01-04-2007
Geo wrote:
> Chor Lit wrote:
>> [ill considered proposal to mandate code coloring in the Standard redacted]

>
> And how would this work on my white on black VMS terminal ?
>


Or for anyone who is color-blind?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the point of having 16 bit colour if a computer monitor can only display 8 bit colour? How do you edit 16 bit colour when you can only see 8 bit? Scotius Digital Photography 6 07-13-2010 03:33 AM
Getting default colour for <input> - or just the old colour jodleren Javascript 2 01-12-2008 02:57 PM
add pexpect to the standard library, standard "install" mechanism. funkyj Python 5 01-20-2006 08:35 PM
How standard is the standard library? steve.leach Python 1 04-18-2005 04:07 PM
Colour blindness, photography and colour management Tor Lillqvist Digital Photography 12 05-24-2004 08:57 AM



Advertisments