![]() ![]() ![]() Perhaps stick to just one, as seems to be the case right now (whichever it is), and mention in the documentation that those wanting the other option are free to e.g. whilst many people flame about Python's use of significant whitespace, I doubt that's been a major reason for many people to actually use a different language, or some semicolon-and-braces-to-indentation preprocessor. Whilst it's easy to flame about tabs vs spaces and other bike-sheddy issues online, I wonder how much people really care about it? After all, many people just get on with life when it comes to non-optional syntax, e.g. tools like this one), version-control-friendly representations, tree-based editors, more powerful navigation in editors and IDEs, etc. like syntax-aware diffing, standard code formatting (i.e. This would also make it much easier to make new tools, extend existing ones, and improve practices, e.g. for line numbers, etc.), whilst exposing the structure in a machine-friendly way. This would, incidentally, allow people to read and write code as s-expressions, but that's not the point it's just about representing concrete syntax as closely as possible (plus arbitrary annotations, e.g. The benefit is that we don't end up with a mismatch between what the compilers/interpreters accept, and what the other tooling accepts (linters, formatters, doc generators, static analysers, search engines, syntax highlighters, use-finders, go-to-definition, refactoring tools, etc.). This isn't asking much: the difficult part is parsing the human-friendly syntax, which implementations must already do. Implementations (compilers and interpreters) should include tools/modes for converting between these two representations, and should support running programs written in the parsed format in addition to those written in the human-friendly syntax. This way, we don't have to build language-specific rules for precedence, offside/significant-whitespace, fixity, etc. This can just be an s-expression representation of the normal, concrete syntax, without any transformations applied. I certainly think that language definitions should include a standard parsed format in addition to their human-friendly syntax. I suspect that most of them would avoid an opinionated formatter that differs in a few small ways from their in-house format, if only because it seems silly to break diffs and git blame for a sweeping formatting change. ![]() For JS, though, it has been out for so long that many teams have developed their own preferred style. Stated differently, is this meant to be very opinionated in hopes that all JS would follow a uniform style? I think that can work for Go since it was like that from Day 1. This is pretty standard for Java formatting.) (100 characters wide, double indent on the continuation line. On its own line, am I part of the problem? What if my whole team uses that style? For example, we would write:įoo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), If I personally prefer the second Promise chain:Īnd if I also prefer the Lisp-like approach and hate putting: ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |