Slashdot Mirror


Software Engineering of GUI Programming?

cucucu asks: "After ten years of programming for the network, I started programming a GUI Desktop application. My problem is most GUI tutorials out there are nothing more than a taxonomy of buttons, dialogs, and check-boxes. So as I checked GUI toolkits, I found that I can easily learn all the widgets, layouts, callbacks, and the like, and start coding a GUI application. However, very soon I found myself repeating code all over the place. Is there a good guide (online or off) for the Software Engineering aspects of GUI programming, so that I can learn how to reuse code, and build my class hierarchies over the one provided by the toolkit?"

116 comments

  1. It's a trade-off by ClosedSource · · Score: 3, Insightful

    In recent years the well-understood trade-off between gratuitous code repetition and gratuitous function/class creation has become one-sided in favor of the latter. One should avoid unnecessary code repetition but a few lines of code repeated in several places is not necessarily a class waiting to emerge.

    1. Re:It's a trade-off by phrasebook · · Score: 1

      a few lines of code repeated in several places is not necessarily a class waiting to emerge.

      That's right - it's a function waiting to emerge.

    2. Re:It's a trade-off by ClosedSource · · Score: 2, Insightful

      Actually, it's not necessarily a function either. Functions should have a well-defined purpose beyond being just a collection of lines of code. The reason is that when functions aren't well defined they're less likely to be reusable. In addition, when they are created soley to satisfy the "don't repeat yourself" rule they often have to be refactored back to a non-function when the coincidence that caused the duplication of code disappears.

      Despite the "constant refactoring" edict, refactoring is really a kind of maintenance optimization and like all optimizations it's problematic if you do it too early.

    3. Re:It's a trade-off by phrasebook · · Score: 1

      refactoring is really a kind of maintenance optimization and like all optimizations it's problematic if you do it too early.

      QFT.

    4. Re:It's a trade-off by hey! · · Score: 1

                  In recent years the well-understood trade-off between gratuitous code repetition and gratuitous function/class creation has become one-sided in favor of the latter. One should avoid unnecessary code repetition but a few lines of code repeated in several places is not necessarily a class waiting to emerge.


      This is an interesting perspective.

      I think that while pasting a few lines of code is normally harmless, it doesn't follow that a function that replaces a few lines of code, or even a fraction of a line of code, is automatically a bad thing. Especially if the scope in which that function is visible is limited.

      The test is whether it abstracts something in a way that makes things clearer and easier to manage. You can use the squit test: look at the code before it uses a function and afterwards; if you can tell by the look of the code that the after version is cleaner, then the function is doing something useful.

      The problem I think is the desire to turn utility functions into libraries, and libraries into frameworks prematurely.

      This is in part due to the advantages to having more "intellectual property" if you want to sell your company, partly due to the cachet of being a framework designer. This leads to a solution to a problem being embodied in a framework before the problem is fully understood.

      There's a separate art to GUI design over and above software engineering, but to a large degree that's a orthagonal set of problems. Good software engineering should result in software components that are reliable and reusable without excessive risk; the same qualities which faciliate refactoring also faciliate continual GUI improvements.

      In the end, both fall under the same principal of craftsmanship: make it work, then make it better.
      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    5. Re:It's a trade-off by KDan · · Score: 1

      Agreed... factoring the "lines of code" into a function without thinking about some sort of higher purpose reason why that function needs to exist is a bit similar to thinking "I need a music in all the rooms of my house, and i already have a car radio, so i'll just copy that and reuse it in all the rooms"... it might make sense at first but it's a maintenance nightmare waiting to happen.

      Daniel

      --
      Carpe Diem
    6. Re:It's a trade-off by ClosedSource · · Score: 1

      "I think that while pasting a few lines of code is normally harmless, it doesn't follow that a function that replaces a few lines of code, or even a fraction of a line of code, is automatically a bad thing."

      I'm against any programming principle that says that anything is "automatically a bad thing". My post was a reaction to the recent movement in software development that tries to substitute absolute rules for good engineering judgement. I consider the "don't repeat yourself" rule to be an example.

    7. Re:It's a trade-off by Schraegstrichpunkt · · Score: 1

      Only if that makes the code easier to read.

  2. Dont code GUIs... by forgoil · · Score: 2, Insightful

    There is no need to code your GUI with todays environments. Simply design it, "draw it", in an editor. If youre doing .NET, Cocoa, or Java it should be a breeze. Doing it all in code will basicly just take time, time you could spend on something better.

    1. Re:Dont code GUIs... by dave1791 · · Score: 3, Informative

      Errr... there are still controller classes; those nastly little things that sit behind your gui. The last I looked, you had to do at least SOME coding. But in general, the ui elements themselves are just painted now.

    2. Re:Dont code GUIs... by cerelib · · Score: 4, Insightful

      I do Java Swing GUIs and I tend to agree with you. The eclipse visual editor plugin makes GUI creation very easy, but it has it's limits. Almost every time I have used it, I have hit some point at which I wanted to do something that the visual editor did not understand. When I hit that point, I have to get in and code it by hand. Since I learned how to do it from code when I started, this is not too much of a problem. So it does help to know what the code means.

    3. Re:Dont code GUIs... by anomalous+cohort · · Score: 1

      Why was this moderated insightful instead of funny?

    4. Re:Dont code GUIs... by Anonymous Coward · · Score: 0

      What a rediculous statement, yes for the most trivial dialog, you can just assemble it. For any kind of serious user interface, engineering is required. Not to mention you'll need to be making lots of your own controls unless you want it to look like 7th grader built your app.

  3. Try this one out by El+Cubano · · Score: 3, Interesting

    Is there a good guide (online or off) for the Software Engineering aspects of GUI programming, so that I can learn how to reuse code, and build my class hierarchies over the one provided by the toolkit?

    Not sure if it is exactly what you are looking for, but I think a good starting place would be Designing Interfaces by Jenifer Tidwell from the O'Reilly collection. It helps if you are already familiar with design patterns, as the book casts its concepts in terms of patterns.

    I would think that if you are an experienced Software Engineer and programmer, you would be much better served by something targetting the fundamentals of interface design. You can apply what you learn to any language or toolkit you know now or learn in the future. If you target a particular language or toolkit from the beginning you will limit yourself and make it harder to apply language-specific or toolkit-specific things to a different language or toolkit.

    1. Re:Try this one out by lkeagle · · Score: 1

      Here's some great books that have nothing to do with the actual programming of GUIs, but are invaluable when it comes to designing them well. Most problems programmers have with programming user interfaces will disappear once you have a firm grasp of how you want your data to be displayed in the first place.

      "User Interface Design for Programmers" - Joel Spolsky

      "The Design of Everyday Things" - Donald Norman

  4. "New" interface by LiquidCoooled · · Score: 2, Funny

    I designed a new web browser, it uses a professional interface, here is the code:

      10 INPUT "Enter the URL: "; U$
      20 PRINT "Finding "; U$
      30 PRINT "Opening "; U$
      30 PRINT "Slashdot. News for nerds, stuff thats happening"
      40 PRINT "1. Ask Slashdot: Software Engineering of GUI Programming?"
      50 PRINT "2. Ask Slashdot: Can a Manager Be a Techie and Survive?"
      60 PRINT "3. Your Rights Online: China Jails Porn Site Leader For Life"
      60 PRINT "4. Close"
      70 REM
      80 INPUT "Select your destination: "; I

    --
    liqbase :: faster than paper
    1. Re:"New" interface by marcello_dl · · Score: 2, Funny

      After the input string put a comma not a semicolon, noob.

      --
      ---- MISSING MISCELLANEOUS DATA SEGMENT --- [sigdash] trolololol
    2. Re:"New" interface by LiquidCoooled · · Score: 1

      Who are you calling a n00b?
      if you were looking for errors instead of optional syntax (see here for clarification), I think you will find my only error is with the line numbering.

      --
      liqbase :: faster than paper
    3. Re:"New" interface by Darth+Liberus · · Score: 1

      In Atari BASIC the comma would spit out a tab while the semicolon just concatenated. I think most BASICs were like this.

      --
      Beauty is just a light switch away.
    4. Re:"New" interface by mrobinso · · Score: 1

      LiquidCoooled (634315), on Saturday November 25, 4:48PM, wrote:

      > Who are you calling a n00b?
      > if you were looking for errors instead of optional syntax, I think
      > you will find my only error is with the line numbering.

      Wrong.

      > 30 PRINT "Slashdot. News for nerds, stuff thats happening"

      Should be...

      30 PRINT "Slashdot. News for nerds, stuff that matters"

      mike

      --
      -- Karma whore? You betcha. --
    5. Re:"New" interface by LiquidCoooled · · Score: 1

      damn, you found it.
      Ahhh well, I hope noone was injured trying to copy my code.

      --
      liqbase :: faster than paper
    6. Re:"New" interface by Tablizer · · Score: 1

      Aren't you forgetting?:

      90 PRINT "PROFIT!"

  5. I'd be surprised if there was a guide by Jerf · · Score: 5, Interesting

    Most people don't seem to think about refactoring their GUIs; already there's one post here telling you not to code your GUIs but use the pathetic drawing tools to create them, even though GUI builders are evil, and one of the very reasons they are evil is they preclude even the simplest refactorings. The bulk of programmers seem to be happy about that.

    My experience is that there really isn't anything special about GUI refactoring vs. any other kind of refactoring, at least in the languages I use. That may be a factor; dynamic languages like Python or Ruby seem to be a lot easier to implement "Don't Repeat Yourself" in. You may find you'd be better off switching to one of them, especially if you're trying to work in Java, with seems to elevate repeating yourself to a moral imperative.

    But beyond that, I don't really see what's special about GUIs.

    The other thing is that when you are first learning an environment, you need to cut yourself some slack. No matter what you do, your first few cuts will suck as you are getting your bearings. I'm all about refactoring and testing, but when I recently picked up Django, I didn't worry about either at all in the first week. Now I have to go back and re-examine everything I did and get the testing going for it, but I don't see any practical way to avoid it; testing my initial garbage would just increase the investment into code that I'm basically throwing away anyhow. (As I have a lot of web experience, that's probably faster than usual; any other framework type would probably take me longer.) You may find that you have built "one to throw away"; consider actually doing so.

    1. Re:I'd be surprised if there was a guide by Osty · · Score: 4, Interesting

      even though GUI builders are evil

      I'd just like to point out that the article you linked is crap. Or, more precisely, it's written by a developer who's apparently never used a GUI design tool. Most of his "problems" boil down to, "You're still going to have to write your own code anyway, regardless of what you do in the GUI builder," which I answer with a great big, "Duh!" In fact, most of his signs of GUI builder use are really just signs that you're dealing with a lazy developer, a non-developer who bought into the idea that he could just drag 'n drop his way to freedom, or a developer (like the author) who's not very familiar with the GUI builder in question and/or has pre-judged the GUI builder tool before even trying to use it.

      Granted, 99% of my GUI builder experience has been with Microsoft Visual Studio which is actually very good, so maybe his concerns are valid for other tools. Of his list of signs, Visual Studio makes it trivial to handle the first three (layout management, variable names, and localization), it's possible to fix the fourth one by writing custom controls, and there's nothing wrong with the fifth one (common boiler plate code) though with the use of parital classes in .NET 2.0 Visual Studio does its best to hide that from the developer.

    2. Re:I'd be surprised if there was a guide by Anonymous Coward · · Score: 0

      There are precisely two good GUI designer tools that handle layouts properly. Trolltech's Qt Designer and SASG's MUI, and the latter is for a zombie platform.
      All else is crud.

    3. Re:I'd be surprised if there was a guide by gknoy · · Score: 1

      You mentioned Ruby. Do you have any suggestions for a good toolkit to use with Ruby, and any good sample / example / tutorial code/info on using said toolkit? I've looked briefly at the FXRuby toolkit (Based on the FOX toolkit), but wasn't sure if there were any other good kits out there.

      This could also just be an instance of "quit stalling and try to USE FXruby", and if so, i'm open to hearing that, too. ;) I'm a relative Ruby neophyte, so that may be part of my slacking's reason.

    4. Re:I'd be surprised if there was a guide by ClosedSource · · Score: 2, Insightful

      "even though GUI builders are evil, and one of the very reasons they are evil is they preclude even the simplest refactorings. The bulk of programmers seem to be happy about that."

      The whole point of using a tool that generates boilerplate code is that you don't want to mess with it. Refactoring is really a means to enhance maintainability, it doesn't add much value for code you don't intend to modify.

    5. Re:I'd be surprised if there was a guide by lagerbottom · · Score: 1

      Honestly, I thought the GTK+ Ruby stuff was half decent. And the documentation was better than when I was writing Perl-GTK+ s. http://ruby-gnome2.sourceforge.jp/

      --
      "He was a wise man who invented beer." - Plato
    6. Re:I'd be surprised if there was a guide by peterarm · · Score: 1

      One thing that is special about GUIs is that it's much harder to unit test them. Yes, you can build an object model and unit test that, but it's not as ideal a situation as what server side developers can do. If you don't have a comprehensive suite of tests, it makes refactoring much harder. Server side developers are spoiled in this regard (building good unit tests is much easier), but many don't realize it...

    7. Re:I'd be surprised if there was a guide by Bazouel · · Score: 3, Informative

      The article you mention is total bullshit to me. If one know how to use a modern GUI toolkit correctly, then his whole point on code reuse/repetition disappear. I mean, has he ever heard of UserControls? Of MasterPages/Forms? What about using a single DropDownList instead of multiple RadioButton? And when he shows how he could reduce the code size by using a for loop, it is totally bogus. This code is LESS efficient that the generated one!

      --
      Intelligence shared is intelligence squared.
    8. Re:I'd be surprised if there was a guide by modeless · · Score: 1

      Have you tried Visual Studio 2005 with Windows Forms 2.0? It is much improved over 2003/Windows Forms 1.0, especially so in the layout department. Its only major lacking feature is the tear-away panels ironically used to such great effect in the Visual Studio IDE itself. Well, that and a concept of "action" to tie together menu items, keyboard shortcuts, undo/redo, and scriptable actions. And in general a simple way to implement proper separation between Model, View, and Controller in a modern application. But I'm not sure anyone's got that completely right in a GUI framework yet, even Trolltech.

    9. Re:I'd be surprised if there was a guide by Aaron+Isotton · · Score: 1
      I mean, has he ever heard of UserControls? Of MasterPages/Forms? What about using a single DropDownList instead of multiple RadioButton?

      Here you see what happens when people do too much GuiDesign.

    10. Re:I'd be surprised if there was a guide by RAMMS+EIN · · Score: 1

      ``If one know how to use a modern GUI toolkit correctly, then his whole point on code reuse/repetition disappear.''

      I dare hope so, but that doesn't mean that modern GUI builders are good, it just means they didn't get this point terribly wrong. Any technology must lead to good results if one knows how to use it correctly, or it should be directed straight to the thrash can.

      Now, assuming that both GUI builders and their alternatives produce good results when used correctly, the question is which is better to use. I personally prefer typing things in rather than doing things graphically; probably because it gives me a greater feeling of accuracy and control. However, I'm fairly extreme in this (I prefer typing PostScript over drawing, too), so I won't generalize from me to the general population. However, I will point out that GUI builders producing good results is an _assumption_, and one that I know not to be true of some of them.

      --
      Please correct me if I got my facts wrong.
    11. Re:I'd be surprised if there was a guide by computational+super · · Score: 1
      What about using a single DropDownList instead of multiple RadioButton?

      In other words, constain the design of your UI to the limitations of the GUI builder? I think you pretty much just made his point for him.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    12. Re:I'd be surprised if there was a guide by computational+super · · Score: 2, Informative
      Most of his "problems" boil down to, "You're still going to have to write your own code anyway, regardless of what you do in the GUI builder," which I answer with a great big, "Duh!"

      So - the original developer, and every subsequent maintenance programmer need to now understand not only the core language, but all of the subtle nuances of the tool that controls the UI in addition to the myriad ways the two interact (or fail to interact). All in the interest of simplifying GUI construction? I think you just made his point for him.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    13. Re:I'd be surprised if there was a guide by computational+super · · Score: 1
      The whole point of using a tool that generates boilerplate code

      The need for a tool to generate boilerplate code is a sign that either the underlying framework has problems or that your understanding of it is flawed. I don't need a tool to generate GridBagConstraints (talking Java now) because all of the "boilerplate" stuff was refactored up into a reusable class by Sun.

      --
      Proud neuron in the Slashdot hivemind since 2002.
    14. Re:I'd be surprised if there was a guide by Bazouel · · Score: 1

      Using dropdown lists is actually a *mandatory* accessibility guideline when designing a web interface. Yes, even for Yes/No choices. If you don't do it, you will fail the validator. See http://www.access-board.gov/sec508/guide/1194.22.h tm

      Plus, doing databinding on a radio button frame is a major PITA.

      In other words, even if I would ever code by hand, I would still use a dropdown.

      --
      Intelligence shared is intelligence squared.
    15. Re:I'd be surprised if there was a guide by MicrosoftRepresentit · · Score: 0

      Not at all. The code generated by the form designer in VS2005 is in a partial class, you never have to see it and you never have to deal with it.

      Even better, in OSX, there is no generated code at all, as all objects in your GUI are simply serialised instances of the controls you drag and drop in InterfaceBuilder (the OSX equivalent of VS2005's form designer). Bindings just makes it even better.

    16. Re:I'd be surprised if there was a guide by Raenex · · Score: 1

      I didn't see anything on that page you linked to about radio buttons not being allowed or dropdown lists being required. I also don't see what the "major PITA" is.

    17. Re:I'd be surprised if there was a guide by Bazouel · · Score: 1

      I just completed a project where conformance to this norm was a requirement, so it is not talk in the air. Do a web page and validate it against a tool and you will see.

      As for the PITA:

      - If the list of options come from the database or config file, doing the binding is really an annoyance (creating control dynamically and such). Plus, if you work on desktop app, you need to handle positioning and sizing yourself. Wow, great! Then, the list might one day have too many elements for the screen space you have.

      - If the list is hardcoded ... you are joking, right? I am not going to recompile/redeploy everytime I want to change an option, thank you very much.

      --
      Intelligence shared is intelligence squared.
  6. The basics. by Balinares · · Score: 5, Interesting

    Alright, I'm a little busy right now so I won't go into as much detail as I'd like, but here are the basics as far as I understand them.

    1) Design patterns still apply. More than ever, actually. If you've not read the GoF, it features a pretty advanced example centered on the design of a rich text editor. You will probably want to dive deeply into the workings of the Model-View-Controller pattern and the related design constructs. The MVC pattern is not the be all and end all of GUI design, and there are many cases where the articulation between View and Controller

    2) You may not now it yet, but you want loose coupling. Loose coupling means that, essentially, when a widget's state change, it will report on that change, and some interested party will be notified about it, and neither will have to know anything about the other. Many toolkit nowadays come with good signal and slot mechanisms to implement loose coupling. Understand them, and use them. If you find the sender of a signal and the receiving slot need to know about each other, you may want to go back to the drawing board as suggested in point #1 above; it is usually not necessary.

    Conceiving GUIs is not all about the underlying software architecture, though; a good chunk of the work of making great interfaces is in the designing of the GUIs themselves (which is why you want loose coupling -- you WILL have to be flexible against changes as you experiment). I will let others fill you in about that. Quickly: read usability guidelines and get a feel for why they suggest what they suggest. Align your widgets! NetBeans is good for this, IIRC. Use GUI designer tools, experiment more.

    That's all I can think of off the top of my head, but there's already a lot for you to chew in there. :) Hopefully other people will have more details to give you.

    All in all, it boils down to the usual rules of engineering: the second rule is to know what works, and the first rule is to know why it works.

    --

    -- B.
    This sig does in fact not have the property it claims not to have.
    1. Re:The basics. by McLoud · · Score: 3, Funny

      The MVC pattern is not the be all and end all of GUI design, and there are many cases where the articulation between View and ControllerSee? That's why you dont use these evil MVC-oriented programs, one just ate your post.

      --
      sign(c14n(envelop(this)), x509)
    2. Re:The basics. by Anonymous Coward · · Score: 0

      How about some basics:

          1. What OS are you targeting?
          2. What language are you using?
          3. What toolkit(s) are you considering?

      I've got many years of experience in developing desktop GUI's and GUI applications, and I'd be more than happy to share some insight. However, without a few specifics, your not going to evoke much beyond a high level philisophical discussion. My first peice of advice would be to ask yourself the three questions listed above and let us have a hint at your direction.

    3. Re:The basics. by Doctor+Memory · · Score: 1

      I'd also recommend looking at the factory pattern. Whenever you need a form/page/screen, you just instantiate the appropriate factory and have it create the form/page/screen. The factory will know what widget set you're using, what OS you're targeting, and what device the GUI should work on. Typically you'll make a generic GUI factory, then subclass it for the particular widget set you're using.

      Try to design your GUI so that it can assemble itself (via a layout manager or templating system). This makes the actual construction of the GUI a non-event, since you don't actually do it, the layout manager does. Adding a new control or rearranging the layout is pretty simple. It can be a bit harder if you're trying to create something fancy, but it can also make following corporate standards easier, since once you've got your layout manager configured, all the forms/pages/screens it produces will fit the standard.

      --
      Just junk food for thought...
    4. Re:The basics. by modeless · · Score: 1

      I second the suggestion to look at Model-View-Controller. It is not always clear how code should be separated to fit the pattern, and it's not always possible or desirable to separate the three parts to the point where each part could be modularly swapped out. But maintaining a healthy amount of separation, especially between the model and the view, will definitely result in a more flexible and easier to maintain application.

  7. Mono and Gtk# too by flydpnkrtn · · Score: 1

    Don't forget Mono and Gtk# too!

    How are Gnomedevelop/KDevelop at simply "painting" instead of "coding"? Anyone know?

    1. Re:Mono and Gtk# too by MaggieL · · Score: 0, Troll

      Don't forget Mono and Gtk# too!

      Now, more than ever: forget Mono.

      --
      -=Maggie Leber=-
    2. Re:Mono and Gtk# too by flydpnkrtn · · Score: 0, Offtopic

      Rather than just a broad statement like that can you please say why?

      The Mono/Microsoft deal? Or why?

      I can see you're a Java programmer (I'm checking out your delicious cloud)... is it the fact Java's open source now? (Which is a valid point, IMO)

    3. Re:Mono and Gtk# too by WilliamSChips · · Score: 1

      My first guess would be a patent minefield that Mono seems to be in currently.

      --
      Please, for the good of Humanity, vote Obama.
    4. Re:Mono and Gtk# too by Randolpho · · Score: 1
      Don't forget Mono and Gtk# too!


      Now, more than ever: forget Mono.</blockquote>

      Nevar! C# and the .NET framework are things of beauty! <br/><br/>

      Gtk# however.... meh. Well, actually, I don't have much experience with it so I can't say if it's better than Win.Forms. But Win.Forms *is* infinitely better than Swing...
      --
      "Times have not become more violent. They have just become more televised."
      -Marilyn Manson
    5. Re:Mono and Gtk# too by tambo · · Score: 4, Interesting
      Nevar! C# and the .NET framework are things of beauty!

      That's probably overstating it by a fair margin. ;)

      Many parts of C# are awesome, and work very nicely:

      • GDI+ is extremely easy to use and predictable.
      • I like the way they've organized System.IO and System.Collections.
      • The Win.Forms control set is very, very well-done.
      • XML web services and Regex are also quite passable.
      • Reflection is nice, even though I don't often have a chance to use it.
      • ADO.NET's simple classes (Connection, Command, DataReader) are very straightforward, and I use them all the time in my database stuff.
      • The Setup and Deployment projects are absurdly easy to use. I love it!
      Other parts are so-so. They work, but they're not really intuitive, and I frequently find myself referring back to previous projects in order to remember how it works. Examples:
      • System.Security.Cryptography, for instance, has a whole lot of junk. When all I want is to generate a set of RSA keys and encrypt something, I still have to refer back to prior code samples.
      • Their weird proliferation of Stream types, with all of those weird Formatters, is very confusing. I don't like it.
      • Globalization has a lot of byzantine stuff in it that I find very confusing.
      • DataSet and DataAdapter are overly complex.
      • Events and Delegates are a little too crufty. I don't like the syntax (event += event handler? are you kidding?), and I don't like the fact that if the event doesn't have at least one subscriber, it's Null, and will thrown an exception if you raise it. That's stupid.
      Then there are the parts that completely suck:
      • Resource files? Totally botched! I still have no idea how to create a stupid resource file containing some bitmaps, and have it bundled into the application.
      • DataBinding. It is practically impossible to glue a textbox to a string, and have bidirectional updating. I don't understand how MS could have so badly wrecked this stuff.
      • The credentialing (Code Access Security, User Security, etc.) is so hopelessly complicated that I won't touch it with a ten-foot pole.
      • ASP.NET is very, very, very clunky. None of the controls work right, or in a predictable fashion. They don't even work anything like their Win.Forms counterparts! I can design very beautiful Win.Forms GUIs, but my ASP.NET projects always come out looking like third-grade HTML projects. Terrible!!
      I had big hopes for C# 2.0 - but it seems to be a little less stable and predictable. Generics, for instance, are a much-needed feature - but Microsoft didn't bother to implement it for ArrayList, the data structure that I use most often. And the new ADO.NET stuff is hopelessly complicated and useless.

      So despite its flaws, C# is still the drop-dead easiest API I've ever used. I've written several dozen projects in it, and I will continue to use it until something cleaner comes along. (I'm not holding my breath on that one!)

      - David Stein

      --
      Computer over. Virus = very yes.
    6. Re:Mono and Gtk# too by modeless · · Score: 4, Informative

      Generics, for instance, are a much-needed feature - but Microsoft didn't bother to implement it for ArrayList, the data structure that I use most often.

      ArrayList is still its original, non-generic self for compatibility reasons, but the new List<> class is its excellent replacement in the System.Collections.Generic namespace, along with the generic Hashtable replacement, Dictionary<,>. Don't know why they felt the need to change the names, although ArrayList->List was an improvement...

      Other than that, I agree. I'd just put events and delegates farther down under the "completely suck" section. They were really botched and it makes certain things a lot harder than they should be. Also, I'd mention the single greatest thing about C#, IMHO its saving grace: C/C++ interop. The design of the interop with legacy code is nothing short of brilliant. It's five minutes work to wrap and call a random C function, no matter if it takes pointers to weird structs or even a callback! And because of that, C# actually stands a chance of displacing C++ as the language of choice for Windows applications.

      If only Microsoft had fixed it to allow distributing C# applications with their own stripped-down runtime included, instead of requiring administrative install of the full 20+ MB .NET Framework including ASP.NET and who all knows what crap you don't need, it probably would have replaced C++ for many applications already. Something like perl2exe for C# is what I want. Just bundle the runtime and the JIT and your code up in one nice tidy ready-to-run executable. That would do wonders for the adoption of C#.

    7. Re:Mono and Gtk# too by allanj · · Score: 1

      I agree with just about everything you wrote, but there *is* a generic ArrayList in .NET 2.0 - it's just called List, and sits in the System.Collections.Generic namespace. I use it all the time, along with the generic Dictionary class that replaces Hashtable from previous frameworks. Generics are truly great, but I'm an old C++ guy so I knew they would be :-)

      --
      Black holes are where God divided by zero
    8. Re:Mono and Gtk# too by tambo · · Score: 1
      ...but the new List<> class is its excellent replacement in the System.Collections.Generic namespace, along with the generic Hashtable replacement, Dictionary<,>.

      Wow. You've just made my life easier. :) Thank you!

      (I think they generally change the names so that the original implementation remains intact. They did the same thing with DataGrid, for instance - the "upgraded" class (I hate them both, though) is called DataGridView.

      While I understand their rationale, I find this nomenclature very confusing, and ultimately self-limiting. I mean, we're on C# version 2, and already IntelliSense is starting to look very cluttered with junk that I don't recognize.

      I'd mention the single greatest thing about C#, IMHO its saving grace: C/C++ interop.

      Yeah, that stuff is at least pretty good, from what I've seen. Don't have much chance to use it, aside from the rare need to register a hotkey with Windows or call a Beep function. ;)

      - David Stein

      --
      Computer over. Virus = very yes.
    9. Re:Mono and Gtk# too by Lord+Omlette · · Score: 1

      I suspect you are slightly confusing C# and the .NET class library... but your analysis of data binding, resource files and events/delegates is spot on. I'm glad I'm not the only one who feels this way.

      --
      [o]_O
    10. Re:Mono and Gtk# too by ssyladin · · Score: 3, Interesting
      I'll admit I've primarily (98%+) worked with Microsoft technologies, including .Net 2.0, so I won't compare what it has to different languages, but I want to make some counter-points. # DataSet and DataAdapter are overly complex.Yup, but there's a direction M$ is going. A DataTable boils down to nothing more than an object[][]. Roughly equivalent to a recordset in COM+ ADO. One big leap is row-level events, which has been infinitely useful to me, as I tend to pass around DataTables a lot in my line of work. I've also found the self-adapting O(n log n) "Select" method very useful (look up what it does using .Net Reflector). DataSets let you have constraints/relationships between data, and provide a WONDERFUL mechanism to convert to/from XML (especially if you have a good schema handy). Soon, M$ is going to integrate LINQ, or "Language Integrated Query", which can really help with CRUD or basic iterative queries. For us, offloading from the DB server is a typically priority #1.

      Resource files? Totally botched! I still have no idea how to create a stupid resource file containing some bitmaps, and have it bundled into the application.Yeah, blows. But here you go: System.Reflection.Assembly m_assembly = System.Reflection.Assembly.GetExecutingAssembly(); System.Drawing.Bitmap m_bitmap = new System.Drawing.Bitmap(m_assembly.GetManifestResour ceStream("Images\my_bitmap.bmp")); Just be sure the bitmap is included in your project and the "Build Action" is "Embedded Resource"

      Microsoft didn't bother to implement it for ArrayListUm... checked System.Collections.Generic.List?
    11. Re:Mono and Gtk# too by Snives · · Score: 1

      If only Microsoft had fixed it to allow distributing C# applications with their own stripped-down runtime included, instead of requiring administrative install of the full 20+ MB .NET Framework including ASP.NET and who all knows what crap you don't need, it probably would have replaced C++ for many applications already. Something like perl2exe for C# is what I want. Just bundle the runtime and the JIT and your code up in one nice tidy ready-to-run executable. That would do wonders for the adoption of C#.

      While it would have allowed for much faster adoption of .NET and Smart Client (WinForms) programming in particular, it wasn't possible for M$ to include the .NET framework automatically. Corporate sys admins had a fit about this being installed automatically for security reasons. Thus, even though the benefit of having it installed automatically as one of the many Windows Updates is obvious, to this day we still must do a separate administrative install of the framework.

    12. Re:Mono and Gtk# too by MicrosoftRepresentit · · Score: 0

      What patents? C# and the CLR are open standards (ECMA-334), the only thing Microsoft could patent would be the objects that make up the .NET framework, and I don't think the patent office is stupid enough to allow 'an object that draws a square' to be patented. Yet.

    13. Re:Mono and Gtk# too by modeless · · Score: 1

      I'm not talking about installing it automatically. I'm talking about a way to package C# applications such that merely executing them does not require the .NET framework to be installed. There's no reason simply running a program written in the C# language should require poking around in system directories and installing crap into the OS. Of course, every program packaged this way would have its own separate copy of the runtime. But they wouldn't need the whole framework, they could just bring the (small) parts they need. IMHO that little duplication is a small price to pay for what you get. And not every program would be packaged this way, only ones that need to run without an install.

  8. Object oriented design by edxwelch · · Score: 1

    You want code re-use?
    Object oriented design techniques work equally well for all areas of software engineering. Don't think there is some "special" technique for GUIs.

    1. Re:Object oriented design by Anonymous Coward · · Score: 0

      Found this over on Digg, and it looks like a good place to start:

      http://openubuntu.blogspot.com/2006/11/visual-deve lopment-of-linux.html

  9. Tcl/Tk and Earlier C++ books by meburke · · Score: 1

    There are all kinds of User Interfaces out there, and the simple elements such as buttons and boxes are popular mostly because they constitute the huge majority of "conventional" expectations. Tcl/Tk will give your a little more control over offbeat interactive elements, and early game books for C/C++ programmers will give you even more. What you learn from a book like Charles Petzold's, "Windows Programming" 5th Ed. will give you even more control over what happens on the screen. Petzold wrote some great books, and his books on C# and VB.Net are also terrific. That will cover the basics of controlling what is seen on your screen very elegantly.

    IMO, design considerations fall into two categories; Visual design and Usability design. Check out some of the features of Croquet and Project Looking glass. Neither of them is totally up to speed visually, but they are creating new usability. A flight simulator or game requires a different approach to make it usable. You might find some ideas there. Here's a question: How come managers are still reading reports to manage their business rather than simulating the business operations through a game interface? How come reports are still 2-Dimensional? Back in the early 80's I remember seeing an accounting program that allowed you to drill down in layers from the final reports to the details. Wish I could remember the name.

    Last guideline: Never let your Visual Design (or bad taste) detract from your usability.

    --
    "The mind works quicker than you think!"
    1. Re:Tcl/Tk and Earlier C++ books by Amadodd · · Score: 1

      Accpac for DOS had a DOS report writer called Caret, which I believe was the forerunner of Crystal Reports or just had similar features. Back in the day it had pretty amazing capabilities.

      --
      Freedom of speech doesn't come with bandwidth.
  10. Digg me down. Wait, wrong site by BladeMelbourne · · Score: 2, Informative

    I don't have any links to provide, but these few tips might be useful:

    1) Don't duplicate code. The second time some functionality is used, create a library function. Try to think of the variations required and maybe add extra parameters to the function to cater for them.

    2) Be consistent in your approach (similar wording on dialogues, standardized placement of objects, consistent use of terminology).

    3) Think of your user. Determine your minimum resolution (eg 800x600). Will some users want keyboard navigation/use of your application?

    Sorry if this is stating the obvious, but these 3 are rather important on my product (ASP.NET/C#/JS).

    1. Re:Digg me down. Wait, wrong site by Anonymous Coward · · Score: 3, Interesting

      And please, PLEASE, when possible, use the colours that are specified in the gtk/qt/windows theme settings.

      I am so sick of applications, like Photoshop for Windows that has ahrd coded black text for most of it's dialogs. I use a bright grey on dark grey/black colourscheme to preserve my eyes at night and no matter how depressed I or Marvin might be, black on black is not readable.

      I think there should be some sort of standard or UI Useability Compliance Organization or something to promote this concept.

      Am I alone in thinking this way? /rant

    2. Re:Digg me down. Wait, wrong site by Jack+Schitt · · Score: 1

      Don't hit me too hard for this one... since I'm stuck on Windows at the moment, I might as well mention that the 'Made for Windows $version' logo testing requires using Windows supplied colors. It's part of the accessibility requirements for instances where the user needs a high-contrast color scheme (iirc).

      The only instance where I use hard coded colors? During the debug/testing phase (eg. a big bold green label who's text begins with "todo:")

      --
      This message brought to you by Jack Schitt's Previously Shat Shit
    3. Re:Digg me down. Wait, wrong site by Tablizer · · Score: 1

      1) Don't duplicate code. The second time some functionality is used, create a library function. Try to think of the variations required and maybe add extra parameters to the function to cater for them.

      From experience, 2 is too low a threashold. Around 4 or 5 is more realistic. Sometimes things are the same out of coincidence, not out of any domain linkage. It takes 4 or 5 before it is a fairly certain and stable rule. 2 also results in a lot of jumping around to read or debug code.

  11. Re: also try this one by Anonymous Coward · · Score: 0

    Large-Scale C++ Software Design by John Lakos

    The book does not specifically address GUI design issues; however, it will help focus your efforts even if you're already fairly familiar with modular design principles.

    ---

    Book recommendations aside, I'd like to add my own two cents about GUI architecture problems. In my experience GUI toolkits tend to offer the appearance of component-level modularity, but the underlying GUI primitives allow end-runs around that modularity (e.g. the Win32 API allows you to query or modify parent-child relationships). This is compounded by user expectations for GUI elements do not fit the direct parent/child model.

    Consider a button (e.g. "back") or slider control (e.g. zoom level) on a floating toolbar that interacts with a certain type of view in the client area. Sure it's "easy enough" to make a special-case for a limited set of controls and views, but things quickly get muddy as the number of controls and/or views explodes, or if you want to implement the view in a DLL/shared object and ship it separately. Thus the "proper" solution in this case is to design a special interface for the toolbar elements and the view; however, sometimes it's unclear which (if any) toolbar elements actually belong in the interface. In fact, it's probably most appropriate to let each view class define its own toolbar to be activated by the framework when the view becomes active (note the emphasis against allowing the class to perform such activation by itself).

    Here's a basic pseudo-layout of what I'm talking about:
    (your-app-main-window
        (non-client-area (toolbar-manager (toolbar (various-buttons-and-controls))))
        (client-area (MDI-frame-window/view-manager(MDI-client-window (abstract-view)))
    )


    And here's how you'd design the class interaction:
    (dll/shared-object
        (private (manager-class
            (toolbar-class)
            (view-class)
        ))
        (public (onload-function
            (register-manager-class)
        ))
    )


    Let the abstract view define its preferred toolbar. When the active view changes, framework notifies the toolbar manager to perform the necessary adjustments to disable the previous toolbar and if necessary create/display the current view's toolbar. This also lets the implementor of the toolbar/view create the necessary callbacks from the toolbar to the view.

  12. GUI's de-evolved by Tablizer · · Score: 2, Interesting

    GUI's used to be simple in the VB/Delphi days: drag and drop widgets, and then set attributes and fill in methods (on-click, etc.). One used to spend a only few days building GUI's, now they take weeks and months to get how the customer expects them.

    Some argue that such tools do not scale for different screen sizes. However, it is possible to build a "stretch zone" so that key widgets can stretch. But even if nested-based GUI's (like HTML) are used, it should not significantly change the nature of the method/attributes setting approach.

    People seem to attack the VB/Delphi approach with elistist-sounding rhetoric, but none of it stands up to scrutiny. I think they are just defending their high-cost feifdom. The VB/Delphi style was near the pinnicle of GUI development (minus the stretch zones) and we went backward instead. Java, Smalltalk, and Web approaches ruined a good thing. MVC is a mess only a mother could love.

    I think VB/Delphi-style will return one of these days because it was K.I.S.S. done right. GUI's are inharently visual, and thus visual design tools result in the most effeciency and closest match to the domain at hand (Visual GUIs).

    1. Re:GUI's de-evolved by mrlpz · · Score: 1

      What the flog are you talking about ? Near-pinnacle ? That's exactly the neanderthal response I would expect from a VB/Delphi programmer ( emphasis ON PROGRAMMER ).

      As someone who's not only designed and developed highly interactive user interfaces ( http://consumer.mci.com/TheNeighborhood/res_local_ service/jsps/callmanager.jsp?subpartner=DEFAULT , just to name one ) for almost 20 years, but also developed applications in both of those languages ( and many others ), I can tell that your statements are written with the same tunnel-mindedness that came up with VB in the first place ( I'll get to Delphi, further on ). VB was a way to rapidly prototype things, yes, and it could serve it's purpose well. But it fails miserably in two key areas that are ABSOLUTELY NECESSARY for any good software development effort. Ready ? Ok, here we go.

      1. Adaptability
      2. Extensibility

      For the former, VB is a nightmare at least to adapt to applications needed to operate in non-homogenous environments. If you're all M$, fine, but there, you're locked in.
      As for the latter, I direct the reader to just look at all the hullaballoo about the "evolution" of VB into VB.net to the point where there's near furor over the obvious attempts to get VB coders out of the last century, and into the here and now.

      Now as for Delphi ( or C++ Builder for those folks who chose it as their alternative to Pascalized-OOP ), it has the unpleasant distinction of being tied to a company who has no less than an identity crisis on it's hands ( I direct the reader to look up Borland's recent announcement to spin-off "CodeGear" as the "Software Development products arm" of Borland. Who for some reason thinks that Software ALM is REALLY where the money's at. Ding ! Wrong answer. But that's a different discussion ). The user community for Delphi is just as staunch as the VB encampment, but at least they've taken more readily to moving forward. Not to mention, that at least with it's Object-Pascal roots, it has more than a ghost of a chance at having software developed with it that has some software methodology applied to it, and therefore would make it open to being made extensible.

      The only reason VB could've provided a KISS "developer experience" was because of the proliferation of VBX/ACX/OCX controls ( which invariably ended up being written using MFC/VC++ ) to do the heavy lifting for them. Anyone who regularly reads slashdot doesn't have to be reminded what the proliferation of ActiveX controls has done for the user desktop experience ( hint: just ask anyone who's had their PC taken over as a zombie. Bets are it was due to an aberrant ActiveX control burrowing itself into the user's system ). Don't get me wrong, I don't hate VB, it, like so many other languages ( don't get me started on Smalltalk ) has it's place. But as a the be-all-end-all Sange Real of user interface development environements ? &Deity forbid.

      I just have to quote one statement "MVC is a mess only....." to state definitively as to the amount of real understanding of OOD methodologies you must have. Don't take it as an attack ( though chances are you probably will ), take it as a suggestion that perhaps you should take a deeper look.

      And to anyone who's curious as to what language/environment the desktop app I provided the link to earlier was written with/in, just ask. I'll give everyone a hint:

      1. Developed using strictly spen source tools and a cross platform language.

    2. Re:GUI's de-evolved by Shados · · Score: 1

      .NET/Visual Studio has better GUI "drag and drop" support than VB6 ever did.

      And Windows Presentation Foundation is coming out quite soon.

      Both of those things make VB/Delphi look "hard" when it comes to GUIs. I'm sure the Unix land has equivalents, too.

    3. Re:GUI's de-evolved by Shados · · Score: 2, Insightful

      VB6 and Delphi were RAD tools. RAD Tools still exist, and are commonly used. For a lot of stuff, many fields, certain company sizes, certain needs, they ARE "the right tool for the right job". VB6 blows by today's standards, but back then it was pretty cool, if what you needed to get the job done -was- a RAD Tool.

      Today there are others. A few years ago I worked with Oracle Developer. Don't know if they changed the name. I hated it, personaly, but a lot of large corporations had success with it. Today I know eDeveloper 10 is quite good, and actualy scales and adapt pretty damn well. Uses declarative programming though, and I can't stand that. Allows you to make stable and fast apps so damn quickly though that it more than evens out for the issues commonly associated with RAD Tools. Not my cup of tea though.

      There's more to the programming world than .NET/Ruby/Java/Python/PERL/C++/What-have-you. In many situations, those are overkill. And quite often, it IS a good business decision to go "Lets just use RAD to get our system done, since we're a small company. When we grow bigger, we'll scrap it and do it right". Rediculous for a 30 people company to make a fully extensible, scalable, maintainable system with all the bells and whistles in C++ with 1500 pages of documentation that works cross platform and yadah yadah yadah. Not everyone has these needs.

      Again, -I- hate these things too, because the environments I work in DO require the extensibility and maintainability of the more "serious" languages, but not everyone do.

    4. Re:GUI's de-evolved by ClosedSource · · Score: 2, Insightful

      I agree. I've seen startup companies go out of business trying to do things "the right way" when they could have survived by delivering a less internally elegant solution. Designing for extensibility and maintainability is all about paying more today so that you can save even more tommorow, but there has to be a tommorow for it to pay off.

    5. Re:GUI's de-evolved by mrlpz · · Score: 1

      Oracle Developer was a customized build of JBuilder tailored to work specifically and singlely with Oracle 9 ( and subsequently 10 ). I know, because I used those two products.

      Now as for RAD tools, there's plenty of RAD tools for Java besides those, there's Netbeans ( or for Eclipse, the Eclipse VE, Jigloo or WindowsBuilder Pro ) or IntelliJ Idea.

      Sure there's a frameworks for creating scaffolding for applications within Ruby, et al., but frankly much of that is strictly useful for creating boilerplate code that can be refactored as necessary.

    6. Re:GUI's de-evolved by Tablizer · · Score: 1

      You were not specific. Show me something that VB/Delphi cannot specificly do. Also note that internal applications and "boxed" mass market apps are two different things such that I don't necessarily claim that VB/Delphi is best for those. I am considering only inhouse or narrowly-distributed apps, not mass-market.

      For the former, VB is a nightmare at least to adapt to applications needed to operate in non-homogenous environments. If you're all M$, fine, but there, you're locked in.

      99.9% of all business PC's run Windows, for good or bad. When something as easy as VB/Delphi for multi platforms comes, I will consider it. But, it does not exist yet. Tcl/Tk is not visual. And, it is not free of versioning conflicts either.

      I just have to quote one statement "MVC is a mess only....." to state definitively as to the amount of real understanding of OOD methodologies you must have.

      OOP is overhyped in my opinion. It might be great for building systems software, but it is lousy at modeling the biz domain. And MVC does suck in my opinion. If you like that kind of tangled class mess, then so be it. Some like goto's and I can't change their mind either. OOP is the Goto of structures.

      The only reason VB could've provided a KISS "developer experience" was because of the proliferation of VBX/ACX/OCX controls ( which invariably ended up being written using MFC/VC++ ) to do the heavy lifting for them. Anyone who regularly reads slashdot doesn't have to be reminded what the proliferation of ActiveX controls has done for the user desktop experience ( hint: just ask anyone who's had their PC taken over as a zombie.

      I agree that MS could have implemented those better, but there were a wide variety of plug-ins available, and that is a *good thing*. Why are you saying that variety is bad? Rolling your own complex multi-layered grid widget is a pain in the ass. We are paid to solve biz problems, not invent GUI outliner widgets and micromanage mouse strokes, etc.

      When I see a better altnernative, I might change my mind. Sure, MS sucks in many ways, but they got more right than the alternatives.

    7. Re:GUI's de-evolved by Tablizer · · Score: 1

      .NET/Visual Studio has better GUI "drag and drop" support than VB6 ever did.

      In my initial experience, I am not impressed with it. If you go "outside the box" for any reason, you get stuck with cryptic errors talking about some internal gobbledy-gook being out of whack.

    8. Re:GUI's de-evolved by Shados · · Score: 1

      Those are IDEs that have some RAD capabilities. Not at all the same thing as eDeveloper, Oracle Developer, VB6 and so on.

      Oracle Developer also was a large framework, I was thinking about the actual RAD tool, which was a near code-less environment (except for some PL/SQL, there was little no way of adding any code beyond PL/SQL). The result was an application that required a special proprietary runtime (it ran inside another MDI software). I used JBuilder for several years too, it has nothing, -nothing- to do with it.

    9. Re:GUI's de-evolved by mrlpz · · Score: 1

      what the h_ll are you talking about then, because JBuilder ( and it's derivatives ) are classifiable ( even Oracles' literature classified them ) as RAD environments. Clarify your statements there, eh ?

  13. Use a capable language. by Anonymous Coward · · Score: 0

    Languages like C, Java, C# and C++ just don't offer the language features necessary for truly effective GUI programming.

    What you need is a language like Smalltalk or Common Lisp. Smalltalk is exceptionally good for GUI development, but the performance and integration with existing platforms has often been somewhat problematic.

    Common Lisp gives you what you need to minimize code duplication. Macros allow you to extend the language in amazing ways, for instance. But again, the main problem with using Common Lisp is the lack of solid integration with existing platforms.

    1. Re:Use a capable language. by mrlpz · · Score: 1

      Good &Deity ! What rock have you crawled out from under ? Where have you been for the last half-decade ? Have you ever even HEARD of Eclipse ? Hello ? Open Source Multi-platform Java and User-interface development ( with pluggable C/C++ support out of the gate to boot ! ). I know of several large legacy systems who're written in Smalltalk with their UI in Smalltalk as well, but no one nowadays in their right mind would actually walk up to their management and suggest any enterprise system be developed within it todat. The viable alternatives to it as simply too vast to ignore. And as for Common Lisp, I'll buy the minimization of re-code but user interfaces in Lisp ? Dude, maybe you stop inhaling, hmm ?

    2. Re:Use a capable language. by Eideewt · · Score: 1

      Why not do a UI in Lisp?

    3. Re:Use a capable language. by try_anything · · Score: 1
      Have you ever even HEARD of Eclipse ? Hello ? Open Source Multi-platform Java and User-interface development ( with pluggable C/C++ support out of the gate to boot ! ).

      C++ and Java are extremely static languages. The proliferation of boilerplate and superclasess/interfaces is just amazing, plus you get extra boilerplate because of the lack of support for functions and closures. Everything gets implemented as a class instance, and every time you want to make something dynamic (what isn't dynamic in a user interface these days?) you have to create another interface.

      Anyway, why should we assume you know more about Common Lisp than he knows about C++ and Java?

      I do most of my work in C++ (so you know I appreciate the power of compile-time type analysis,) but my GUI programming has been limited to Java and Python. (Python's dynamic nature is weak and clunky compared to Lisp, but it sufficiently superior to Java to be a stand-in for Lisp in this discussion.) I program much faster in Python, and my couple-day Python hacks typically beat the hell out of my planned, weeks-long Java GUI projects for functionality and usability. The only point where my Java apps win is the sense of grandiosity and accomplishment, because my Java apps are so frickin' big and perfect. (Actually, I never use my Java apps, but I keep the source code around in case I have to show it to someone to prove my Java chops. Java gives you a wonderful proud feeling of doing everything the right way, as nature and Sun intended.)

      The difference is not so much in direct calls to the GUI system but in the code that surrounds and supports the GUI calls. The windowing library I use in Python, wxPython, doesn't hold a candle to Swing in terms of its customizability and extendability (AFAICT) but I program so much faster in Python that I work around wxPython (or my limited knowledge of it) faster than I can program to the built-in extensibility hooks in Swing. It wouldn't matter much if the actual windowing code were generated by a wizard, because most of the complexity is in things like, "When should this menu item be grayed out? What commands should be available in this tab? What will the user want to do after doing X? How do I accomodate this unanticipated class of use cases?" This kind of programming has inherently fewer static patterns that can be usefully captured as superclasses and interfaces. The patterns that appear are usually better left unstated, because very soon a new use case will show they were accidental, not essential; however, Java and C++ leave you very little freedom to leave anything unstated, forcing you to constantly revise, retract, and rewrite things that you never wanted to say in the first place.

      Comparing Java to C and C++, Jamie Zawinski said:

      Java doesn't have free().

      I have to admit right off that, after that, all else is gravy. That one point makes me able to forgive just about anything else, no matter how egregious. Given this one point, everything else in this document fades nearly to insignificance.

      When it comes to GUI programming, I say the same thing about dynamic languages vs. Java and C++. Being liberated from the concrete shoes of interfaces and superclasses and "everything is a class instance" makes every other difference fade into insignificance. It far outweighs the benefit of compile-time type analysis. I don't believe this is true of all programming; I am not about to give up C++ for most of the work I do. However, in my experience it is true of user interface programming.

      P.S. I ignored the magic words "management" and "enterprise" because neither the GP nor the OP said anything about them.

  14. User Interfaces. by Lando · · Score: 1

    It sounds as if you are looking for tricks to make GUI programming easier rather than software engineering practices to build GUI interfaces. It's my opinion that as you program you can come up with your own methods to do that; however, you might want to check out the book "Professional Java user Interfaces" by Mauro Marinilli, Wiley Publishing. It doesn't seem to have many tricks, but does seem to focus on the software engineering aspect of GUI programming.

          Make sure to look through the book before purchasing though as I am not certain that this is what you are looking for.

    Lando

    --
    /* TODO: Spawn child process, interest child in technology, have child write a new sig */
    1. Re:User Interfaces. by mrlpz · · Score: 1

      Personally ( and I'm COMPLETELY serious about what I'm about to say ), I keep a copy of "GUI Bloopers" on my desk. Not so much as a reference guide ( which it is ), but as something solid and blunt to BONK any usability person who comes up draconian ideas of user interface design. Allow me to synthesize a lemma based on one of Einsteins postulates: The user interface should be as stupid as the user, but no stupider.

  15. Design Pattern First by Anonymous Coward · · Score: 0

    Ask yourself what design pattern will best meet the needs of the application. Model-View-Controller is very popular. The GUI is the view portion.

  16. Do you really need to maintain it? by pocari · · Score: 1

    As a software engineer turned UI designer, it seems to me that when the UI gets re-done, it is either trivial (change this word, so you change a properties file), or a complete overhaul. UI layers don't get maintenance the same way other layers do. Lots of people see them, so they change dramatically when there are problems.

    So I think it's best to take as much as possible out of the UI code and make it a really simple, almost disposable, client of really good APIs to the rest of the system. Simple is not necessarily elegant or clever. Simple might just be straightforward. If you have to add 100 countries to a list, it's OK to do that in 200 lines of code if those 200 lines of code are obvious in what they do.

    If someone knows the GUI toolkit, it shouldn't be hard to look at a screen and match it up to the relevant code. Just because you don't know it yet and could just as easily understand something you write yourself doesn't mean you shouldn't consider that there are more people out there who know the toolkit and its tendency to cause code to be repeated. They probably look at those sequences and read them without a second thought.

  17. Apple? by itomato · · Score: 5, Interesting

    Some resources:
    Apple's User Interface Guidelines; adapted from the NeXT/OpenStep Interface Guidelines (PDF).

    There's also the Classic "Macintosh Human Interface Guidelines" for System 1 through OS 9 (have to hunt it down yourself), GNOME's HIG,KDE's, and Tog's.

    Without reading through them all, I can't point out where they address BPs for reuse, management, etc., but I know it is touched on somewhat (although from a NeXT slant) in Apple and NeXT's guidelines.

  18. What kind of repetition? by drerwk · · Score: 1

    I'd like to know what kind of repetition you are seeing. Some of the posts here point out you will need controllers that are specific to your application. If you are seeing repetition there, then it may be an issue of wanting to reactor the UI itself and not the code. If you are copying the same draw(getIcon(MY_COOL_ICON)) then maybe you do need to subclass some pane to hold your icon. Also, at this point, most GUIs can be built nicely with the GUI Editors. Naturally you can make your UI better if you put more work into it. And some things still have to be done fully custom, e.g. you want a hexagonal window instead of the default rectangular or some such. I think what you may find, is that smooth, well designed interfaces that look good visually take a fair amount of effort.

  19. And for chrissakes, remember this is a HMI by thoglette · · Score: 3, Insightful
    The other posters have pointed out that GUI development is a mature art and not much different to other SW problems. It is also incredibly repetitive.

    The really difficult part is to make your GUI usable - particularily if your GUI contains any autonomous information (eg. alarms); information from disparate sources/applications and/or your underlying application is complex (eg. a combat system)

    At that point you really need to workshop with your stakeholders on use cases;

    How many clicks are needed to get to any function?

    How well trained/tired/busy/stressed are your human operators?

    How many modes of operation are there?

    How are you going to manage "status" and "alarm" displays across the suite of screens?

    What happens when some application starts struggling/crashing/spewing data?

    Training and documentation (user manuals, trainer manuals, debugging manuals) also need to be considered - it's all part of the experience.

    At the pointy end of the business, various layouts/schemas are compared by measuring operator hand and eye movement loads!

    Ps - For any reasonably complicated GUI you will want an API between your text/visual _specification_ and your code

    --
    -- Butlerian Jihad NOW!
    1. Re:And for chrissakes, remember this is a HMI by RobinH · · Score: 1

      If you're getting into the kind of issues you mention, I highly recommend the book, "The Design of Everyday Things" by Donald Norman. He uses simple examples like door knobs, stove tops, etc., but all of his work is directly applicable to GUI design. The principles of good design are timeless.

      --
      "I have never let my schooling interfere with my education." - Mark Twain
  20. Threads and GUI by DimGeo · · Score: 2, Informative

    Something I've learned the hard way: Never modify any GUI stuff outside the main event loop thread. Well, in Win32 it is possible to get away with it (but you must know what you're doing - i.e. painting to a back buffer is OK, but not drawing into a window). In Swing/AWT you can use SwingUtilities.invokeLater(Runnable) (don't pass anything that extends Thread to it or you will make uncollectible garbage). There must be something similar in the other GUI frameworks out there.

  21. Done it by ZiggyM · · Score: 1

    Ive come across this problem many times over the years. I can give you some advice in Windows, which is where I have the most experience: To reuse UI code easily, use a library that exposes the Win32 GUI API as a class hierarchy, like MFC. You can derive from classes to specialize a control, and reuse the base class handlers and such. To reuse the UI itelf, use a "sub-control", to do that easily in windows create a dialog without caption, put the controls you want in the dialog, and in properties make sure to set "control" and "control parent". Then put the code as you would normally do with a modless dialog (there are a few gotchas but once you get them all in a base class you dont need to worry about those anymore). This is like a cheap version of an activex control. Also, In MFC and other libraries there is a mechanism added to the win32 api called message refleccion, which allows a message that is normally received by a parent window, to reflect back to the control itself. This allows you to have a windows control handle itself, and thus you can reuse it.

  22. A good article to start by neves · · Score: 2, Informative

    I wholeheartedly recommend this Martin Fowler's article to start with.

  23. Examples by Anonymous Coward · · Score: 0

    When I had to learn good techniques for building swing apps I looked at other projects. Luckily someone I worked with at the time 'got it' so I was able to see a project that used Actions, applied MVC and interacted with the event thread correctly.

  24. code reuse is NOT the problem by 12357bd · · Score: 1

    so that I can learn how to reuse code, and build my class hierarchies over the one provided by the toolkit?

    Believe me, desiging a class hierarchy is NOT a problem, it's much more difficult to learn to design good GUIs, after all they are the 'contact point' with the user, so clarity, simplicity, predictability, etc are the real challenge, it takes a lot of imagination and experience to design GUIs that doesnt get noticed!

    --
    What's in a sig?
    1. Re:code reuse is NOT the problem by josepha48 · · Score: 1
      I'd agree. Designing a good GUI is not something many developers do well. Most developers develop GUI's that they think are good, but often lack in many ways, usability often being the first.

      If the original poster is having problems with designing reusale code, it is not because of the GUI, it is because he needs help with design. I'd suggest getting a design paterns book and maybe even a book on GUI design. Try the orielly.com web site, as they have some. For web design, try a book called 'defensive desing for the web.' This book goes over several things NOT to do when dealing with GUI design.

      --

      Only 'flamers' flame!
      Does slashdot hate my posts?

  25. Adobe's Adam and Eve by mathgenius · · Score: 1

    This looks really interesting: Adam and Eve
    Has Anyone tried it out ?
    It looks like they take the approach of using a domain specific language for building the GUI.

    Simon.

  26. My suggestion by KalElOfJorEl · · Score: 1

    I'm not sure what you're doing in your gui, but here's my own $.02. (Note: this is Java related more than anything else, though my thoughts could be extended to C# I'm sure)

    If you're going to have several smaller windows in your app (dialog boxes and such), I would suggest possibly creating some wrapper classes that have the the basic dimensions and alignments for the template you're trying to follow, so that you're not repeating code like assigning sizes and buttons and such.

    As far as design goes, you could try a factory setup and have several wrapper classes (as mentioned before) that are allocated in some static class somewhere and make calls for different parts of the GUI using reflection. This would cut down on memory usage but thread safety could become an issue.

    Code repetition can be a tricky thing to assuage depending on the scope of it. As others have said, that's not always an indication that you should go write another class to handle it, but if you're calling several methods of GUI objects and they happen to be the same methods, wrapper classes may be a good fit for you.

    1. Re:My suggestion by gurps_npc · · Score: 1

      I agree with this statement. I would add other things as well. Java like to be very flexible, putting listeners, bars, and buttons as seperate items. You reall don't need all that flexibility. If you REALLY want to reuse code and simplify your life, try making a single object that incorporates all three things. It is not that hard to have method on your bar type object auto-create a button and and a listener, and require you to implement an action for what happens when you click the button. With a line like container_object.new ("Caption","method_goes_here"), it all gets created. It adds a new button called Caption, with the word Caption being displayed, when it gets clicked, method_goes_here gets triggered.

      --
      excitingthingstodo.blogspot.com
  27. Re:Acccounting package by meburke · · Score: 1

    I remember that, but that isn't what I ws thinking of. I think the product may have been called something like, "NewView Accounting", but I'm not sure.

    --
    "The mind works quicker than you think!"
  28. Reliable Software through Composite Design by Latent+Heat · · Score: 2, Informative
    My all time favorite software engineering book is Glenford Meyers, Reliable Software through Composite Design. The book predates OO and is based on a module/function tree/hierarchy model of a software system. The book comes up with these module "strengths" ranging from "coincidental" (taking reoccuring sequences of code and calling it a module -- considered weakest reason) to "functional" (making a module out of code that has a simple declarative sentence description -- considered the strongest reason). The book has a lot of discussion regarding whether a repeated sequence of code merits its own module.

    As the book predates the widespread use of OO, it has a kind of proto-OO or proto-object in the form of "communicational" modules -- collections of functions that operate on some common data organized in a data structure or a name space. The communicational-strength module, of which there is a lot of support in Modula-2 and pre-OO Ada, is kind of like a static or perhaps a singleton object, and the reason for this kind of programming is that back in the day dynamic memory allocation was regarded as being fraught with peril -- either too expensive or too risky in terms of heap fragmentation. Remember also the computer speeds and amount of memory that we had compared to today. Classes and their objects are really the communicational module applied to where you have good heap management algorithms and perhaps even GC as well so you dynamically allocate an allow multiple instances of things and don't worry.

    I wish there was a latter edition of "Reliable Software through Composite Design" that addressed OO in some ways, but Martin Fowler's works on refactoring comes close. What I also like about Fowler is that all of his refactorings are reversable so if you find that you have too many code snippets in functions, inlining the code snippets and eliminating the functions is an "allowed" process instead of something you are scolded into never doing.

    As to cut-and-paste, whenever you see yourself using the text editor to copy any block of code to replicate the same functionality, you are asking for some kind of trouble at some level. The whole problem with cut-and-paste is that your code is littered with multiple copies of the same function, perhaps with some minor variations, and if you have a bug in that sequence or need to revise that common functionality, it is a lot of work to search it all out in your code and fix it.

    On the other hand, many times that repeated sequence of code doesn't lend itself to a proper kind of function and you have so many customizations of that function or flag parameters to that function (Glenford Meyers really lays into flags as function inputs and explains why -- I guess Microsoft didn't read his book when doing the Windows API).

    A lot of the idioms of programming languages -- loops, functions, objects, macros, anonymous functions, etc -- are efforts to avoid cut-and-paste, and if you are programming in a weak programming language (dunno, like .bat or perhaps VB), you end up with cut-and-paste to do the job rather than wrestle with the language. At some level, some degree of repeating yourself in code is unavoidable and introducing higher-level languages (closures? functional programming?) to avoid this may be unavailable or perhaps in itself introduce obfuscation if these features are generally not known to your maintenance programmers. So if you are left with some cut and paste, don't sweat it.

    1. Re:Reliable Software through Composite Design by ClosedSource · · Score: 2, Interesting

      There were number of books that covered the same issues as "Reliable Software through Composite Design" and my appreciation of this issue originated from reading them. To certain degree we have a common frame of reference.

      I don't agree, however, that Fowler's works are a logical extention of those principles. The fact that Fowler "allows" reversing refactorings doesn't seem like much of a concession. The goal should be to avoid doing additional work that you have to end up undoing later. Since refactoring by definition doesn't change functionality, "constant refactoring" can descend into constant self-indulgence.

      I also don't agree that loops, functions, objects, etc were created to avoid "cut-and-paste". For example, loops go back at least as far as 1954 when FORTRAN was created. There was no such thing as "cut-and-paste" in those days, so that can't be the reason for creating looping capability. Also saving program space was at least as important a factor in adding language support of functions as were organizational considerations.

    2. Re:Reliable Software through Composite Design by aevans · · Score: 0

      No, loops and functions were created so you didn't have to trace and repunch. It took about 10 minutes of punching card to realize that addresses and jumps (gotos) were gonna be very useful.

  29. ActiveX, Delphi, Type Library Editor by Latent+Heat · · Score: 2, Informative
    The remark about the evil of ActiveX controls is sort of like remarks that since people in occult cults listen to rock-and-roll music then people who listen to rock-and-roll are susceptile to occult cults or belong to them (or some variation thereof).

    ActiveX is a remarkably powerful system for visual component software -- restricted to Windows, yes, but supported by many programming languages ranging from VB through Delphi to Matlab. It is also remarkably crufty so to either develop for it or to use it you end up using some form of "wizards" and automatic code generation. And yes, the use of ActiveX on Web sites, especially malicious Web sites is evil, but such things like Flash and some of the free anti-virus sites are delivered through ActiveX. You could also disable all Internet ActiveX and still be able to use client apps on your computer using ActiveX -- there is hardly a major Windows app that doesn't use ActiveX at some level anyway, so if you are to dismiss ActiveX, there is little you can run under Windows.

    Delphi is a remarkably powerful tool for developing ActiveX controls as well, and I like it better than the VS/VC++ approach because I find it to be more flexible in tinkering with COM interfaces until you are ready to publish the control. Delphi ActiveX development requires some faith in wizard-generated code (actually, GUI development in Delphi is remarkably free of wizards and auto-generated code because the VCL base classes have so much of the functionality in them, but ActiveX in Delphi requires it). You will also have to become friends with the Type Library Editor -- the Delphi way of writing and maintaining the IDL code that is the plumbing of COM and ActiveX. The Type Library Editor is buggy and has its quirks, but I find it much more powerful for inspecting and modifying COM interfaces than any of the MS tools.

    1. Re:ActiveX, Delphi, Type Library Editor by mrlpz · · Score: 1

      No one said they weren't powerful or useful, but your assertion that the Type Library Editor included in Delphi ( and C++ Builder for those who've used it ) has it's own issues, many of which have never been addressed by Borland. For a user of anything remotely related to IDL the Delphi tools are no better than the VC++ tools, it simply boils down to a matter of taste.

      The points you make are always the defense positions taken by those proponents who have in one way or another a vested interest in their proliferation. Most of the time I see these apologetic arguments put forth, they're always those folks who're less than willing to explore better alternatives. I should know, I was once one of them.

  30. Eclipse RCP by HedgeFund · · Score: 1

    You could do a lot worse than to check out SWT / JFace / Eclipse RCP Framework.

    If you haven't heard of these things:
    * SWT is a relatively low-level cross-platform widget toolkit. It is at around the same level as Qt, GTK+, and the GUI bits of MFC.
    * JFace adds a layer of abstraction on top of and is built to work with SWT...helping you effectively split your widgets and the data feeding them in nice ways. It also provides a whole lot of convenience classes for doing common things more easily.
    * Eclipse RCP (Rich Client Platform) ties all the above together in a huge framework for building any sort of GUI application. This is where you will learn the most about design pattern applications to GUI projects. Eclipse itself is built using this framework.

    The learning curve can be a bit steep if just starting, but I haven't come across anything so well put together before. It's full of lots of good ideas.

    Even if you choose not to use it (or can't use for good reasons) you will learn a great deal about how to put together a GUI application and how to apply certain patterns and techniques effectively. A few well known "gurus" have been involved in the design and you can be sure that a lot of effort has been put into the architecture and deciding what works and what doesn't in terms of patterns and techniques.

    This book is a really great way to get into it all:

    http://www.amazon.com/Eclipse-Rich-Client-Platform -Applications/dp/0321334612/sr=1-1/qid=1164595827/ ref=pd_bbs_1/103-2317093-7394243?ie=UTF8&s=books

    And for more info ...

    http://wiki.eclipse.org/index.php/Rich_Client_Plat form

  31. Poster is spot-on by Traf-O-Data-Hater · · Score: 1

    I agree with all those points, including the hurdles in getting resources going such as icons - could be lot easier. Also, talking to legacy stuff via COM interop is really well done. As has been mentioned it takes almost no effort to do it. Building forms and dialogs is real easy and the IDE remarkably stable. I got sick of doing all the plumbing and myriad datatypes for COM in C++ but I can really get some work done in C#!

  32. Checkout Turbo Delphi / C++Builder tools by pkphilip · · Score: 1

    I would highly recommend that you try and use the VCL (Visual Component Library) components which comes with Delphi and C++Builder. C++ Builder or the Delphi Turbo tools are now available free (the professional versions costs money though - approx $340).

    VCL is exceptionally simple but yet very robust and customizable. Search for "Delphi Super Pages" for additional VCL components, sample code, and all sorts of other goodies.

  33. Decouple It by RAMMS+EIN · · Score: 4, Informative

    I didn't see this mentioned in other posts, but I think it's very important:

    Decouple your GUI from the code that does the work.

    I really don't have a lot of experience with GUI programming, but I do know that there are many different toolkits on different platforms, each comes with its own guidelines, and these guidelines are subject to change over time. At some point down the line, you or someone else is going to want to change the GUI, while keeping the functionality. Moreover, you or someone else may want to drive the application from a script, or from the command line (some platforms may even require one or the other for applications that are considered good citizens). In other words, your application _is_ going to have more than one interface - make sure that is easy to accomplish.

    --
    Please correct me if I got my facts wrong.
    1. Re:Decouple It by Anonymous Coward · · Score: 0

      I also follow a similar line of thinking. When I write user applications I tend to use a simple console application for as long as possible. This keeps me focused on the algorithms and less on the continuously changing GUI front end. Once the main code has been created and debugged, I slip the code into a library. Coding the GUI is pretty straight forward after that.

  34. Nesting and Abstraction by RAMMS+EIN · · Score: 3, Informative

    I've built a lot of web pages, and this has made me realize that it's incredibly quick and easy to whip up GUIs with HTML. The experience was much better than with the GUI builders I had used, and certainly beat coding GUIs by hand.

    Of course, HTML is not intended as a language for describing native GUIs, so it has some limitations there. Fortunately, there is a variety of XML formats for describing real GUIs.

    What makes XML so great for describing GUIs is that it's so good at describing nested objects. If you think about it, that's exactly what GUIs are: you've got your windows, with a bunch of widgets in it, one of which is a scrollable area with more widgets in it, etc. This is naturally described by an XML tree that contains all these widgets, with some attributes used for connecting them to the application; e.g. ids to allow the application to reference widgets, and embedded code to let the GUI respond to events (e.g. HTML's onclick).

    Where many XML GUI languages fall short is in that they don't provide methods for building new abstractions. If you have a lot of subtrees that are all very similar (say, a frame, a title, a content window, and a hide and a show button), you'll completely have to code each of them in full. Any programming language worth its salt will provide a way to abstract over this (functions!), but I think the realization that XML GUI descriptions (and HTML documents!) are programs hasn't fully set in yet.

    Next time I'm coding a GUI, I'll be generating the XML from a proper programming language. I've had good results with Lisp before...

    --
    Please correct me if I got my facts wrong.
  35. Debian by RAMMS+EIN · · Score: 1

    ``If only Microsoft had fixed it to allow distributing C# applications with their own stripped-down runtime included, instead of requiring administrative install of the full 20+ MB .NET Framework including ASP.NET and who all knows what crap you don't need, it probably would have replaced C++ for many applications already. Something like perl2exe for C# is what I want. Just bundle the runtime and the JIT and your code up in one nice tidy ready-to-run executable. That would do wonders for the adoption of C#.''

    Maybe they should do like Debian and (1) have a proper package manager that tracks updates and dependencies, and (2) realize that .NET is a runtime with a bunch of libraries, split it up accordingly, and have everything depend on just the pieces it needs. This would (1) make keeping Windows machines up to date a lot easier, and (2) solve the problem you complain about. Of course, they don't have to actually do the packaging themselves (like Debian does), as long as they provide clear and easy steps to enter a package into the system.

    --
    Please correct me if I got my facts wrong.
  36. Re: ...precisely two good GUI designer tools... by Synonymous+Cowherd · · Score: 1

    I have been using JFormDesigner for Java for about a year now. I think it is quite decent.

    I have previously used the Qt designer, up to version 3.3.4, and it was OK. I still found I needed to tweak code and layouts specifically for the target OS. Perhaps that was due to lack of familiarity with the tool.

    I simply expect a GUI designer to relieve some of the tedium of hand coding a layout, especially those with obtuse interfaces, like grid bag. If the designer also can provide a way of hooking UI elements to the code, without generating code that is a pig's ear, then that is a bonus.

    If a GUI designer could generate dialogs and other elements that looked perfect on each platform from a single specification, then that would be the holy grail for me.

  37. Try Presenter-First by nedric · · Score: 1

    There are ways other than just signals/slots and MVC to architect a GUI. Anyone interested in being able to test an app with an interface (not just graphical) should look at Presenter First design. It's a simple design pattern that helps guide you in decoupling your view from your presentation logic and it's data model. Combined with Mock Objects and Dependency Injection, esp. constructor injection, MVP can provide a strong backbone for any GUI application.

    --
    evolution IS god.
  38. ActiveX development alternatives by Latent+Heat · · Score: 1
    I am not sure which defensive position I am taking -- defending ActiveX or defending Delphi.

    As an alternative to ActiveX, I am looking at Java Swing. But it will be a while before I get my stuff rewritten, so I have still have an interest in the Windows API and in ActiveX.

    The original discussion was that Delphi was good for arranging pretty widgets but if you wanted to develop new widgets you had to drill down to C++. My suggestion was that in some regards Delphi may be a better development environment for ActiveX than the MS C++ tools. I am not saying that Delphi makes ActiveX a breeze, but it makes implementing ActiveX controls tolerable.

    The thing is that if you have an underlying operating system, it is helpful to have a language that incorporates the idioms of that operating system into the language itself. C++ is not that language, at least not for Windows, largely because C++ is a platform-independent standard where you can't just stuff features in the language just because they are convenient for Windows, although Microsoft has tried mightily to sneak them in.

    Just as the Java language has built in support for the features of the underlying JRE, the two languages that have Windows support built-in are VB and Delphi. Everything from message maps to BSTR's to Variants to Dispatch interfaces are just plain painful mixes of #defines, classes, templates, and wizards in C++ while they are language features in VB and Delphi. I am not saying the C++ is deficient, but the way Microsoft decided to use C++ to use their OS-specific features is painful. The C-language and the raw Windows API are a little verbose, but you can pretty much figure out message loops and giant case statements to see what is going on, but once Microsoft went to COM/ActiveX and threw C++ into the mix, the result was an OS-specific extension to C++ using legal C++ extension mechanisms but done badly. What MS did with VB and what Borland did with Delphi was to add OS-specific features into those respective languages so all of the cruftiness of COM was hidden away.

    OK, if we are talking ActiveX and the task at hand is to develop ActiveX controls, what tool does one use? There may be a VB way that is every bit as capable of the Delphi way, but I never looked into it. I have implemented ActiveX controls in Delphi and I have dabbled at implementing ActiveX controls in VC++, and there are things to recommend about Delphi. Look, C++ is a great language, and people tell me that C++ is a great GUI programming language (the parent post topic) if you are using Qt, but there is a certain impedance mismatch between the way MS went about using the C++ extension mechanisms to handle their own COM and ActiveX features and low-level data types. You really think MFC is an example of a good C++ class library? ATL for all that matters?

    The Microsoft C++ solution of macros, classes, templates, and wizards is so painful that even Microsoft abandoned it and went with C# and Windows.Forms. Case in point -- C Windows API guru Charles Petzold who stated he could never grasp the MS C++ solutions in the form of MFC and ATL but found himself once again at home with C# Windows.Forms and wrote his next book. C# by the way is OS-specific -- the CLR-specific string type for example is a primitive type in C# rather than something synthesized from classes and templates.

    I am not saying Delphi rocks, Delphi rules, blah, blah. All I am saying is that there are reasons for developing and maintaining ActiveX controls because so much in the Windows world supports it, that Delphi makes ActiveX implementation tolerable, and the Delphi Type Library Editor allows extending as well as trimming COM interfaces during the development phase before the COM object is published and the interface set in stone.