Typography of programs

D

Dr Nick

jacob navia said:
Le 02/07/11 11:22, Dr Nick a écrit :


I did not know that your editor can't display plain text.

Can you *please* lay off the "putting words into people's mouths" bit.
I never said that.
If I write NOW:

/*<html Some comment in html format </html>*/

your editor goes nuts?

No, but it's not exactly pretty to read when I'm trying to debug the
code. Admittedly, anyone who can't explain what's happening without
using HTML is probably writing the type of comment that the code is
easier to understand without.

Pretty soon we'll have the type of HTML that word throws out and for
every three words there'll be a mountain of embedded syntax.
It doesn't surprise you that when you write a web page
it looks the same in MANY web browsers? This is the same!

And if you do not want to use this feature you just don't,
since it is in commentaries, it can be safely ignored by older software
and you can stick to your old version of emacs.

There are versions of emacs for X windows, and they will display
html if they are updated to do so.

They will display HTML as HTML. I've never seen anything that renders
comments as HTML and C as syntax coloured C. Have you?

Anyway, yesterday you were talking about rtf. Today it's HTML. Which
is it?
[big snip]
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.

My favourite editor is Emacs! And unlike the Windows (presumably by PC
you mean "Windows machine" (PC meant personal computer many years before
Windows appeared) users I have no difficulty writing ≥ and its friends
when I need to.

Then what's the problem?

The problem is with the embedded graphics.
My proposals do not change C at all. They add an optional standard way
of writing programs using modern typesetting techniques like:

o bold face
o italics
o embedded graphics
o extended character sets.

You seem to be conflating two ideas:

a) some form - type variable - of marking up comments etc. This is
entirely possible but without a standard and being available everywhere
will make comments less rather than more understandable to most. But
the code will work everywhere.

b) changing the underlying syntax of C to support an extended character
set. That's a much bigger can of worms as it /will/ break all existing
toolsets.
 
D

Dr Nick

jacob navia said:
We could have in some isoXXX.h
#define ≠ !=
#define â‹€ and
#define â‹ or

You know, there's quite some difference between && and â‹€ and between ||
and â‹ - shortcutting in particular.
#define ≤ <=
#define ≥ >=

etc.

That "etc." leaves a lot open. How about replacing sqrt( with √ ?

Using ↠for assignment would avoid the common beginner's error of
using = instead of == and programs would look less horrible.

why not replace == with ≡ while you are at it?
All this would be done first in output only to avoid requiring a new C
keyboard even though that can be done later. You would still type !=
but you would obtain ≠ in output in the same way that you type first the
accent, then the later under the accent and you obtain one character.

Surely that's an editor independent thing and nothing to do with the
language. I entered the last of these, for example, by typing "Alt-x,
ucs-insert [return], identical to"
 
M

Michael Press

Joe Wright said:
Only 0..127 are already ASCII. Extended Binary Coded Decimal Interchange
Code ranges 0..255. How hard is it to convert? The 128 ASCII codes have
been well defined many years. There is only one ASCII code set. IBM's
EBCDIC has not one definition, but several. You cannot convert EBCDIC to
ASCII generally.

Some web page authors claim that EBCDIC codes are not
fully disclosed by IBM. Can you say anything about that?
 
A

Alan Curry

Actually, when C was conceived there weren't any bit mapped graphics
or any such hardware that we now consider common place.

The typography of C remained the same, as all other computer languages,
obsessed with the character sets from 32 to 127 ASCII codes. Then, we
write != instead of the inequality sign, = instead of the assignment
arrow, "&&" instead of /\, "||" instead of \/.

When those symbols were conceived, there weren't any computers. There
wasn't any limit to the number of different squiggles that could be put
down on paper because people were doing it with pens (and, I assume,
periodically venturing out to kill a squid for the ink and a bird for
the feather). Now we have keyboards, which allow us to write much
faster.
Programs would be clearer if we would use today's hardware to show
the usual signs, instead of constructs adapted to the teletype
typewriter of the seventies.

Programs would be clearer if we would get rid of some excess punctuation
characters (ASCII has 33 of them, that's too many already). Like the
backslash. What the hell is a backslash anyway? It's not even a real
punctuation mark. Bob Bemer made it up in the middle of the 20th century
and it's been confusing and annoying people ever since.

In summary:

Have you ever considered that maybe the biggest symbol set isn't
automatically the best?
 
H

Herbert Rosenau

WHY must be the huge majority of users that develop on workstations be
constrained to develop as if we all use an old teletype ?

And please do not come with embedded systems development since
development in all those systems is done with a cross compiler
using a PC or a mac as development environment.

And "jump through hoops" doesn't cut it either since
it would be VERY difficult to find a development environment
where there isn't any workstation (PC/Mac/Linux) and all
terminals are old 3270s.

That is because the world is wider than the most current crap from an
properitary software conzern in the northern half of amerika.

Stop spamming for your properitary compiler that is not really a C
compiler and does not support the absolute mayority of CPUs and OSes
beside the crap coming out of redmont, USA.

Even as my OS is running on 64 bit PC it has nothimng to do with
redmont (even as some of its 16 bit grand parents has one parent from
there). I don't own a keyboard that has an keypad with an symbol
looking like a house you uses todefine most of the operators C uses to
assign or compare values.

So your properitary compiler is senseless for that OS and any other OS
too. Spamming for it is childish and shows only that you are an
ignorant.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 2.0 ist da!
 
H

Herbert Rosenau

If you put 10 programmers in a room with the same IDE, you'll end up
with 10 different editor set-ups.
No, at least 30 differnt ones, if not 300. I use 20 depending on the
type of file I'm editing, e.g. C (PC), C (/390), different assembly,
plain text german, plain text english, perl, php, ........

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 2.0 ist da!
 
H

Herbert Rosenau

Really? Because I often use a terminal which uses 8-bit characters,
specifically ISO 8859-1, and I am pretty sure it does not handle UTF-8.

I use ISO 8859-15 because that reflects the keyboard layout of my
keyboard, mother language, word processor, OS, and so on more than -1
as that does not know some glyphes my mother language needs to reflect
is native alphabeth. The world is much wider than only US english.

--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 2.0 ist da!
 
J

jacob navia

Le 03/07/11 00:21, Herbert Rosenau a écrit :
Stop spamming for your properitary compiler that is not really a C
compiler and does not support the absolute mayority of CPUs and OSes
beside the crap coming out of redmont, USA.

Herbert!!

Mein Gott... you again with your delicious word salads, I missed you so
much.
Even as my OS is running on 64 bit PC it has nothimng to do with
redmont

YOUR OS?

Ahh I understand now. You are a competitor of microsoft, that's why you
hate them so much. But do not worry, you will prevail. "redmont" is
going down the drain replaced by "kuppertino", another "crap coming
from the USA".

(even as some of its 16 bit grand parents has one parent from

You had 16 bit grand parents Herbert? I didn't know that, thats
"REALLY NEWS".

Because MY grand parents are pure 32 bits I promise you.

I don't own a keyboard that has an keypad with an symbol
looking like a house

I do
/\
/ \
----
O O
| |
----

you uses todefine most of the operators C uses to
assign or compare values.

Yes Herbert yes, you are right (as always)
So your properitary compiler is senseless for that OS and any other OS
too.

Of course. I am the devil in person.

Spamming for it is childish and shows only that you are an
ignorant.

I am.

And have a nice week end Herbert. Nice to hear from you again.

jacob
 
M

Michael Press

Nobody said that.

Incidentally, I dumped in hex the characters from that article. As
I received it, those are *question marks*, not unicode characters.
And it's not my newsreader doing it, because it wasn't involved in
refetching it.[/QUOTE]

I got a different result with telnet to port 110
of a news server.

Here is the relevant part of a hex dump.

0000a00: 2073 6f6d 6520 6973 6f58 5858 2e68 0d0a some isoXXX.h..
0000a10: 2364 6566 696e 6520 e289 a020 213d 0d0a #define ... !=..
0000a20: 2364 6566 696e 6520 e28b 8020 616e 640d #define ... and.
^^^^ ^^

0000a30: 0a23 6465 6669 6e65 20e2 8b81 206f 720d .#define ... or.
^^^^ ^^

0000a40: 0a23 6465 6669 6e65 20e2 89a4 203c 3d0d .#define ... <=.
0000a50: 0a23 6465 6669 6e65 20e2 89a5 203e 3d0d .#define ... >=.

The body of the article is encoded with UTF-8.

e2 8b 80
11100010 10001011 10000000
0010 001011 000000
00100010 11000000
U+22C0

e2 8b 81
11100010 10001011 10000001
U+22C1

U+22C0 and U+22C1 are the wedge and vee signs respectively; /\ and \/.
As a matter of fact, my newsreader also failed to render them.
 
N

Nick Keighley

Le 02/07/11 06:16, Gordon Burditt a écrit :

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?

I agree it would look more aesthetically pleasing. I used a Pascal
system (Lightning?) on an old Mac (pre-Mac OSS) that displayed things
prettily (much nicer then modern syntax hilighters (or the ones that
I've seen))
There is no reason.

well there are reasons. And plenty of people have pointed them out.

If we were designing from scratch there would be strong arguments for
using some richer internal representation (XML? ug!) which editors
would then display to the liking and hardware availablity of the user.

But legacy C code is in ASCII and runs on systems that don't support
much more. I know of live systems that compile on old Suns using K&R
C. I made a mod to a K&R program only 12 months ago.

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.

invent an XML format for the representation of literate programs?

Did you know that pointers are used in all exploits done so far?
Obviously we should ban pointers (and pointer+integer operations).

:)

I don't think *all* exploits use pointers. Microsoft's executable
format might have caused a few problems.


<snip>
 
N

Nick Keighley

[...] when C was conceived there weren't any bit mapped graphics
or any such hardware that we now consider common place.

The typography of C remained the same, as all other computer languages,
obsessed with the character sets from 32 to 127 ASCII codes.

Algol-60 allowed for different reprentations of the text. Algol-60 was
intended to be published with proper "not equal" "not" "and" "or" etc.

It's just taken 50 years for the rest of the world to catch up.

Then, we
write != instead of the inequality sign, = instead of the assignment
arrow, "&&" instead of /\,  "||" instead of \/.

<snip>
 
H

Herbert Rosenau

Le 02/07/11 06:16, Gordon Burditt a écrit :

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

Simply NO. There are different interpretations of ASCII beside
something national language differenes. YASCII on DOS or DOS derivates
is different from ASCII on MAC is different from ASCII on unix/linux.
They are not compatible without transforming line end character(s)
from one sy<stem to another one.
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.
NO.

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.

I have written 100% of program documentation inside C source 20 years
ago. Whereas the compiler has nothing seen from than plain C comment
and the underlying documentation processor has produced well formatted
books as if I had written the documentation in PDF without C code.
Did you know that pointers are used in all exploits done so far?
Obviously we should ban pointers (and pointer+integer operations).

Why? Because Jacob naivia is unable to understund how pointer and
pointer arithmetics works?
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.

Oh, my newsreader is from 2010 and is setup right for use on my OS
that is not using US english but german in a way that it is able to
use use the keyboard layout prepared to use my national language right
without type some of its native charaters as Alt+<some obvious decimal
code> but by typing the key holding the native symbol.

So I can type <>=&%!#/+* like öäüßÖÄÜ and need AltGr only for |\ and ~
instead of the shift caps key. That is much more easy than to remember
Alt+ said:
I don't understand

I never said that. Please read again. I am proposing that != is replaced
with a single Unicode character (the inequality sign of mathematics)

You are lying. You says that you would like that anybody has to use
Alt+ said:
As I said before, your news reader displays only the alternative Unicode
sin (the question mark) since it is unable to display unicode.

That is because the system is using an keyboard with a fixed number of
keys associated with the national assigned glyphes istead lots of not
really needed symbols and the display encoder is using the same to
display them.
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?

And that produces really not only != but any of the different glyphes
you have produced? Really?
Yes, I agree. But there was no question mark in my post. See above.

Yes, but instead of a singe question mark you have used a symbol like
^
||
_

and you means really that this single symbol is a good replace for
multiple ones?
Because many C programmers do not need the "Paragraph" sign for instance.
It could be replaced with the... inequality sign!

Ha, I need the § sign when I cdo write my lawayer, and öäüÜÄÖß while
native german and I don't like to change the keyboard only because I
have time to edit on C sources.


--
Tschau/Bye
Herbert

Visit http://www.ecomstation.de the home of german eComStation
eComStation 2.0 ist da!
 
K

Kleuskes & Moos

Simply NO. There are different interpretations of ASCII beside
something national language differenes. YASCII on DOS or DOS derivates
is different from ASCII on MAC is different from ASCII on unix/linux.
They are not compatible without transforming line end character(s)
from one sy<stem to another one.

Ummm... End of line conventions are _not_ part of ASCII. ASCII only
defines \r and \n, how various OS's use those is a different kettle of
fish.
 
K

Keith Thompson

Kleuskes & Moos said:
Ummm... End of line conventions are _not_ part of ASCII. ASCII only
defines \r and \n, how various OS's use those is a different kettle of
fish.

ASCII defines CR and LF; \r and \n are C-specific notations (which have
also been picked up by a number of other languages).
 
S

Seebs

Get a Mac.

If your feature suggestion for an "improvement" to the language starts by
throwing out 80% or more of the market, it is a bad feature suggestion.

-s
 
M

Michael Press

Herbert Rosenau said:
Ha, I need the § sign when I cdo write my lawayer, and öäüÜÄÖß while
native german and I don't like to change the keyboard only because I
have time to edit on C sources.

Diacritical marks are for people who do not
remember how to pronounce their own language.
 
S

Seebs

Since you're claiming Micrsoft, Linux, etc are too firmly rooted in the glass
TTY software of the 1980s, for your own sake get some modern software.

What's the "glass TTY software of the 1980s" got to do with anything?

None of the symbols you describe are on my keyboard. Typing them cannot
be other than intrusive and unpleasant. At the bare minimum it requires me to
memorize some number of key sequences which are not labeled on the keycaps,
or to use some elaborate software keyboard thing.

There are two problems with your proposed solution of "get a mac".
1. It's arrogant and not actually a viable option on the table for the
vast majority of the people working with C right now.
2. It doesn't even solve the problem, so why bother?
If Apple
is the only company bravely stridely into the year 2001, go with Apple.

If you will offer me a steady job paying at least as much as my current
job does, which does not in any way require me to use Linux or MS machines,
then I will consider your suggestion.

Briefly.

Then I will tell you to bugger off because the software you describe is
but a MINISCULE portion of what I care about.

I care whether my code compiles in a variety of compilers, many of which
have no support for your proposed typography. I care whether I can reliably
print C code out in the fonts that happen to be available on a given printer,
not just in a tiny subset of available fonts. I care whether I can send
people C code with reasonable confidence that they will be able to read it,
whether it will display correctly in web fora, and so on and so forth.

I do not think it exaggeration to say that, in a typical year, I interact
with *hundreds* of distinct piece of software which need to be able
to read, display, or otherwise interact with C code, but which may not have
sufficiently-stable UTF8 support for this to work.

Meanwhile, the proposed benefit is... what, exactly? I don't see any. I've
been used to the idea that some symbols are expressed with more than one
character for a very long time now, ;-), and I don't feel a pressing need
to replace two characters which work reliably on all of my machines with a
single character which works reliably on none of them.

I'm typing this on a Mac, using ssh to another Mac which is running
a natively-compiled newsreader... And all I see for your proposed symbols
is "?". Maybe something somewhere could be reconfigured. Maybe I picked
the wrong font for Terminal, or the wrong terminal name for my ssh, or
maybe screen is doing something, maybe slrn doesn't support UTF8, maybe the
news server garbled it... I don't know, and I frankly don't care.

This is a dumb idea. There are real, significant advantages to making the
core language typeable using plain ASCII, and these advantages continue to
apply even if you're working entirely in an environment with pretty good
unicode support.

We have not yet reached the point where it is reasonably safe to assume that
a web page which attempts to encode "smart quotes" will display correctly
on the top five or so popular browsers with their default settings. If you
think that, in such a world, it is even close to sane to suggest that we
make a programming language depend on such things for displaying common
operators... well, that's beyond what I can help.

-s
 
S

Stephen Sprunk

Have you ever considered that maybe the biggest symbol set isn't
automatically the best?

Try telling that to the nice folks over at the Unicode Consortium--or
the populations of China and Japan.

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,952
Messages
2,570,111
Members
46,691
Latest member
Wilhemina5

Latest Threads

Top