Live data from Hacker News

Write thin to write fast

breckyunits.com

121–130 of 146 posts

Re: Write thin to write fast

#121

A vast majority on book typography agrees on 66 characters per line in one-column layouts and 45 characters per line in multi-column layouts as being the optimal numbers for reading. The text-block should also be placed assymetrically on the page, with the margins in size order being inner If you adhere to these very simple principles, you will have avoided like 95% of the typographic choices that can make texts hard…

Robert Bringhurst in "The Elements of Typographic Style" (a bible for this kind of thing, and one of the most beautiful books ever made), has this to say on the topic:

"Anything from 45 to 75 characters is widely regarded as a satisfactory length of line for a single-column page set in a serifed text face in a text size. The 66-character line (counting both letters and spaces) is widely regarded as ideal. For multiple-column work, a better average is 40 to 50 characters.

If the type is well set and printed, lines of 85 or 90 characters will pose no problem in discontinuous texts, such as bibliographies, or, with generous leading, in footnotes. But even with generous leading, a line that averages more than 75 or 80 characters is likely to be too long for continuous reading."

Re: Write thin to write fast

#122
I don't know about writing, but I found the layout of this website easy to read; no need to move my eyes, just scan entire lines as I go. I'm on a 27" screen with the browser maximized, and sites the expand to fill that space are typically hard to read...

However, the same is absolutely not true of writing source code. I find there is much value in seeing the indentation structure, and messing that up with 'fake' indentation just to allow for shorter lines utterly destroys my source comprehension.

Re: Write thin to write fast

#123
post #117
post #110

That‘s one of the most annoying things for me on HN, that text is rather small and lines are extremely long. Especially difficult in the comment section.

Firefox remembers the zoom level for each site separately, so you can zoom HN to e.g. 110 % to fix the font size. The line-length issue can be fixed by resizing the browser window. At least that works for me - none of the sites I use require a huge amount of horizontal space. (Many people seem to keep all their browser windows maximized out of habit, but that is not necessarily the optimal window size.)

I know, still I consider the layout of HN bad design. And I don't want to resize the browser window for every website I visit. There is a reason why Bootstrap "invented" .container.

https://getbootstrap.com/docs/5.0/layout/containers/

Re: Write thin to write fast

#124
Does anyone know what the phenomena is called where you think about something/hear about something and then suddenly you stumble across multiple instances of it in the wild?

Just yesterday I began configuring the textwidth/wrap porperty in my Neovim. I went to bed thinking that maybe a hard-capped width of X*2 cahracters would be better, so I can fit more text "into a square" -- which basically means that I focus on a point in the middle of the text and see X characters left, right, up and down.

Now today, the first article I read is about the same exact problem :)

Re: Write thin to write fast

#125

Does anyone know what the phenomena is called where you think about something/hear about something and then suddenly you stumble across multiple instances of it in the wild? Just yesterday I began configuring the textwidth/wrap porperty in my Neovim. I went to bed thinking that maybe a hard-capped width of X*2 cahracters would be better, so I can fit more text "into a square" -- which basically means that I focus on…

It's called Baader-Meinhof phenomenon: https://www.healthline.com/health/baader-meinhof-phenomenon

Re: Write thin to write fast

#126
post #125

Does anyone know what the phenomena is called where you think about something/hear about something and then suddenly you stumble across multiple instances of it in the wild? Just yesterday I began configuring the textwidth/wrap porperty in my Neovim. I went to bed thinking that maybe a hard-capped width of X*2 cahracters would be better, so I can fit more text "into a square" -- which basically means that I focus on…

It's called Baader-Meinhof phenomenon: https://www.healthline.com/health/baader-meinhof-phenomenon

Now you will encounter people mentioning this phenomenon all over the place.

Re: Write thin to write fast

#127

I do this sort of thing quite often, more often than not: my $foo = GetFoo(); my $bar = GetBar($foo); my $baz = GetBaz($bar); As opposed to this: my $baz = GetBaz(GetBar(GetFoo())); It takes a smidgen longer to write, but is much easier to read and understand when I'm looking at it 2 days later.

Check if your language has a pipe operator. You may be able to do something like this: my $baz = GetFoo() |> GetBar |> GetBaz;

Thanks for the idea, I'll consider it.

One of the other reasons I use this style is because it allows me to port code easily between different languages.

For example, aside from the "my" keyword, I can pretty much copy and paste the same code between PHP and Perl.

Re: Write thin to write fast

#129

Reminded me of the "Rules of Comfortable Measure", from The Elements of Typographic Style, quoted here: http://webtypography.net/2.1.2 I always find myself fighting this on practically every website. But it makes sense to me, that this should be something we think about in, well, most of our editors as well. I debate about the measure of code, but I do find 100 to be a reasonable fit for most languages. The problem,…

Ironic that the lines on the page are well over 200 characters.

Yeah, I chuckled that page didn't apply the fixed width that it recommended. If you just apply the width rule, it seems to mess up the right column.

It's like a microcosm of how challenging CSS is to get right.

The actual book this website is based on comes from print media. That website is just trying to apply those ideas to the web. And, as we see, not quite getting it right

Re: Write thin to write fast

#130
post #32

On a related note: At one point I switched to working exclusively on a laptop and after a while realized that the smaller screen had forced me to write better code. I wrote smaller methods, made smaller files, kept my concepts together, the whole nine yards. I even wrote better tests since that helped me keep my work small. It didn't last; I'm writing this on a 27" monitor, but I think that has more to do with bad la…

I see some coworkers with ridiculous setups. Three monitors, one vertical, one ultrawide and curved. I don't see why you need that much screen to write code... when pressed they say it's for having references, Slack, etc. up on other screens but then you just end up moving your head around a lot (what a pain in the neck!) I do everything on a single 27" monitor.

It depends on the type of work. For people who code like they're writing a novel, yeah, a laptop can be perfect and encourage focus. But for anyone who works with real-time financial data, working on a laptop screen would be a nightmare.
Post reply on HN