wxWindows vs. MFC 103
EvanED queries: I'm going to devoloping a chess program, and was until a couple days ago planning to do it in MFC. But then I ran across wxWindows. I think it would be cool if it were able to run under Linux. (At the moment, I do not have Linux on any computer but will as soon as I get my own machine.) Do the benefits of supposed cross-platformness outweigh the drawbacks of having to learn a new system and not having all the (incredibly wonderful) automatic code generation features Visual C++ provides for MFC programs? Or would it perhaps be better to write it in MFC since I am reasonably familiar with it then port it to wxWindows?"
Qt (Score:1)
Re:Qt (Score:2)
Re:Qt (Score:2)
Re:Qt (Score:2, Insightful)
The main advantage wxWindows has over Qt is that it has truely native look and feel (LNF). Try running your Qt program under Windows XP and compare it with a wxWindows one -- which one looks really native? Personal preferences aside (i.e. forgetting that I hate XP LNF), wxWindows clearly fullfills the goal of allowing you to create native looking applications better. The same goes for wxGTK port: Qt apps will never use yyour current GTK+ theme, but wxGTK ones will.
Further, why ask "why not just use Qt"? Why not rather ask "why use a proprietary and closed (in the sense that you can't modify it nor participate in its development) library instead of completely free, open and at least in some ways superior one"?
Re:Qt (Score:2)
Re:Qt (Score:1)
Mozilla (Score:1)
time (Score:1)
wxWindows definately (Score:2, Informative)
MFC is not going to be supported by microsoft now because of
I can never recommend qt, because of its wierdness with having a preprocessor of its own. If you could, Objective C would be a nice language to do it in
Develop in Python, using wxWindows (Score:5, Informative)
I can pretty much guarantee that you will be more productive and have your product out the door faster, event if you need to ramp up on both Python and wxWindows.
Lots more information at:
Re:Develop in Python, using wxWindows (Score:1)
Re:Develop in Python, using wxWindows (Score:1)
Mind you, the guys I work with are a pretty impressive bunch
Python is a very pragmatic language. Once you get the "oh - that's how it works" bit about names and binding, it's pretty much plain sailing (a few idioms to learn, but fewer than in most languages).
Cross-platform is worth it. (Score:2)
In any case, I wholeheartedly recommend that you do not use MFC. My argument is that developing software around proprietary APIs is very risky. I've witnessed serious problems arise in long-term projects when API vendors go under or stop supporting their products. The fact that Microsoft is #1, etc., does not reduce the long-term risk, since all companies is mortal (and more than a few people argue that MS' days are numbered). If you want to make sure the long hours you put in now don't go to waste later on, choose your APIs wisely, and, no matter the API, find ways to compartmentalize your program to isolate risks.
But development on wxWindows can die off... (Score:2, Funny)
If you want real portablity, use an ASCII terminal for the display. You'd have a better chance of getting that to work 10-20 years from now than wxWindows, Tk, or MFC.
Absolutely, cross-platform is worth a lot. (Score:3, Interesting)
Absolutely, cross-platform is worth a lot.
If you use MFC, you tie yourself to whatever Microsoft decides about its money-making schemes.
wxWindows is here to stay. The GUI is native on any platform. Yes, there may be slow-downs in development, but the need will not go away.
Within two years, after governments evaluate the security risk of using U.S. software, they will pass laws that government workers must use Linux or BSD. That will cause the movement away from Windows to accelerate.
There will come a time when Linux is the dominant OS. It would be unfortunate if you could not run your program on Linux.
Other governments (Score:2)
It is OTHER governments to which this comment applies. If you are an official of the French government, what must you think about the virtual certainty that the U.S. government is spying on the French government using unpatched security holes in Microsoft Internet Explorer [pivx.com] or, possibly, back doors put into Windows on order of the U.S. government.
Would the U.S. government use any means to spy on other countries? Well, the U.S. has killed more than 3,000,000 people in the last 33 years partly by bombing 14 countries. Does anyone believe that people who think killing is acceptable suddenly become moral when they think about spying using computers?
For documentation of U.S. government activities from some of the world's most respected news agencies, see What Should be the Response to Violence? [hevanet.com]
FOX (Score:1)
Like wxWindows it is cross platform and open. Unlike wxWindows the GUI is part of the library and not a wrapper around the OS user interface. This may be an advantage or a disadvantage. Anyway, FOX is another mature alternative and I like it.
Write it in MFC, then port to wxWindows (Score:3, Informative)
If, on the other hand, you are confident with MFC, then just skip it and write straight to wxWindows. Basically, if you write in MFC with VC++, you can use all the class wizard stuff to set up message maps and create stub functions, etc, and it's just faster to get it up and running if you don't know how to do this yourself. Then, you can do easy search and replace to convert to wxWindows. For example, all of your Invalidates become "Refresh," all of your CDCs become wxDC, CString becomes wxString, etc etc. You will have to make a couple of small changes here and there, but search and replace will be 90% of the work.
If you know how to set up the message maps and whatnot yourself, then just take one of the example programs (it comes with loads of examples) and start modifying to taste. There is really good documentation on the website, although I found the search capabilities cumbersome.
pragmatic answers (Score:5, Insightful)
This is a question you can only answer yourself. It's always more work to take more than one platform into consideration, and wxWindows is no panacea in this regard. Only bother with cross platform coding if you really indend for the code to be run across platforms. That said, wxWindows is nicer to use than MFC, although for a Windows-based chess program, I doubt you'll be able to avoid MFC entirely. MFC just does more than wxWindows.
This autogenerated code is so awful, I used to create it just to frighten people: "Look how many lines of code it takes for this dialog box!! Pay me more!!" MFC is the single largest reason I've given up on Windows programming permanently (Winsock is a close second). Since this is clearly a learning experience for you (right?), then go ahead, play with MFC. Nothing teaches like pain. But be warned, MFC plus Visual C++ can make you hate real C++ by warping your mind. __int32 indeed.
This is the path of greatest work and quite likely greatest learning. If you'd like to pursue the path of least pain to produce a truly cross-platform GUI app, I suggest, from experience, TrollTech's QT [trolltech.com].Re:pragmatic answers (Score:3, Interesting)
The second sentence is trivially true, but the first is probably false. There are any number of ways to approach the problem, but one first-cut possibility is an 8x8 grid of wxBitmapButtons. You can set all the bitmap states so it doesn't 'look' like a button (raised, etc), and then you need one bitmap per piece per color (plus probably a selection), which isn't that big a deal.
That's probably what I'd personally go with, just because the events are quite natuarally set up, and the bitmap generation isn't that big a deal. You could of course paint directly into the dialog (wxPaintDC), just like you'd end up doing in MFC.
Another interesting thing that you can do with wxWindows that is much harder to do with MFC is the possibility of using the various wrappers around it. wxPython is quite mature, and while I've never used it, I'd bet wxPerl is similarly mature. In this case, C++ probably is your best bet, because chess is one of those things that you need speed, thus you need C(++), and it probably isn't worthwhile to write the GUI in Python or Perl and then shell out to the chess program. But learning wxWindows leaves that as a future possibility.
And believe me, a nice windowing toolkit plus a nice language (Perl or Python depending on temprement... I recommend giving both a good shake before deciding) is a really nice tool to have around. I've knocked together programs in Python/Tk and Python/wxWindows in a couple hours that I'd never even think about doing in MFC/C++ or VB... that goes for (Python/Perl) * (wxWindows/Tk/QT/GTK bindings), not just the combos I've described here.
Re:pragmatic answers (Score:1)
wxWindows is no silver bullet, but it is very functional. All of my experience has been, "it just works." The main extra work for me in getting code to be cross platform when working with wxWindows is the different build environments. If you're a VC++ developer, then the whole Makefile thing can be confusing for a while.
You go on to rip on the autogenerated code, which suggests to me that you were having some trouble grasping the MFC framework. It takes a little getting used to if you've never done event based programming before, but apparently this guy has done MFC before, so this shouldn't be a hurdle. The stuff that AppWizard and ClassWizard generate are there for a reason, and very rarely do you have mess with any of it. On the occasions that you do have this need, then yes, you need to read the comments, and should probably get a book. MFC has its shortcomings, sure, but usually people struggle more because they don't understand the windows API programming going on in the background. If you want to do fancy stuff, then you have to know what events to handle, what the creation sequences are, and occasionally there are subtle interactions between MFC and the API. But this guy just wants to write YACP (Yet Another Chess Program), so I doubt he's going to do anything fancy. So VC++ will save him a bunch of time and not cause much in the way of headaches.
You sum up by suggesting that porting from MFC to wxWindows would be the most work and that QT would be the "least pain." I must humbly disagree. If he already knows MFC, then porting to wxWindows is quite trivial. I have not used QT, so it may also be easy, but QT has licensing issues if you want to distribute a commercial application, whereas wxWindows does not. I realize that he just wants to do YACP, not likely a commercial endeavor, but wxWindows seems like the better skill investment to me. And since you greatly misrepresent the case for wxWindows at least, so I'm dubious of your claim that QT is better.
Re:pragmatic answers (Score:2, Insightful)
I will admit it's been a while since I've used MFC. However, my experience predates Windows by a fair amount, so my appraisal of MFC isn't based so much on an ignorance of the windows API but on knowledge of many GUI api's in general. Having used Iris, OpenStep and others before Win32, I can look at the MFC code generated by the wizards (and by myself) and conclude it's garbage. I've created comparable apps, in other frameworks, and MFC has for me always been the most painful to use. Borland OWL comes in a close second. Motif gets third.
The subtleties you have worked hard to understand and work within don't exist in other, more perspicuously designed GUI frameworks. I would rather have something behave the right way the first time than in some peculiar way to be vaguely deduced/read about. I understand your affinity for MFC: once you've gone through the pain and considerable expense in time of learning it, it's hard to believe there's something else out there that's much simpler to use and equally, if not more, powerful.
Finally, porting fromanything to anything is by definition more work that simply writing that one thing once. If you mean for your code to run on multiple platforms, start from scratch coding using tools intended to work on multiple platforms. If you want to write windows apps, use .NET, cuz' MFC is dead don't ya' know.
This is a valid point. I made the assumption that hardly anyone with this cursory a knowledge in GUI programming on windows would be creating yet another chess program for commercial purposes.
Re:pragmatic answers (Score:1)
The subtleties you have worked hard to understand and work within don't exist in other, more perspicuously designed GUI frameworks.
Mostly, the subtleties I have worked hard to learn are subtleties of GUI programming in a WIMP environment. There's pretty much no way around knowing what events are generated for various things and what data comes along for the ride. Whatever your environment is, you will occasionally need to know what the construction order is of your windows and other frustrating items. And I won't believe for a minute that there exists a toolkit worth using without subtleties.
I would rather have something behave the right way the first time than in some peculiar way to be vaguely deduced/read about.
I find that newbs tend to get confused/frustrated because it's so easy to get started with appwizard that they get misled into thinking that you don't have to know anything to make it work. A lot of them, being fresh out of school, have never done event driven programming, and are just overwhelmed by the whole model ("where's the f*#@ing main() function?!?"). These people should do some windows programming straight to the API before trying MFC or some other toolkit, because they will find any machinery peculiar and has to be read about.
I understand your affinity for MFC: once you've gone through the pain and considerable expense in time of learning it, it's hard to believe there's something else out there that's much simpler to use and equally, if not more, powerful.
Let me clarify that I do not like MFC. It has the same problem as pretty much every toolkit that I've worked with: it bundles a GUI toolkit with an application framework with a bunch of utility classes. The GUI toolkit is pretty reasonable given the windows API it has to work with. The app framwork kinda sucks, and I don't like the utility classes much. Now, while people like boost.org [boost.org] are working on utility classes that will rock, they're not ready yet, and nobody that I know of really cares much about app frameworks.
Finally, porting fromanything to anything is by definition more work that simply writing that one thing once.
On the surface, this seems like a truism. However, lets say that you have a tool that will save 10% of your development time if you use A instead of B, and that you already know A but not B, and you can port from A to B without really having to know a lot about B, and so you can port in about 1% of the development time. In other words, I think that given this guy's situation, it is very reasonable to expect that appwizard and classwizard will save him more time than he spends porting to wxWindows.
This is a valid point. I made the assumption that hardly anyone with this cursory a knowledge in GUI programming on windows would be creating yet another chess program for commercial purposes.
Consider the possibility that he's using this as a learning experience for a future commercial project. Not necessarily a deciding factor, but you do want to keep in mind how your skillsets will help you in the future
Re:pragmatic answers (Score:2)
Cocoa (Score:1)
You might want to try to port it to GNUStep.
Here is the link to it http://developer.apple.com/darwin/projects/misc/
Re:Cocoa (Score:2)
Uhhh... no. See the SSDF Rating List [telia.com].
Have you thought about CLX? (Score:2, Informative)
Re:Have you thought about CLX? (Score:1)
Re:Have you thought about CLX? (Score:2)
> supposed to support coding in C++.
Yes, Kylix 3, which is expected sometime this summer supposedly. And the CLX is indeed based on Qt, so on Windows you'd essentially end up with a run-time DLL a la MFC42.DLL for Qt. Not a major thing really, but as an alternative you could stick to plain VCL on Windows and try to isolate (and keep to a minimum) any necessary win32 code such that you could rewrite that code in Kylix using available Linux libraries. VCL code tends to port over to CLX code pretty easily (often verbatim if I remember correctly, at least for many GUI elements), so on Windows you can still have Qt-free code and still have a pretty portable project. This tends to be harder for database apps, since I believe the CLX introduces a new db abstraction model, but for GUI and networking code (use Indy) it's pretty straight forward.
Porting to/from MFC (Score:1)
wxWindows is a great product. One of it's best features, IMHO, are all the language bindings. It's very easy to prototype your app in wxPython, then convert to a C/C++ app later.
Plus, if you ever want to run your app on anything other than Windows, MFC is defintely not the right choice.
Re:Porting to/from MFC (Score:1)
do it in .Net with GTK# (Score:3, Interesting)
Why are you writing a Chess program? (Score:1)
Clarifications on VC++, Qt (Score:2)
Now, on to Qt -- it is a C++ API, it is clean, very portable and very easy to use. It used to cost money for a development license for anything on windows, but it no longer does. See the Windows non-commercial edition [trolltech.com]. I work on a project which uses Qt for the GUI, and that source builds unmodified on Linux, Win32, SunOS, AIX, IRIX, and (I think) Mac OS X.
In addition, it also has a nice graphical designer [trolltech.com] with some nice code generation features, and excellent documentation [trolltech.com].
Their "pre-processor" is in fact what lets the code REMAIN standard C++ -- it does NOT require language extensions to operate, unlike MS VC++ and Borland C++ Builder.
They've been around for something like 10 years, too. This is a mature product. And no, I don't work for them or own stock (if it exists) -- just a pleased user.
Re:Clarifications on VC++, Qt (Score:2)
VC++ and wxWindows both require lots of macros, however.
MFC and language extensions (Score:2)
No, but MFC does. Try compiling any MFC app with the standard compliance compiler options set in VC++ and see the fireworks. This is one of the major reasons that VC++ still has bizarre non-standard behaviour in places they should long since have fixed; it would break millions of lines of existing MFC-based code if they changed it.
Re:MFC and language extensions (Score:1)
Thank you, yes, I misspoke. I meant to say MFC.
Slightly tangential, but the biggest offender IMO of MS non-standards compliance is their use of the old for-scoping rules that have been "wrong" since at least the '96 C++ draft standard IIRC. You have two options to fix it -- force full ANSI compliance which will prevent almost any windows app from compiling, or use (get this -- this is their idea, not mine): This is true for all Visual Studio compilers, including the latest and greatest
Re:MFC and language extensions (Score:2)
Full ANSI compliance will cause almost any Microsoft-based Windows app not to compile. Almost everyone else manages quite happily, though Borland's C++ Builder does make extensive use of a few proprietary extensions as well. :-(
The for-loop hack has been around for quite a while, of course (sorry, just realised how that reads...) but while that problem is the biggest one, it's not the only offender (or at least, it never used to be).
Re:MFC and language extensions (Score:3, Informative)
This is a very dangerous definition, as it invites a following else to be misunderstood. For example, it breaks the following:
if(foo) for(int i=0;i<42;++i){...}
else cout<<"Oops!\n";
A better fix is therefore
#define for if(0);else for
(Or use false instead of 0 if you prefer, but there are probably still compilers out there that don't understand bools.)
Re:Clarifications on VC++, Qt (Score:3, Insightful)
Learning MFC is learning Microsoft Macro(TM). It's the most shallow and unambitious class framework I've ever seen, almost to the point of making you wonder why they even bothered with C++ (the templates I guess). Doing anything remotely interesting with the GUI requires falling back to messages and win32 calls. If you look at serious class frameworks (Borland's original OWL, then VCL, Java,
Qt does have major "costs" (Score:2)
While it is true that you can get a version of Qt to play with without having to shell out any $$$, there is a catch. If you at any point in time touch your project with any one of their 'no-cost' versions (Non-commercial windows [trolltech.com], Free Edition [trolltech.com], Academic [trolltech.com], etc. ) you can never at any later time [trolltech.com] buy a commercial Qt license and use your project commercially. As Trolltech says:
So... that first sentence especially might be something to consider. However, if you want to pay for developer seats up front (it's a per-developer licensing scheme, IIRC), there's not a problem. Or if you only ever want to do Open Source work while your're not getting paid to develop. Otherwise, check with a lawyer.
Visual Studio... (Score:3, Interesting)
Starting from scratch, I'd be more inclined to go with wxWindows, although I personally would get up and running much faster with MFC since I have used it for years.
MFC makes some things easier, but many features carry an obscene amount of bloat, and are often less hassle to write from scratch than deal with Microsoft's way of doing things (I certainly found that to be the case for doing ftp... using MFC required writing more code than doing it from scratch!)
Re:Visual Studio... (Score:2)
> other than an annoying waste of time, you've either never used it, or are only a
> cookbook programmer
Yeah, automatic code generation is great if you know exactly what you want from the beginning. It'll spit out megabytes of code for you, which even compiles. But start fleshing out this code a bit, and then change your mind about GUI layout or program structure, and you're in one-way-wizard hell. Basically, duplicating the type of code the wizards generate by hand is a massive amount of very tedious work. Rather than delegating (and hiding) tedious setup code to base classes that your code inherits from, the MFC instead relies on wizards to take the tedium away. According to Microsoft, Inheritance + Polymorphism = Wizards (essentially).
Re:Visual Studio... (Score:2)
Automatic code generation just replaces one set of tedium with another... the difference being is once you learn to do it the proper way, it's a lot easier and faster, but if you rely on Microsoft's crappy pseudo-CASE tool, nothing ever gets easier or faster... and in fact, when you want to modify the generated code, you just opened up a big can of trouble.
Re:Visual Studio... (Score:2)
Java (Score:2)
What will you lose?
Re:Java (Score:1)
Re:Java (Score:1)
Re:Java (Score:1)
Re:Java (Score:1)
Re:Java (Score:1)
Re:Java (Score:2)
What will you lose?
---snip
the chess match, unless there are no time limits
Re:Java (Score:1)
- Any suggestions for a way to build a decent GUI with java but without awt/swing?
PS. If you're thinking of responding to this with one of those "use c - java is crap" responses, dont bother. Just accept that Java is big in some sectors - especially the finance industry. Continuous derading of Java actually hurts the free os'es (as in beer/speech) since this - the support for Java - many times is the main requirement for companies in the finance industry. I've seen FreeBSD/OpenBSD/NetBSD fall on this hurdle so many times - please dont kill Linux this way. Just accept that usefulness of Java varies depending on the specific needs for that user.
Re:Java (Score:2)
Java-GTK [informatik.uos.de]
QTJava [sourceforge.net]
Re:Java (Score:1)
For somethings java remains the only answer.
Porting from MFC (Score:2)
Be very wary of starting any application using MFC extensively if you want to port. Because MFC insists on being an "application framework" rather than simply a GUI library, it forces concepts and designs upon you that simply do not translate well to the more usual idioms employed by almost every other GUI library. You could pick most of the others and later move/port to a different one with relative ease, but not to/from any extensive use of MFC.
Cross Platform GUI - Tk (Score:1)
Although our requirement was that we only need to get it working on Linux/KDE we were actually running this program on Solaris, Linux and Windows. We did not have to do any additional work (Except for the path seperator) because Python + TkInter ran on all these platforms. It is nice to see that.
"Write once - Run Anywhere*"
*Anywhere A, B, C and D work
On the other hand if I had to distribute this same program to Windows users, I would have to ask them to download and install Python. You
want to download something named after a snake?
I do have to ask why one needs a new Chess program when there are multitudes already out there. I do not know of any cross platform ones. So it might be a good thing to make that a requirement - just to differentiate.
Re:Cross Platform GUI - Tk (Score:1)
Not true. The py2exe tool lets you make a bundle of files that include the Python runtime and any extension modules required by your app, and it works very well with wxPython. Your users never need know that they are using Python.
From what I can tell, I'd say go with wxWindows (Score:3, Informative)
I've used MFC and wxWindows quite alot. MFC is quite primitive by comparison to wxWindows -- the MFC design is old, and it shows. For example, try making a resizeable dialog in MFC! If you use MFC, you'll be stuck with Windows. Porting the app to wxWindows (or any other GUI framework) will be non-trivial -- you'll be writing from scratch, using your MFC app as a model. Not that that would be all bad -- it's one way to iterate toward a good design. But really, there are faster ways to get to a good design. So, MFC is basically bad, mostly because it ties to you Windows, and secondly because the GUI framework is excessively primitive.
wxWindows is free. Not GPL -- just plain old free, almost anyway (you'll have to read the fine print -- I think you have to give attribution, etc -- but there is no restriction on selling your creation). That trumps Qt, which is a much GUI framework (on technical merits alone, Qt is hands-down the best C++ framework that I've seen). The problem with Qt is that you must decide up-front whether you're going to create a forever-free (GPL-style) app, or whether you might want to charge for it some day. If you start creating it as a free app, it must forever remain so. What a horrible license. So, for most small-time operators with potential commercial aspirations, that puts Qt firmly out of reach (their developer's license is, or was, around $1000).
If you go with wxWindows, then by all means you _must_ get wxDesigner - a proprietary GUI builder. I think it's $50-$100 or so (it was $50 when I bought it). What a great program! Once you become fluent with the layout paradigm (which I found to be quite natural), you'll be very productive with it -- much more productive than with MFC.
Well, I could go on and on.
A couple of quick thoughts: As someone else pointed out -- you should probably check out wxPython, which makes the wxWindows API available to Python. You'd probably be alot more productive that way -- development with C++ can be very slow (especially on Linux!). If you go the wxPython route, you'll be able to reuse all your GUI design -- wxDesigner can produce both C++ and Python code.
In short, if you want to have fun, and explore the world of GUI programming, stay away from MFC. It has little to offer. If you want the best, and you're ready to GPL your software, go with Qt, which is the best GUI framework hands-down. If you want to keep your options open, especially in terms of which platforms you want to deliver on, then go with wxWindows (and look into wxPython).
The paralyzing FEAR of wrong choices (Score:2, Insightful)
Programmers are easily seduced into creating code to cover all the possibilities of the world. It's more comfortable because;
a) you avoid doing a lot of the design choices that are involved in actually finishing and shipping applications, and;
b) you feel like you're doing "good work" and reducing the risks by covering all the possible cases because you don't really know what the design needs
You're doing good work all the time, you can't possibly fail, right? Wrong! Many projects die well before finishing the library, the engine or the platform that was supposed to be the carrying structure of the application.
Letting technology desires drive development you can continue your good work for the rest of your natural life without ever having to face the fear of actually completing a project.
In the real world, porting software is actually often left for the interns and/or outsourced to other companies. Porting solid code after it's done is not the problem that kills projects. Most projects never live long enough.
Here is a radical idea: design and develop the application first, worry about porting it later. Write solid code for any platform of your choice, it will only take you a fraction of the time to re-do your UI for other platforms you plan to target. If you want to finish, force yourself to only write code that takes the application forward by concrete, measurable steps.
Work with a product designer who knows what they need to accomplish and how to get there.
Conquer your fear of making choices and finishing applications, only shipped products contribute to your track record of greatness.
Re:The paralyzing FEAR of wrong choices (Score:1)
So, think alot about your development platform, and think strategically.
zerg (Score:3, Interesting)
If you're used to MFC, then you should check out
If you're going to use wxWindows, keep in mind that it works very well with Python, so you may want to go that route rather than play the "VC++ does it this way and GCC does it this way and everyone's telling me to rtfm and I hate my life" game.
There are plenty of other people here who are qualified to tell you about tk or qt or mozilla or other cross platform toolkits.
For God's sake, don't do MFC. Not when there are SO many other options and each one brings more benefits to the table. Nothing you could have done, including raping prematurely born babies, could possibly deserve having to write an app in MFC. The world has come so far in the last 10+ years... Join us!
use ATL/WTL (Score:2)
BTW- my 2 cents on the whole QT/wxWindows thing is don't bother unless you really need cross-platform. Knowing the Win32 API, which is very important when using MFC or WTL, is invaluable being that 95% of the machines on this planet run an operating system that uses Win32.
Delphi and Kylix (Score:2)
Later this summer, Kylix 3 will support cross-platform C++ development via C++ Builder on Windows. But even learning Object Pascal is not that daunting--I've seen many C++ programmers become proficient in a matter of weeks.
Software Development for the World (Score:5, Insightful)
Why limit yourself to two platforms? Write the back-end of your chess program so that it communicates with a front-end client by passing certain messages (perhaps in XML format). You might even make the message specifications public so that others could write clients for your chess engine.
The back-end only needs to concern itself with a virtualized game, not worrying about the details of how to go about putting a picture on the screen or interacting with the user.
This also allows the engine to apply 99.99% of its compute cycles toward planning its next move. It won't waste any time on mouse movement or other windowing events. Only when it receives a message will it be interrupted from "thinking."
By separating the core part from the presentation part, it allows you to use your chess engine with multiple front-ends. You might write one front end for Windows, one for Linux, one for Mac, and another with a web interface. The front end only has to know how to interact with the user and send and receive messages to the chess engine.
You could even expand the engine to handle multiple games at once. That extra feature should be easy to implement if the back-end and front-end are separated. It just means keeping track of more than one game and communicating with more than one client. You could be playing against it on your Windows box while someone else is playing over the web. Or perhaps you could set it up so that another human could play instead of the computer.
If you write your back-end using reasonable standards, then you should be able to easily port your chess engine to another system since you don't have to worry about different windowing systems.
Just a thought
Re:Software Development for the World (Score:1)
My advice, write the back end in a more portable langauge then c/c++ or use standard (stable) librarys that work and enought platforms. Write the back-end in Scheme, C#, or even (heaven forbid) Java. Then the backend will run on any system and the only code that can really reliably be cross platform is.
In my opinion, the UI of a program ends up better if the details are worked out for each specific platform. Lets face it users of different systems expect different behavior, wx cannot encode that, so you end up with junk on both platforms.
Re:Software Development for the World (Score:3, Informative)
There's already a very good solution for doing this: XWT [xwt.org].
XWT allows you to write the interface in XML and JavaScript, and the XWT viewer then downloads and displays that interface. When computation needs to be done, the XWT interface makes an XML-RPC call to a server.
In fact, there's even a demo chess program on the XWT site, now that I think about it. :)
--Bruce
Deja vu (Score:1)
Cross-platform from a UI standpoint (Score:1)
Consider that when you write a GUI any given platform, you want it to "feel" like it belongs there. Every OS has its own defining characteristics and expected behaviors, and those are an important aspect from the user's standpoint and greatly help the overall consistency of the user's desktop.
For example in your cross-platform GUI, do you use standard Windows key bindings? Mac key bindings? Emacs key bindings? It doesn't matter what you choose, it will be foreign to some percentage of users because it doesn't match their expectations (the OS defaults). The same thing applies to a number of other behaviors (like menu organization, right-mouse-button actions, etc.).
So even if your cross-platform GUI toolkit renders using the native widgets of the platform, it's still not going to "feel" the same as a UI designed specifically for that platform. You may be excited because your app works the same on all platforms, but users won't be excited when it doesn't work quite right on *their* platform.
Whatever you use, don't use MFC (Score:1)
I started using two pieces of technology, Delphi and Qt, and I have never looked back. At work I use Visual C++ to program DLL's (using STL and no MFC classes at all) and I use Delphi to front end, as well as write the back end stuff too! If I had my choice I would ditch Visual C++ altogether, I think it gives C++ a bad name. I wish most companies would not buy Microsoft Visual C++.
I have never used wxWindows, but I can assume that it is better than MFC. As for cross platform needs MFC still is the worst choice. At one of my previous jobs they had a person that programmed a project for both Windows and Mac OS. There is MFC for the Mac platform. However, this programmer was frustrated by the details because what worked on MFC for Windows worked differently (or not at all) for MFC on Mac OS.
For cross platform I would say check out Qt [trolltech.com] and check out Delphi / C++ Builder [borland.com]. Qt was one of the best C++ libraries I have ever used and I wish I could use it on Windows at work. Delphi kicks ass in all aspects. IMHO Delphi is the only technology I know that can truly claim the title of being a RAD tool. Kylix is Delphi for Linux. C++ Builder should be ported to Linux by Borland soon enough.
wxWindows Fails at Cross Platform (Score:1)
Bottomline, MFC can work in Windows without bugs. Use something other the wx if you want stable cross platform support.
FLTK (Score:2)
Re:FLTK (Score:2)
BTW Am I correct in assuming that the upcoming public release of Nuke is going to be FLTK-based?
FLTK is best for you (Score:1)
And
FLTK website [fltk.org]
Chose Qt over wxWindows during my internship (Score:1)
The reason why FOX was not chosen was due to its lack of Unicode support.
Gtk+ would have been very nice, if it wasn't for the fact that the Windows port is quite neglected and only seems to be maintained sporadically, apparently solely for the purpose of porting Gimp to win32.
At first, wxWindows actually looked better than Qt, because it didn't need a preprocessor, didn't require license fees for commercial development, and provided a native look&feel on each supported OS. Furthermore, the project was about 10 years old, and therefore we expected the sourcecode to be quite mature. Finally, the vast selection of bindings for numerous programming and scripting languages was a major plus.
If I remember correctly, another really neat feature of wxWindows was the apparent possibility of (cross?)compiling wxWindows-based win32 binaries on Linux (and vice versa?). Someone here please correct me if that's not the case.
Unfortunately, as soon as we started playing with wxWindows, we noticed some flaws: first of all, the documentation currently available for wxWindows is limited and incomplete.
Second, part of the API turned out to be OS-dependent, and no warnings or errors whatsoever were issued when compiling code, which contained win32-only wxWindows functions. Under Linux, binaries would just generate a run-time segmentation fault. When the win32-specific functionality was removed and the code recompiled, the remaining product would run without problems. This was a major disappointment for us, since we were definately expecting more on this field from a project that was over 10 years old!
This serious lack of actual platform-independence, coupled with the fact that the documentation didn't specifically document whether if a certain function was available on every platform or not, would have made cross-platform development with wxWindows really troublesome. Therefore, we ultimately decided to go for Qt instead.
Let's face it: when it comes to a clear API, platform independence/portability (between X11, win32, and now also the Mac), stability, but especially documentation, Qt is currently unmatched. Given the quality of Qt, we decided that the licensing fees (which really aren't that high compared to some other GUI development products) would definately be worth it, especially considering the company support we would be receiving, as well as community support.
Another aspect which made Qt more attractive is of course the quality of the available development tools, specifically the excellent Qt Designer.
So to sum it all up: wxWindows is a promising toolkit, but still needs serious work in the following areas:
*) complete, accurate and up-to-date documentation (complete documentation of the entire API, including any platform limitations per function)
*) complete implementation of the entire API across all supported platforms (of course, platform-specific extentions should be allowed, but a definition must first be made of a so-called largest common denominator API for all platforms)
*) high quality development tools. I know many of you prefer not to use a GUI builder, but many other developers actually need it, or at least find it very convenient.
During my internship, I found mainly two GUI design tools for wxWindows, one free and one commercial/shareware, but none of them were even close in quality and ease of use to Qt Designer.
Even better would be a fully-featured develompent suite, integrating an editor, debugger and GUI builder in one. All (L)GPL Of course.
Best tools for the job at hand (Score:1)
One of the worst things you can do is to waste weeks on cross-platform compatiblity when your project doesn't require cross-platform compatability. There are too many programmers who do this. You wind up with GREAT code that works on several platforms, but the company lays off half the staff due to the loss from delays.
When I want to write a small simple program, I use MFC every time. Why? Because I need it done yesterday and I need it to work.
Down with MFC (Score:1)
You won't regret it.
Chris