Coders seem to be unable to distinguish the concepts of a programming language from its syntax. One coder might argue for Python on the grounds that it has certain innovative language features, but another might “refute” this by arguing about the shortcomings of whitespace-based syntax. The two are talking about entirely separate things
(
Read more... )
But these issues are not insurmountable. Of course there are always traditionalists who think new way is “crippled”, but Visual Studio has proven that, over time, people realise that the benefits of the new technology outweigh the cost. For example, Visual Studio’s auto-formatting of C# code makes it impossible to vertically align parameters in a list of similar method calls. I had no problems coming to terms with that because the benefits of auto-format far outweigh this rare special case.
The same will be true of certain AST features. There’s no reason why you can’t have an AST node that represents a logical block, which is used to insert blank lines in rendering but has no effect on execution. You could have an editor that preserves some formatting options in the AST which other editors ignore. But I bet that over time, visualisations will diverge more and more from the 1960s idea of “plain-text files” and move to a paradigm where these concerns aren’t really that relevant anymore.
Reply
Sometimes you'd want to see autoboxing and auto-unboxing; sometimes you'd like to see explicit casts resulting from generics; sometimes you'd like to see "foreach" with explicit iterators -- but often, you might not want to see those things. (After all, part of the reason for syntactic sugar is to make code more readable by encapsuling a common idiom into a shorter form.)
Since syntactic sugar is fairly 1:1, it's possible to abbreviate always or to always show the long form, but it's not possible to mix the two (sometimes short, sometimes long).
Or compare the effect of Java import or (I think) C# using; I don't think this is reflected in the generated "object code", so it would probably be missing in the AST as well. But I wouldn't want to read code that always used fully-qualified package names such as java.util.Collection or System.String -- yet if you use, say, java.util.Date and java.sql.Date, then the "decompiler" can't know which of the two it can abbreviate using import.
So, perhaps people will get used to the limitations of automatic retranslation, but I think they will - at least initially - be perceived as limitations.
Reply
Reply
Leave a comment