(Untitled)

Aug 06, 2005 00:37

Two weekends ago I went to visit my friend Craig in Biddeford, Maine. I picked up Mike Haight on the way. We had a great time at the beach. Maine water is surprisingly cold! Most of the time we weren't at the beach we were playing poker. I have never really played poker before, but it's a lot of fun. There was a ton of traffic (even at 7PM on ( Read more... )

biddeford baltimore craig sarah randy gu

Leave a comment

uberska August 6 2005, 05:52:51 UTC
I'm probably the first person you've ever heard that likes Swing because it's easy for us to complain about the bad things, but the good things hardly get mentioned. Swing has some amazing things going for it in my opinion. Layout Managers are essential to a GUI toolkit. Non-resizeable GUI components are unacceptable. Putting that burden on the programmer beyond setting up the layout is also unacceptable. Swing has a lot of powerful components built in. If it doesn't have something you need, it's quite easy to extend to add any additional functionality. Also, the free Java forums provide free and comprehensive help for any GUI related problems. The forums aren't actually limited to just Swing.

Don't get me wrong. Swing has it's downsides. For one, it's buggy. There have been times when I've racked by brain for hours trying to figure something out. After consulting the bug database, I find it's a known bug that will be fixed at an indeterminate date in the next release. The JTable component (which is very useful) is known to be slow. Swing's pluggable look and feel is a blessing and a curse. It's really cool in concept, but it leads people to skin their applications. From a human factors stand point, skinning is wrong.

Without starting a flame war, I'd be interested to know why you hate Swing so much.

As far as "Click...click...drag...done!", I think that is the complete wrong way to go about doing GUI design. This comes down to personal preference. I like the control that coding a GUI gives you. The limitations of the click-click-drag approach prevent me from considering it as a viable option. Any sort of complex layout (which is nearly required for most applications) becomes unmanageable or sometimes impossible.

Reply

juozasg August 6 2005, 09:27:14 UTC
Swing is heaven. MFC is hell. The rest are in between. This is ny no means an an absolute scale. I can't dispose of the feeling that there is something really, really wrong with humanity's approach to GUI programming. But I have no better ideas.

Reply

uberska August 6 2005, 14:58:00 UTC
Perhaps what you are picking up on is the duplication of data. Unfortunately, this is necessary. Picture a friendly text box. If the user enters "A#AS" for a zip code, you don't want that information in your variable. Now, two things store the same data most of the time: your state variable and the corresponding gui component. Also, to separate GUI from logic, you have to jump through a bunch of hoops (static methods, observer models, or passing tons of references around). All of these are rather clunky.

At work the other day, we watched a video about "immediate mode guis" which are guis that are made similarly to an immediate mode rendering pipeline. I can't find a link on Google to any page describing it. Most of the links refer to a different gui paradigm with the same name. Needless to say, it seemed pretty ridiculous. There was a lot of hand waving.

I'd be interested if you have any thoughts on a better approach to GUI programming. You said you don't, but if anything comes to you, let me know.

Reply

hellofromdj August 6 2005, 13:03:08 UTC
No worries about a flame war. I actually like hearing why people like/use different things. It can give you a much better perspective on things you don't really like.

Really, the reasons you mentioned on why you like Swing are actually many of the reasons why I do not like it. I cannot stand the layout managers. I know that with the later releases you can use a null manager and position things exactly as you like, but even then I still am not a fan. The reason I do not like the layout managers is because it takes me forever to actually get something to look nice. Then, the person drags the window to make it bigger...and now it doesn't look right. I actually enjoy programming code behind GUI's to make them resize/change exactly how I want them to. The speed is another huge issue. Like for my SE project, there was no way we could have used Swing components to develop a nice game/interface. The listeners are *extremely* slow to move and manage. I guess most of those aren't really directly part of the Swing package, but Swing uses them. I also am not a big fan of Swing because it is Java. However, I do agree with you that it is nice how easy it is to extend the components to your liking. Though just as a side note, according to one of the head developers of Java (It was so long ago that I read the article), he felt that putting "extends" into the language is one of Java's biggest flaws.

But I mean, you are right in that it comes down to personal preference. You feel it necessary to code the adding of components to the GUI. I don't. It probably has a lot more to do with how we started creating our first GUIs and how complex of a GUI we are creating. I started with VB and just have felt like no other system for GUI development has made it as easy and quick to develop my GUI applications. But also, most of the coding projects I create have minimal interfaces. Most of them are behind-the-scenes processes that don't require much interaction with the user.

However, I recently have actually been interested in testing different languages to try and compare them side to side. Not for speed, but just ease of use, development time, etc. To do it, I'm working on writing the application in almost every language that supports what I want. I am using everything from C to PHP. Maybe doing this project in Java will give me a better understanding of why you like Swing. And perhaps even cause me to change my opinion.

Reply


Leave a comment

Up