Arc Forumnew | comments | leaders | submitlogin
2 points by akkartik 4641 days ago | link | parent

My favorite comment on the HN thread[1] so far points out a new design tradeoff rather than retreading tired aesthetic preferences:

"..indentation is not affected by the lengths of identifiers. It’s silly to format code in such a way that you need to re-indent just because you renamed a function." http://news.ycombinator.com/item?id=4993847

[1] http://news.ycombinator.com/item?id=4992603



2 points by rocketnia 4641 days ago | link

"..indentation is not affected by the lengths of identifiers. It’s silly to format code in such a way that you need to re-indent just because you renamed a function."

That silliness is hard to avoid. If we don't use word wrap, we have to re-indent code when an identifier changes just so things stay on the screen. To avoid that re-indentation, we should probably redesign our text editors, diff tools, and languages so word wrap isn't a pain to work with. I think I'd rather do a little re-indentation for now.

---

It's not quite the same topic, but for a long time,[1] I've considered indentation an enemy to brevity. All that wasted whitespace! :) Arc's a:b ssyntax is great at eliminating levels of indentation.

[1] The only evidence I can find is http://www.arclanguage.org/item?id=14077, where I say a new ssyntax proposal "wouldn't [...] save much indentation."

-----

1 point by akkartik 4641 days ago | link

Just do what I do and don't have hard limits on line width :)

http://github.com/akkartik/wart/blob/44423b4107/011types.cc#...

I do wrap lines on occasion, but I wouldn't do it just because a line's a little too long.

-----

1 point by rocketnia 4641 days ago | link

I don't quite know why, but I like to be pretty strict. I keep every line at 70 spaces long or less, with tab stops every 4 spaces, except for the following scenarios:

- Commented-out lines of code.

- A line of code that just can't be broken up any further. But first I try to move this line to a less indented part of the code, and then I remove other indentation on the line until it fits the best it can.

- Code that someone else has already made too long by my judgment. I try not to change someone else's style if my cosmetic change would obscure the meaningful changes I'm making, or if it would introduce inconsistency in the codebase. In this case the codebase includes any part of the revision history, branches, forks, and related projects that might be reintegrated.

In college I used 80 spaces, but that turned out to be too long to fit on my Wordpress layout without scrolling.

---

I thought it was also too long for Arc Forum, but it seems that's not true. Looks like Arc Forum supports 83 characters, at least on my user agent.

  (---10---)(---20---)(---30---)(---40---)(---50---)(---60---)(---70---)(---80---)1234
-

  (---10---)(---20---)(---30---)(---40---)(---50---)(---60---)(---70---)(---80---)123
When I switch from Chrome to Firefox, it looks like the 84-character line doesn't scroll anymore. In general, I bet it depends on the browser's default fonts and such.

-----