4 ms·
Unrelated question: what are the main reasons (aside from the obvious file format problems) for which we don't have rich text syntax? Imagine having a e.g. lin
by Tade0 6y ago
Unrelated question: what are the main reasons (aside from the obvious file format problems) for which we don't have rich text syntax?
Imagine having a e.g. link in the code. Wouldn't that be useful?
- avianlyric 6y agoI think debugging code is hard enough without having the debug errors cause by using the wrong font. Have you ever wrestled with MS Word to make you heading appear on the right page? Imagine having to do that to make code compile.
- rootlocus 6y agoCode already has all the information. It's enough for syntax highlighters, compilers, static analyzers, navigation, refactoring, etc.
- cuspycode 6y agoAlgol-60 (and its younger cousin Algol-68) did actually use boldface to distinguish special keywords such as "if", "begin", "true", etc, from the namespace of ordinary identifiers. But that was only used in publications, not in machine-readable source code, since few encodings could support boldface. Instead various stropping[0] methods were used in the implementations of Algol. Today there is really no technical reason why rich text can't be used, but my guess is that syntax highlighting serves a similar purpose without complicating file formats and parsers. [0]. https://en.wikipedia.org/wiki/Stropping_(syntax) https://en.wikipedia.org/wiki/Stropping_(syntax)
- virgilp 6y ago> Wouldn't that be useful? Useful - for what? Do you want that link to be written & maintained by you, or to be automatically generated by the tools? Because we already have the latter... (e.g. in many IDEs, ctrl-/cmd-click on symbols performs useful actions, eg. takes you to the definition or finds all references if you're at the definition site).
- Tade0 6y agoIt does, but in dynamically typed languages it's obviously less capable. To deal with this one could of course have a static type system instead, but that necessitates learning the DSL behind it and its idioms - the lack of which is the main appeal of dynamic typing to begin with.
- virgilp 6y agoI actually did code hinting for PHP in a fairly popular commercial product, more than 10 years ago - and I disagree with you that it has to be less capable. You can use heuristics - people are forgiving because they understand you can't get everything right. You can use configuration files & user hints to help the semantic analysis. You can absolutely get the hints mostly right - and it's automatic, so probably closer to being correct than anything that'd have to be maintained by hand.
- aasasd 6y ago> what are the main reasons Terminals.
- _bxg1 6y agoIt's very hard to survey with precision the exact state of a body of rich text. I don't even like using rich text editors for prose, for this reason. HTML/Markdown are the closest thing we have to "rich text that's explicit and precise", but at that point you're back to plain text with special machine-readable syntaxes. And who wants to write out explicit formatting directives solely so that formatting can then drive program behavior?
- tomaskafka 6y agoSwift has a markdown comments (starting with ///), which actually render formatting inside editor, and it's pretty great.
- gosub 6y agocolorForth uses colors for semantics https://en.wikipedia.org/wiki/ColorForth https://en.wikipedia.org/wiki/ColorForth