Generated GUI Source in 908
I was very pleased to see that build 908 has an option to generate source code instead of having to use byte code instrumentation, but the generated code is extremely ugly. Will future builds produce code that is better formatted?
Please sign in to leave a comment.
How about auto-formatting with the current codestyle?
Carlos Costa e Silva wrote:
generated source code already auto formatted according current code
style. If you are talking about human readability, then this is not a
main goal of generated code. We are providing source code for people who
do not use IDEA and want to compile UI forms without our ANT task.
Perhaps we'll improve a little structure of generated code in the future.
Best regards,
Vladimir Kondratyev
_____________________
JetBrains
It wasn't just compiling that was the issue. A number of us need to be able to deliver source code to our customers. If you were our customer and we delivered you code that looked like the generated code I think you would be as displeased with it as I know mine would be, and you probably would never use my services again. BTW, the code that was generated was not auto formatted according to the current code style.
It appears that you guys really don't want to spend your scarce resources on generating GUI source. Would you guys like to use my plugin to accomplish this instead? It's called GuiSourcePlugin and has been added to the list of available pluugins on www.intellij.org.
All I want to get out of this is to be able to use Idea with your UI Designer to produce a working system with source code that is of a suitable quality to deliver to a paying customer. I really like Idea and the UI Designer, I just have to be able to produce GUI source that I can deliver to a customer.
Something that may/may not help are settings to use that influence the
generated source code? Thigns like "local variable prefixes", "use class
members", "position at top" stuff like this. I thikn NetBeans allows for
a very small subset of features like this that effect the generated code.
I've not looked at the generated code before, so I don't know what is
"Wrong" with it persay... is it quivalent to say compiled JSP code? In
which case, I'd probably cry if I looked at it :)
Best,
-Riyad
Ralph Saunders wrote:
Ralph Saunders wrote:
>.. If you were our customer and we delivered you code that looked like the generated code I think you would be as displeased with it as I know mine would be, and you probably would never use my services again.
>
I hope they won't look into your *.class files, because that looks a lot
like generated code to me. Try and explain them that you wrote the
*.java with you fingers, and that the translation is just a step in the
creative process :(
Alain
I don't understand what you are trying to say. The source code that is generated in 908 is functional, but not fit to deliver to a customer. What does looking into *.class files have to do with that?
Ralph Saunders wrote:
>I don't understand what you are trying to say. The source code that is generated in 908 is functional, but not fit to deliver to a customer. What does looking into *.class files have to do with that?
>
You said :
> If you were our customer and we delivered you code that looked like
> the generated code I think you would be as displeased with it as I know
> mine would be, and you probably would never use my services again.
So, you'll loose your job if your clients could find that the gui *.java
code was generated by a program, rather than a human?
Or you loose your job if it's poorly formatted, and just look like it was..?
In both cases, it doesn't make any sense to me. If it's the latter
case, just use /Reformat/.
If it's the first case, educate them. If they don't require you write
bytecode by hand, they shouldn't be surprise you use a gui-designer to
create your uis.
Alain
On Thu, 28 Aug 2003 14:49:42 +0400, Vladimir Kondratyev (JetBrains) wrote:
Is it possible to auto-fold the generated code?
One thing I was thinking as well, auto-generate the code into an abstract
super class, and the bound class extends that ( or uses it ). This way,
the generated code is still not messing up the logic classes ( one of the
points of using the byte manipulation in the first place....
--
Mark Derricutt - email @ mark@talios.com - home @ www.talios.com
Software Monkey - blog @ talios.blog-city.com
Now Playing: Angelica - Home Sweet Heaven
Mark Derricutt wrote:
>>generated source code already auto formatted according current code style.
>>If you are talking about human readability, then this is not a main goal
>>of generated code. We are providing source code for people who do not use
>>IDEA and want to compile UI forms without our ANT task. Perhaps we'll
>>improve a little structure of generated code in the future.
It's very good idea to auto fold generated method. Please fill request
to the tracker.
Regards,
Vladimir Kondratyev
_____________________
JetBrains
On Fri, 29 Aug 2003 14:57:42 +0400, Vladimir Kondratyev (JetBrains) wrote:
Already there and filling ;)
--
Mark Derricutt - email @ mark@talios.com - home @ www.talios.com
Software Monkey - blog @ talios.blog-city.com
Now Playing: The Cramps - Color Me Black
Assume for a minute you run a business and that you use some IDE other than Idea. You have hired two contractors to build two different screens. After the screens are built, and you are gone, an employee of the company will be responsible for maintaining and modifying the screens. One contractor leaves behind code that looks like the code found in codeSample1.txt. The other contractor leaves behind code that looks like the code found in codeSample2.txt. Later, you need to hire one contractor for a new project, would you hire the one who left you code that looked like the code found in codeSample1.txt, or would you hire the one who left you code that looked like the code found in codeSample2.txt?
Attachment(s):
codeSample1.txt
codeSample2.txt
On Fri, 29 Aug 2003 14:19:26 +0000, Ralph Saunders wrote:
Assume also for me, that you know of IDEA, and you know of how it's UI
designer works, maybe you define as part of the contract with the
developer that (s)he -doesn't- make use of IDEAs code generator.
Whilst I admit that currently the source code generated looks rather
yucky, from my brief look at it earlier, it would seem the nastyness with
it is more in the variable naming, and possibly the code formatting.
Now, build 908 is the -first- time the codegen has been made available,
and I'm guessing its a direct output of whatever bytecode was already been
bytesliced...
I could possibly see IntelliJ adding some more options to the
project->ui-manager for code-gen options. Hopefully maybe something along
the lines of:
1. Generate code in bound class, or
2. Generate code in abstract superClass of bound class ( bound class
would be changed to extend the superclass.
Or maybe any number of other options.
Failing that, you have the .form files in XML format, if the new developer
REALLLLLLY needed to do something, he could use that, modify the XML hand...
IntelliJ have listened to us, the developers and given us the
code-generation option, and I thank them for that. Personally, as it
currently stands I think I prefer the byte-code modification method. But
if IntelliJ tidy up the generated code, to something more human friend, I
don't think we'd have something to complain about...
Mark
--
Mark Derricutt - email @ mark@talios.com - home @ www.talios.com
Software Monkey - blog @ talios.blog-city.com
Now Playing: The Gathering - New Moon, Different Day
>
...and that leaves me, the contractor, with a great IDE that has no GUI
builder I can use. I don't understand why you think I should find this
to be a good thing. Fortunately, the UI Designer is designed so I can
use the designer part which I like a lot, and replace the byte code
generation (and now half hearted code generation) with a process that
generates GUI source code instead. Earlier discussions made it clear
to me that JetBrains was not going to generate GUI Source. I didn't like
that answer, but that's OK because I had other options, like writing a
plugin to generate the source from the .form file. Then all of a sudden
I hear JetBrains say that as of build 901, there is an option to generate
GUI source. I thought that was great and when they released build 908
I tried it, because if Idea is going to produce GUI source then
it doesn't make any sense for me to continue developing my plugin, unless
of course the source is going to continue to look like it does in 908.
My initial post was not a criticism of JetBrains, Idea, the UI Designer
or anything else. It was a question to JetBrains, and feedback for them,
which is what the EAP program is supposed to be about.
>
So why are you jumping on me for saying the same thing? It's is not up to
par with their other code generating features like surround with,
Code->Generate, live templates, etc. Or am I missing something?
>
>
Gee, that would be a lot easier than say editing Swing source code...
IntelliJ did not listen to us, because we told them that the reason we
needed source code was to deliver to customers. It's great that they
are generating code, but it still doesn't meet the needs we stated in an
earlier thread when the UI Designer was first introduced. I would think
that is information that JetBrains would want to know.
I wasn't complaining. Why do all you folks who like the byte code
approach feel you have to tell me that I don't need source code. How do
you get off thinking you know more about what I need to provide my
customers than I do? I'm not saying, and have never said, that JetBrains
should do away with the byte code instrumentation, only that source code
generation should be an option. Having the generated code look nice
in addition to being functional was assumed, since ALL the other code
generating options generate nice looking code.
On Fri, 29 Aug 2003 17:39:14 +0000, Ralph Saunders wrote:
So you're back to where you began.... on the flip side, as a contractee,
I might dictate that -all- contract developers use IDEA EAP's and use the
IDEA form designer. That might cause just as many argument's thou.
I could see the need, and/or development of a standalone GUI designer,
thats either JetBrains built, or open source built. Then you could use
whatever editor you wanted for your coding, and just launch the designer
when you need it. The current UI Designer is currently implemented as a
plugin, I wonder how hard it could be to write a simple plugin-runner.
First cuts can always be improved upon, the UI designer is improving alot
as it grows, hopefully this is will be an area that will also see
improvement.
I think the plugin would still be a good idea, it could be extended to
either a) create source code for the form designer b) convert IDEA .form's
to NetBeans .forms and vise versa. ( could be handy ).
Convert IDEA .forms to XUL and vise versa.
I think theres alot of room for plugins that take advantage of the UI
designer forms.
Not jumping, just commenting, it was hellishly early in the morning so I
may be been tired and grumpy thou :(
Currently, it would seem ( blank impression ) that the code-gen is using
some raw code gen routines, possibly expanded from the byte-code
instrumentation routines, rather than making use of the normal code
generation tools. Maybe the current code doesn't quite sit in a place
that it can make use of them ( the code is generated as part of the
compile/build phase, so would seem to be a more back-end process than
something that can touch the rest ). Who knows, I've not seen the code.
Maybe JetBrain's need to refactor a few things to get that particular
code-gen talking to the main code-gen.
>> Failing that, you have the .form files in XML format, if the new
>> developer REALLLLLLY needed to do something, he could use that, modify
>> the XML hand...
>>
Never said would be easier, and well, if one uses a tool, who knows....
Maybe your plugin could be altered to convert IDEA .form's to Glade .ui's
and just roundtrip them ( Glade rocks ).
My thinking was the original cut of "code gen" would be to allow the
dependancy on IDEA to be broken, their were arguments that for some reason
you may want to dump IDEA, so having code that could be built would be
advantageous.
Mark
--
Mark Derricutt - email @ mark@talios.com - home @ www.talios.com
Software Monkey - blog @ talios.blog-city.com
Now Playing: %s