Prev: Need some help with a styles page
Next: Newbie question
From: Gary Peek on 9 Feb 2010 12:03 Jukka K. Korpela wrote: > Source code is indented using spaces, so why would it matter what > the widths of other characters are? To me, alignment of characters is nearly as important as alignment of tabbed or spaced indentations for understanding some code. A quick example is code that sends characters to a hardware device that displays only monospaced fonts, like a character LCD. By looking at the code you can tell what the display will look like. (This is what Thomas was probably referring to when he mentioned terminals.) (By the way, if someone displays assembly language code on a web page for me to copy and paste, I would prefer that they retain the tabs, so that when I paste it into my editor, things line up.) > ... since we are not discussing program _writing_ but about > _displaying_ computer code on a web page. When we display computer code on a web page, we might be doing it for different reasons. If we are displaying it for someone to copy and paste, the font does not matter. Sometimes alignment helps in understanding code though. --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Jukka K. Korpela on 9 Feb 2010 12:19 Gary Peek wrote: > Jukka K. Korpela wrote: >> Source code is indented using spaces, so why would it matter what >> the widths of other characters are? > > To me, alignment of characters is nearly as important as alignment > of tabbed or spaced indentations for understanding some code. Define "alignment of characters". > A quick example is code that sends characters to a hardware device > that displays only monospaced fonts, like a character LCD. Why would it matter how the _code_ is displayed? > (By the way, if someone displays assembly language code on a web > page for me to copy and paste, I would prefer that they retain > the tabs, so that when I paste it into my editor, things line up.) (How often does it happen, on this planet, that assembly language code is displayed for copy and paste? If I would do such a thing, I would put the assembly language code in a separate file, not put it inside HTML at all.) In HTML documents, tab characters have always been unsafe, and HTML specs have warned about them through millennia. > Sometimes alignment helps in understanding code though. Not a single case has been presented so far, and you haven't defined what "alignment" means here. -- Yucca, http://www.cs.tut.fi/~jkorpela/
From: Gary Peek on 9 Feb 2010 17:13 Jukka K. Korpela wrote: > Define "alignment of characters". Vertical alignment with the character above it. This image is comments in some assembly language code: http://www.industrologic.com/code-mono-proport.jpg Doesn't using a monospaced font for this make sense? (That is why I think the <code> tag causing a monospaced font is a good thing.) --- news://freenews.netfront.net/ - complaints: news(a)netfront.net ---
From: Jukka K. Korpela on 9 Feb 2010 17:23 Gary Peek wrote: > Jukka K. Korpela wrote: >> Define "alignment of characters". > > Vertical alignment with the character above it. Vertical alignment has absolutely nothing to do with monospace vs. other fonts. You're apparently very confused. -- Yucca, http://www.cs.tut.fi/~jkorpela/
From: Gary Peek on 9 Feb 2010 17:27
Jukka K. Korpela wrote: > (How often does it happen, on this planet, that assembly language code > is displayed for copy and paste? If I would do such a thing, I would put > the assembly language code in a separate file, not put it inside HTML at > all.) Surprisingly often. Some examples: http://plit.de/asem-51/simple.htm http://www.dreamincode.net/code/snippet1330.htm Of course if I have a lengthy program it will be in its own file. --- news://freenews.netfront.net/ - complaints: news(a)netfront.net --- |