4 ms·
It's a cute idea, to use annotations to generate getters/setters etc, instead of generating source code (IDE style). A good strategy for any boilerplate that a
by 10ren 17y ago
It's a cute idea, to use annotations to generate getters/setters etc, instead of generating source code (IDE style). A good strategy for any boilerplate that a particular project requires.
Will other tools find this code? E.g. I think javadoc is source-based, and I don't know if it will invoke such annotations. I would expect the annotation spec to require it, for annotations that can create methods etc, but I'm just not that familiar with the spec.
BTW: great presentation video: showing the problem, showing the solution, showing how to get started. It might seem like overkill, but that's the way to sell stuff (though this one seems to be under the MIT license, ie free).
- trapper 17y agoI'm not sure about source-processing tools picking up these changes. I have heard that the annotation processor is very, very powerful in java, but hardly ever used.
- stcredzero 17y agoWhy 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.)
- 17y ago
- 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.