www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Re: Is D the Answer to the One vs. Two Language High ,Performance

reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Sun, Aug 11, 2013 at 04:33:26PM -0700, Andrei Alexandrescu wrote:
 On 8/11/13 12:00 PM, Nick Sabalausky wrote:
On Sun, 11 Aug 2013 11:25:02 -0700
Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> wrote:
For a column of text to be readable it should have not much more
than 10 words per line. Going beyond that forces eyes to scan too
jerkily and causes difficulty in following line breaks. Filling an
A4 or letter paper with only one column would force either (a) an
unusually large font, (b) very large margins, or (c) too many words
per line.  Children books choose (a), which is why many do come in
that format.  LaTeX and Word choose (b) in single-column documents.

The solution is to have adaptive layout that adapts itself to your screen. I personally prefer single-column with no more than about 40 ems in width or thereabouts. Anything more than that, and it becomes uncomfortable to read. Actually, another interesting idea is left-to-right scrolling instead of vertical scrolling. You'd lay out the text in columns that exactly fit the height of the screen, and have as many columns as needed to fit the entire text. If that exceeds the screen width, scroll horizontally. [...]
Multicolumn is best for screen reading, too. The only problem is
there's no good flowing - the columns should fit the screen. There's
work on that, see e.g.

Fixing the number of columns is bound to fail, because user screen dimensions cannot be predicted in advance. The only *real* solution is to use an adaptive layout algorithm that adapts itself as needed.
A. HTML has good flowing, and has had it since freaking v1. No need
for upcoming CSS tricks: As long as the author doesn't go and do
something retarded like use a fixed layout or this new "zoom out
whenever the window shrinks" lunacy, then all any user ever has to do
is adjust the window to their liking.

Clearly HTML has made good progress toward reaching good formatting, but is not quite there yet.

Ugh. I don't consider HTML as good formatting at all. HTML+CSS still has these shortcomings: - No full justification by default. Existing justification schemes could be improved (most implementations suffer from rivers of whitespace in a justified paragraph -- they could learn from LaTeX here). Needs native hyphenation support (using JS to patch up this flaw is a failure IMO). - Text width should be limited to 40em by default. - Many layout solutions require CSS circumlocutions and hacks, because CSS simply isn't expressive enough for many formatting needs. This causes spotty browser support and fragility. - Pixel sizes should be banned, as well as hard-coded font sizes. These tie you to assumptions about specific user screen dimensions, which are almost always wrong. In this day and age, the only real solution is a fully dynamically adaptive layout. Everything else is just a relic from paper layouts, and is a dead-end. Things like aligning images should be based on treating image size as an actual quantity you can compute sizes on; any hard-coded image sizes is bound to cause problems when the image is modified. - Unable to express simple computations on sizes, requiring circumlocutions that make the CSS hard to read and maintain. - Unable to express simple things like headers and footers, requiring hacks with floats and divs and whatnot, which, again, requires making assumptions about user screen size, which inevitably will go wrong.
If someone expands their browser to be two-feet wide and ends up with
too much text per line, then really they have no one to blame but
their own dumbass self.

This is a frequent argument. The issue with it is that often people use tabbed browsing, each tab having a page with its own approach to readability.

The *real* problem is that webpage layout is still very much confined by outdated paper layout concepts. The browser should be able to automatically columnize text to fit the screen. Maybe with horizontal scrolling instead of vertical scrolling. Layouts should be flexible enough that the browser can resize the fonts to keep the text readable. Seriously, this isn't 1970. There's no reason why we should still be fiddling with this stuff manually. Layouts should be automatic, not hardcoded or at the whims of designers fixated on paper layout concepts. [...]
I *really* wish PDF would die. It's great for printed stuff, but its
mere existence just does far more harm than good. Designers are
already far too tempted to treat computers like a freaking sheet of
paper - PDF just clinches it for them.

Clearly PDF and other fixed-format products are targeted at putting ink on paper, and that's going the way of the dinosaur. At the same time, the publishing industry is very much in turmoil for the time being and only future will tell what the right replacement is.

The right replacement is to have dynamic page layout that doesn't depend on CSS hacks or other arbitrary decisions by the publisher like number of columns, etc.. This isn't the age of paper anymore; layout should be done automatically by the end-user's browser, not by content producers, who should be worrying about the content, not the layout. On Sun, Aug 11, 2013 at 04:47:09PM -0700, Walter Bright wrote:
 On 8/11/2013 4:33 PM, Andrei Alexandrescu wrote:

 Currently ereaders are great for reading novels and such with little
 typography needs. But they're terrible for textbooks and reference
 material, mainly because the screen is both low res and is way too
 It's like programming with an 80*24 display (I can't believe I was
 able to use them!).

I still program with 80*24 displays. Well, more like 80*40, but I find that it's actually far more readable than the common obsession with squint-inducing microscopic fonts trying to cram as much on the screen as possible. Having too many characters per line quickly gets very hard to read. T -- Time flies like an arrow. Fruit flies like a banana.
Aug 11 2013
parent "John Colvin" <john.loughran.colvin gmail.com> writes:
On Monday, 12 August 2013 at 03:02:59 UTC, H. S. Teoh wrote:
 I still program with 80*24 displays. Well, more like 80*40, but 
 I find
 that it's actually far more readable than the common obsession 
 squint-inducing microscopic fonts trying to cram as much on the 
 as possible. Having too many characters per line quickly gets 
 very hard
 to read.


I am actually going the opposite way. My go to font size when coding is now 8pt, I can't stand working with anything much larger. I wouldn't use anything that large for publishing, but it's my preference for reading code.
Aug 12 2013