6 ms·
Why are we still programming in text? We spend so much time now with making fancy editors and IDEs that make souce code appear like hypertext. This shows that
by stcredzero 17y ago
Why are we still programming in text? We spend so much time now with making fancy editors and IDEs that make souce code appear like hypertext. This shows that we have outgrown text. Why aren't we programming in some sort of hypertext that makes showing/hiding this stuff trivial? (Just for starters.)
- trapper 17y agoI often wondered that myself, until I saw: http://code.google.com/p/lambda4jdt/ http://code.google.com/p/lambda4jdt/ It's quite an innovative idea. Just because the text is in java, why does it have to look like blub?
- stcredzero 17y agoThat just supports my point. We could achieve the same functionality with a lot less code with source code with a bit more structure.
- Hexstream 17y ago"Why aren't we programming in some sort of hypertext that makes showing/hiding this stuff trivial?" http://en.wikipedia.org/wiki/Outliner http://en.wikipedia.org/wiki/Outliner Not a new concept, but could certainly be applied way more often than it is.
- steveklabnik 17y agoText is the universal interface. It's the Way of Unix. As far as showing/hiding this kind of thing, vim at least can collapse function definitions, I'd be suprised if other editors could not.
- stcredzero 17y agoHypertext-like linking and hiding is so universal nowadays, why do we have to parse whatever language just to achieve it? That's a lot of complex programming work we could avoid, and channel that effort into making cooler tools. (It's not just parsing. We have to write little tools to take the parsed code, then infer relationships within it. Why not just make explicit links?)
- steveklabnik 17y agoAre you trying to say that we wouldn't have to parse hypertext? I'm sorry, I'm not understanding your argument.
- stcredzero 17y agoWe'd only have to write parsers for the hypertext, not N different parsers for the various languages. Think about what happens. Your IDE parses your source code so that it can do things like highlighting, identifying senders, code folding, etc. It does this so that you as a programmer can use those tools to more easily parse it in your head to understand it. Eventually, your code is interpreted or compiled, which involves another parsing. Why not just have a direct representation of the program and its interrelationships? Languages where the compiler/interpreter make the AST available go a part of the way there. But too many of the interrelationships are implicit, requiring a program to do some sort of searching/indexing/parsing to make available. Why not just represent those directly, and have source code be a representation? If we could make such a representation, we might even be able to transcend the tyranny of particular languages. (Multi language VMs are somehow related here.)
- steveklabnik 17y agoI'm not sure what advantages a language in this form would have. Why bother mandating that it be stored like this in some way? Storing programs as text like we do now would enable a tool to display code just as you suggest, just check out the many code-to-html tools that are available. I'm also not sure why I'd care that my tool parses the code to do those things for me, nor why having my brain parse the code matters in particular. If you're arguing for Lisp's "code as AST" syntax, well, that's fine by me, but I don't think it's a neccesity. Macros work best with sexps, it's true, but I've never found, say, Ruby's metaprogramming to be wanting for Lisp-style macros. Also, I'm firmly against the One True Language way of thinking. See, for instance, Python vs. Ruby as a great example of why nobody will ever be happy with One Language to Rule Them All. They're so close to each other, yet their small differences cause so much argument between the two camps.
- jefffoster 17y agoYou might be interested in some of the ideas of Subtext (http://www.subtextual.org/ http://www.subtextual.org/). "Subtext takes the position that both text and diagrams have the same inherent limitation: they are paper-based media. Subtext represents programs as complex data structures that can not be fully printed out in a human-readable form. Text and diagrams are used to interactively present the program, not as a source encoding of it. This is the same approach taken by WYSIWYG applications like word processors and spreadsheets. Subtext is WYSIWYG programming."
- stcredzero 17y agoThe problem with the metaphor, is that WYSIWYG word processing is really only arranging dark rectangles on a bigger white rectangle. Programming is much more complex -- it is as complex as writing. Word processors don't have to deal with writing. Instead, they deal with typography, and large-scale structure. Semantic interrelationships are still left up to the human tool user.