Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Studio Creator: Not The Same Code  RSS feed

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I downloaded JSC today to give it another whirl. The last time I tried it was when it was still an RC. Ran decent on my 3 GHz with 1 Gig RAM but still not up to par with IDEA or Eclipse. I excepted this though since it's based on Netbeans and Netbeans is still creepy crawly even on good machines.

Performance aside, it worked fairly well. I was able to create some basic forms and throw some navigation in there and move from page to page. The issues I had came when I started to look at the generated code. Hardly any of it follows the guidelines/practices that are taught in books. I'd asume this is because in the books we aren't using an IDE. But it is still interesting.

For example, I've always considered it best practice to load a dropdown list via a getter method in the backing bean that loads the list and binds it to the dropdown component. When I look at the same code using JSC this is all down in the constructor of the backing bean.

Another interesting note is how you are taught in books to create getter and setter methods for the values of the components. So for a login form you'd have

private String username;
private String password;

and then getters and setters and in the componet you would specifiy the value accordingly. In JSC it uses all component binding. So you call getValue() of the component instead of getUsername() or whatever. Not that this is a bad way, just different than what is generally taught in books.

I realize you can't expect IDE generated code to be as neat as what you write yourself but it would be nice if the things you learned from reading the books on JSF carried over to the IDE that just so happens to be made by Sun who just so happened to create the JSF specification.

So who's breaking the rules? Hand coders or the IDE?
[ June 01, 2005: Message edited by: Gregg Bolinger ]
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are so right

JSC creates very dodgy code. My boss wants to use it for developing our product but the code it generates is very bloated and not very intuitive.

I especially dislike the way it automatically binds all form components to your backing bean. It makes for code that is three times as large and difficult to maintain.

I wouldnt use JSC for production code. I use MyEclipse and hand crank it all - which is actually much faster than using the auto-generated stuff and cleaning it up afterwards.

This is a subject I feel strongly about, too many times developers use autogenerated code which includes a lot of extra code that isnt required, no comments, unintuitive variable names etc. I think these tools are useful if you clean the code up afterwards but like I said, it is quicker and cleaner to hand crank the code.

As always Gregg you hit the nail on the head...
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick,

I am glad someone else agrees with me. Another point to note is the code that gets generated that I feel has nothing to do with my application. JSC I know puts some special session handling code in there. I have no clue what that code is doing really. It's more confusing than helpful to me.

What I wouldn't mind seeing is a stripped down version of JSC. Something that allows drag and drop of components but that would also let you choose the default binding type and change it when/if you want to. I like the visual navigation which I know the new version of MyFaces will support. I'd much rather hand code my Java source files than maintain configuration files.

I'll probably be blogging about this. I can't wait for that back lash from the community.
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't use JSC but same story goes with IBM WSAD 5.1.2
WSAD also generates code which doesn't make much sense to me. Moreover everytime one changes the JSP, it tends to mess-up the entire backing bean.
Though seems WSDAD is bit generous than JSC in the sense that it does provides me an option where I can request WSAD not to play with my code


that's the route I normally prefer.
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
I'll probably be blogging about this. I can't wait for that back lash from the community.


I know what you mean. I blogged about the shortcomings oof Netbeans and I had some, lets say, terse comments from the Opensource advocates
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, it's officially blogged and javablogs has already aggregated it. Now, we wait.....
 
Rick Beaver
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Ok, it's officially blogged and javablogs has already aggregated it. Now, we wait.....


Well I�d hate to see you disappointed, so I�ll start off the backlash!

Everyone sees things from their perspective. For me, being more of a architect than a bit twiddler (and I say that with the utmost respect to the bit twiddlers out there), another layer between me and the machine isn�t such a bad thing. I know, using an IDE can cause code bloat (having worked for years with Visual C++/MFC I can attest to that fact), but as long as you use the IDE to maintain the code, does it really matter that much? Yes if you have to tweak the underlying code that gets generated (with JSC, you shouldn�t have to do that often) then it might cause you some heartburn, but so would looking at code by any other person who�s style did not match your own (ever take a look at some C++ code ).

To me this is kind of like the argument many of us had about moving from assembler to a higher level language like C. You remember the arguments (it�s slower, it�s bigger, etc.). Then came along C++ and we heard it all over again (code bloat, inefficient, etc.). Next it was going to Java from C++, but we (at least those here) got over that too.

The thing is that the bottom line is the bottom line. Using IDEs like Creator or JBuilder, or (insert favorite here) helps speed up development and reduce the learning curve for both new development and maintenance. Yes, you might get �better� (reading �tighter�) code by doing things by hand, but by the time your team gets things out, a smaller team using tools can beat you to market.

So, how was that as a first counterpoint? Oh�almost forgot. I should add a few of these here now: , ,
[ June 06, 2005: Message edited by: Darrin Smith ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I�d hate to see you disappointed, so I�ll start off the backlash!

Gee. Thanks.


Everyone sees things from their perspective. For me, being more of a architect than a bit twiddler (and I say that with the utmost respect to the bit twiddlers out there), another layer between me and the machine isn�t such a bad thing. I know, using an IDE can cause code bloat (having worked for years with Visual C++/MFC I can attest to that fact), but as long as you use the IDE to maintain the code, does it really matter that much?

This is a valid argument in the Microsoft development world. You only really have 1 IDE solution. And chances are when the new one comes out it will support your project. But not the Java world. Yeah, if you plan on using JSC for the rest of your life or at least for the lifetime of a specific project then you're good. But if sometehing happens and you you have to change, this is bad. Ok, so Sun doesn't want you to switch. Neither does WSAD, JDeveloper, etc. But we aren't talking about those right now.
Yes if you have to tweak the underlying code that gets generated (with JSC, you shouldn�t have to do that often) then it might cause you some heartburn, but so would looking at code by any other person who�s style did not match your own (ever take a look at some C++ code ).

Might cause some heartburn? Does cause heartburn. There are objects in every backing bean I create that I still don't know what the heck they are doing. I guess I just like to be in complete control.

To me this is kind of like the argument many of us had about moving from assembler to a higher level language like C. You remember the arguments (it�s slower, it�s bigger, etc.). Then came along C++ and we heard it all over again (code bloat, inefficient, etc.). Next it was going to Java from C++, but we (at least those here) got over that too.

I don't think it's the same thing. You're talking about langauges. I am talking about an IDE. Just not the same to me. I understand your analogy, but don't accept it.

The thing is that the bottom line is the bottom line. Using IDEs like Creator or JBuilder, or (insert favorite here) helps speed up development and reduce the learning curve for both new development and maintenance. Yes, you might get �better� (reading �tighter�) code by doing things by hand, but by the time your team gets things out, a smaller team using tools can beat you to market.

This is a valid argument. But it doesn't excuse the difference between how we are taught JSF and how JSC does it. If you were to go through my login tutorial linked at the top of the JSF forum and then did the same tutorial in JSC you'd get 2 completely different backing beans. And I guarntee the newbie will understand my code better.

So, how was that as a first counterpoint? Oh�almost forgot. I should add a few of these here now: , ,

Not too bad.

My point isn't so much that JSC won't help you get the job done because we all know it does that very well. My point is that it doesn't conform to the way the community is being taught JSF. So mayby my beef is not with JSC but with all the books on it.
[ June 06, 2005: Message edited by: Gregg Bolinger ]
 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
Well I�d hate to see you disappointed, so I�ll start off the backlash!

Gee. Thanks.


Everyone sees things from their perspective. For me, being more of a architect than a bit twiddler (and I say that with the utmost respect to the bit twiddlers out there), another layer between me and the machine isn�t such a bad thing. I know, using an IDE can cause code bloat (having worked for years with Visual C++/MFC I can attest to that fact), but as long as you use the IDE to maintain the code, does it really matter that much?

This is a valid argument in the Microsoft development world. You only really have 1 IDE solution. And chances are when the new one comes out it will support your project. But not the Java world. Yeah, if you plan on using JSC for the rest of your life or at least for the lifetime of a specific project then you're good. But if sometehing happens and you you have to change, this is bad. Ok, so Sun doesn't want you to switch. Neither does WSAD, JDeveloper, etc. But we aren't talking about those right now.

Although I think it's a good point, there are reasons why companies normally stick with a particular IDE, and I don't see that much swapping going on. You are right though that it could be a pain if it had to be done!

Yes if you have to tweak the underlying code that gets generated (with JSC, you shouldn�t have to do that often) then it might cause you some heartburn, but so would looking at code by any other person who�s style did not match your own (ever take a look at some C++ code ).

Might cause some heartburn? Does cause heartburn. There are objects in every backing bean I create that I still don't know what the heck they are doing. I guess I just like to be in complete control.

Well...yes, that could be a pain, but again, you shouldn't be forced to look under the hood that much...just trust the code (heh heh).

To me this is kind of like the argument many of us had about moving from assembler to a higher level language like C. You remember the arguments (it�s slower, it�s bigger, etc.). Then came along C++ and we heard it all over again (code bloat, inefficient, etc.). Next it was going to Java from C++, but we (at least those here) got over that too.

I don't think it's the same thing. You're talking about langauges. I am talking about an IDE. Just not the same to me. I understand your analogy, but don't accept it.


How is it different in the spirit of what went on with the change from C++ to Java in that people came up with the bigger (memory) and slower issue just like they do with generated code. Of course this doesn't really hit on the readability issue, and that I'll concede...again, how often you have to look under the hood is the question though.

The thing is that the bottom line is the bottom line. Using IDEs like Creator or JBuilder, or (insert favorite here) helps speed up development and reduce the learning curve for both new development and maintenance. Yes, you might get �better� (reading �tighter�) code by doing things by hand, but by the time your team gets things out, a smaller team using tools can beat you to market.

This is a valid argument. But it doesn't excuse the difference between how we are taught JSF and how JSC does it. If you were to go through my login tutorial linked at the top of the JSF forum and then did the same tutorial in JSC you'd get 2 completely different backing beans. And I guarntee the newbie will understand my code better.


No argument here. I don't know why the good folks at Sun did it the way they did. There must be some reason to deviate...I just can't think of a good one right now.



So, how was that as a first counterpoint? Oh�almost forgot. I should add a few of these here now: , ,

Not too bad.

My point isn't so much that JSC won't help you get the job done because we all know it does that very well. My point is that it doesn't conform to the way the community is being taught JSF. So mayby my beef is not with JSC but with all the books on it.

Again, no argument there in that it does things a bit differently. Maybe JSC update 2 will be a bit more "standard" (should know around Java One time).

[ June 06, 2005: Message edited by: Gregg Bolinger ]

[ June 06, 2005: Message edited by: Darrin Smith ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!