3 ms·
Obviously (to me anyway) you're right, and I'm surprised there are people who don't indent their HTML like that. But a thought just occurred to me -- why don't
by mcrider 14y ago
Obviously (to me anyway) you're right, and I'm surprised there are people who don't indent their HTML like that. But a thought just occurred to me -- why don't editors do this automatically and without creating actual whitespace (tabs/spaces)? If you look at XML in your web browser it will automatically be formatted with indents based on tag hierarchy .
- ramblerman 14y agoI see your point, but I think there are a few solid reasons it would be a bad idea. The basic text file (at least in unix) is king, and the medium by which we transport all sorts of code around. Adding a layer of asbtraction to an editor like that, where it shows you one thing but saves the file differently, breaks this premise and means your new editor now doesn't play well with others. - Unless you source control is in on it, you are going to suddenly see a different file than you were working with before when resolving conflicts. - Your whole team is now forced to use your editor to get the same view of the code as you are. - grepping, line counts, most third party text mapulation/wrangling services become moot unless savvy to the context of your editor
- mcrider 14y agoAfter I wrote that, I realized that all editors would need to have the same capability which is pretty much a non-starter (and whitespace is universal). Your other points are well taken too.
- chc 14y agoWhat is the benefit to showing indentation but not actually including it? It is less intuitive and offers little to no benefit -- that would appear to be the why.