Le 02/07/11 06:16, Gordon Burditt a écrit :
How many people can visually distinguish those possible signs from
each other?
Why? What problem are you attempting to solve?
At the start of the discussion, I was trying to get a modern
and aesthetically pleasing typography for programs. Why write
!= instead of the inequality sign from mathematics? There is
no reason.
But during the discussion, I have learned a bit, and now the
proposal should be extended:
o We should be able to format commentary text as in a simple
text editor (rtf) that would allow us to write diagrams that
explain the code instead of ridiculous Ascii drawings that
are extremely difficult to draw and do not pass through
reformatters
o We should end the digraphs of C and use the inequality sign
(in output) instead of !=, the assignment arrow instead of =,
the boolen \/ and /\ for OR and AND instead of || and &&,
etc.
The problem with documentation now, is that it must be written
outside the program, using a text editor that is in general
different from the programmer's editor. Obviously, as Ben said, I
could do thsi in wedit and be done with it, but actually that would be
a wrong solution since any user of this feature would be tied
to a single editor: impossible to use another since there
would be no standard way of editing programs.
Incidentally,
Unicode is well-known for the use of nearly-identical graphics
characters to try to get people and web browsers to interpret URLs
differently, and to exploit security holes.
Did you know that pointers are used in all exploits done so far?
Obviously we should ban pointers (and pointer+integer operations).
It seems that the *only* standardized way to refer to a character
is some wierd construct using a U and a bunch of numbers.
1. Who said whatever that character is after #define (that looks
like a question mark) is usable in an identifier?
Nobody said that. The problem with your news reader (tin) is
that is from february 2007 and kind of outdated, as you can
see now. Please get a newer version or a version that can
read/write utf8.
I don't understand
why you would want to use it as (part of) an identifier *and* as a
comparison operator?
I never said that. Please read again. I am proposing that != is replaced
with a single Unicode character (the inequality sign of mathematics)
2. How do you manage to #define the same character to five different
strings?
As I said before, your news reader displays only the alternative Unicode
sin (the question mark) since it is unable to display unicode.
3. How the heck do I type that character?
By pressing the "!" and then (after you have taken your finger away from
the "!") the "=" key. The sophisticated software behind your
programmer's editor translates those two characters into one, in the
same way that when you type an accentuated letter you type first
the accent, THEN the letter. OK?
Using something that looks like a *question mark* for assignment
would be extremely confusing.
Yes, I agree. But there was no question mark in my post. See above.
Using something that turns into a
*question mark* when posted to comp.lang.c would be even more
confusing.
Yes.
Why should we need a C-specific keyboard?
Because many C programmers do not need the "Paragraph" sign for instance.
It could be replaced with the... inequality sign!
The C language does not define a text editor.
It implicitly admits that the program text must be somehow
inputted into a computer system...
Besides, this proposal doesn't define an editor anyway. It would
propose an optional "enriched" form of programs that would replace
the digraphs of C with their Unicode equivalents and that would
reserve the sequences:
/*{\rtf
that should be followed by a matching
}*/
/*<HTML>
and
</HTML>*/
as the start of a rich text comment that should be displayed
as rich text if the text processor supports it.
You might be right about many editors supporting UTF-8. How many users
know how to use those features?
I would bet that there isn't a single programmer that has never used a
word processor. I am sorry but even you have used one.
And how many of those support UTF-8 on
a text console?
BSD is not very advanced in graphics and Unicode support maybe...
Get a Mac or a PC and use your favorite editor there, using BSD only to
run your code.