Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

It could be done automatically as it is indeed confusing. Each new line still needs 4 spaces though... I think!


sort by: page size:

4 spaces allows you to have manual line wrapping, for example: if (a < b || b < c || ... || d < e || ... ) Do something.

You can just ask it to use your preferred indentation style. Personally I prefer 2 spaces so even if 4 spaces is apparently “standard” I’d like it to use 2

They give you a space that you input it in, if there's something missing

how was that hard to figure out


Definitely, as long as it's consistent - I personally like to go for 4 spaces everywhere, I would say it makes the code look easy and readable.

One newline is probably better than 1-4 spaces.

Hi, I'm the author.

I was kinda on the fence, but I was considering my target: Journalists. A journalist may not notice simple differences like an extra space here or there when reading, but probably wouldn't retype a double space. I agree that this should be automated in some way, but it's a bit of an arms race.


If you're in the mood and fast, you can prefix each line with 4 spaces to get the more traditional monospaced layout of that.

Please put four spaces in front of that very long unbroken line.

If only it auto-inserted a space after words it would be so much more efficient.

Why would you need to change the number of spaces to read it? You probably have a different preference and what you get, but your preference is unlikely to be material to legibility.

Most people have settled with somewhere between 2-4 spaces, and a max of 80-120 character lines. I have an opinion on what I prefer in that range, but I'll live with a variety of stuff. And most others can as well.


It's two spaces. Of course four will work as well, it just adds extra indentation.

It's hard for me to read long lines.

I don't think 4 spaces makes it easier to know in what scope I'm in when there are a lot of scopes. The amount of white space is a bit overwhelming to me.

But you know, it's no big deal, just a matter of taste. Maybe 3 spaces is a better answer, which I guess we'll never know...


For me 2 spaces is enough to read code and 4 spaces make code unnecessary wide which makes it hard to read.

This is one of the reasons I've never liked (and never used) Spaces. I think this would be a better solution, even if it meant making the max number of spaces be four.

Please add four spaces to the front of that long unbroken line.

> as they’re stably ordered left to right

Only if you unchecked 'Automatically rearrange Spaces based on most recent use' in the settings.


Yeah that's one way. Often I add a space and another word.

We could use [space], option+[space], and option+shift+[space] to give a regular space, an en space, and an em space respectively. This would be similar to hyphen-minus/en-dash/em-dash, so easy to remember. And it could be done in software.

You do still have to worry somewhat about space in between characters; if it's missing too often, you can't recognize the character boundaries.
next

Legal | privacy