4 ms·
Has anyone tried to store/diff/share code as ASTs, and allow each individual user to apply formatting rules? I guess (apart from the tooling effort involved) t
by shabble 12y ago
Has anyone tried to store/diff/share code as ASTs, and allow each individual user to apply formatting rules?
I guess (apart from the tooling effort involved) the problem would be that all rules have some exceptions, which you'd need to track somewhere as metadata, and that might scale with number of users.
I suppose it might also cause problems in pair programming / 'hey come look at this' reviews if you have radically different formats for the same code, but really, the only person who should care about your indenting style is you.
- jloughry 12y agoHas anyone tried to store/diff/share code as ASTs... This is such an interesting idea I had to respond. To point out that it could go well beyond formatting, to variable and function names as well. With an AST-aware editor, I could even have multiple "views" on the same code; e.g., a crunched version with abbreviated names for a high-level view, personally styled library calls, curried functions, all sorts of things. It wouldn't require too much bookkeeping to track that sort of information per-programmer. I think it's a fascinating idea. I haven't looked into the implementation of syntax highlighting in current editors; I wonder if the infrastructure is already part-way there.