What is the best approach to both modularity and platform independence? [closed] - compiled

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 months ago.
Improve this question
I hope this question does not come off as broad as it may seem at first. I am designing a software application that I would like to be both cross-platform and modular. I am still in the planning phase and can pick practically any language and toolset.
This makes things harder, not easier, because there are seemingly so many ways of accomplishing both of the goals (modularity, platform agnosticism).
My basic premise is that security, data storage, interaction with the operating system, and configuration should all be handled by a "container" application - but most of the other functionality will be supplied through plug-in modules. If I had to describe it at a high level (without completely giving away my idea), it would be a single application that can do many different jobs, all dedicated to the same goal (there are lots of disparate things to do, but all the data has to interact and be highly available).
I find myself wrestling with not so much how to do it (I can think of lots of ways), but which method is best.
For example, I know that Eclipse practically embodies what I am describing, but I find Java applications in general (and Eclipse is no exception) to be too large and slow for what I need. Ditto desktop apps written Python and Ruby (which are excellent languages!)
I don't mind recompiling the code base for different platforms as native exectables. Yet, C and C++ have their own set of issues.
As a C# developer, I have a preference for managed code, but I am not at all sold on Mono, yet (I could be convinced).
Does anyone have any ideas/experiences/ specific favorite frameworks to share?

Just to cite an example: for .NET apps there are the CAB (Composite Application Block) and the Composite Application Guidance for WPF. Both are mainly implementations of a set of several design patterns focused on modularity and loose coupling between components similar to a plug-in architecture: you have an IOC framework, MVC base classes, a loosely coupled event broker, dynamic loading of modules and other stuff.
So I suppose that kind of pattern infrastructure is what you are trying to find, just not specifically for .NET. But if you see the CAB as a set of pattern implementations, you can see that almost every language and platform has some form of already built-in or third party frameworks for individual patterns.
So my take would be:
Study (if you are not familiar with) some of those design patterns. You could take as an example the CAB framework for WPF documentation: Patterns in the Composite Application Library
Design your architecture thinking on which of those patterns you think would be useful for what you want to achieve first without thinking in specific pattern implementations or products.
Once you have your 'architectural requirements' defined more specifically, look for individual frameworks that help accomplish each one of those patterns/features for the language you decide to use and put together your own application framework based on them.
I agree that the hard part is to make all this platform independent. I really cannot think on any other solution to choose a mature platform independent language like Java.

Are you planning a desktop or web application?
Everyone around here seems to think that Mono is great, but I still do not think it is ready for industry use, I would equate mono to where wine is, great idea; when it works it works well, and when it doesn't...well your out of luck. mod_mono for Apache is extremely glitchy and is hard to get running correctly.
If your aiming for the desktop, nothing beats the eclipse RCP (Rich Client Platform) framework: http://wiki.eclipse.org/index.php/Rich_Client_Platform.
You can build window, linux, mac all under the same code and all UI components are native to the OS. And RCP wins in modularity hands down, it has a plug-in architecture that is unrivaled (from what I have seen)
I have worked with RCP for 1.5 years now and I dunno what else could replace it, it is #1 in it's niche.
If your totally opposed to java I would look into wxWidgets with either python or C++

If you want platform independence, then you'll have to trade off between performance and development effort. C++ may be faster than Java (this is debatable FWIW) but you'll get platform independence a lot more easily with Java. Python and Ruby are in the same boat.
I doubt that .NET would be much faster than Java (they're both VM languages after all), but the big problem with .NET is platform independence. Mono has a noble goal and surprisingly good results so far but it will always be playing catch-up with Microsoft on Windows. You might be able to accept its limitations but it's still not the same as having identical multiplatform environments that Java, Python, and Ruby have. Also: the .NET development and support tools are heavily skewed towards Windows, and probably always will be.
IMO, your best bet is to target Java... or, at the very least, the JVM. If you don't like the Java language (and as a C# dev I'm guessing that's not the case) then you at least have options like Jython, JRuby, and Scala. With the JVM, you get very good platform independence, good performance, and access to a huge number of libraries and support tools. There's almost always a Java library, port or implementation that will do what you need it to do. I don't think any other platform out there has the same number of options; there's real value in that flexibility.
As for modularity: that's more about how you build the software than what platform you use. I don't know much about plugin architectures like you describe but I'm guessing that it will be possible in pretty much any modern platform you pick.

If you plan on doing python development, you can always use pyrex to optimize some of the slower parts.

With my limited Mono experience I can say I'm quite sold on it. The fact that there is active development and a lot of ongoing effort to bring it up to spec with the latest .Net technologies is encouraging. It is incredibly useful to be able to use existing .Net skills on multiple platforms. I had similar issues with performance when attempting to accomplish some basic tasks in Python + PyGTK -- maybe they can be made to perform in the right hands but it is nice to not have to worry about performance 90% of the time.

For desktop applications, writing it in an interpreted language, and using a cross-platform UI toolkit like wxWidgets will get you a long way towards platform independence (you just have to be careful not to use any other modules that aren't cross-platform, use things like Python's os.path module, in place of doing things like config_path = "/home/$USER")
That said, to make a good cross-platform application, you will have to do some things differently on each platform..
For example, OS X is probably the most different - preferences are usually stored in ~/Library/Prefernces/ as .plists, UI's are generally based around floating windows, with a single menu-bar docked at the top-of-screen.
I suppose this is where the modularity comes into play.. With the preferences example above, you could have a class UserConfig, of which you have OS-specific versions of. The Windows one stores config data in the appropriate Application Data folder, or the registry. The Mac OS one uses .plist files on ~/Library/Preferences/, and the unix'y one uses ~/.dotfiles.

Related

Info on CrossPlatform

I have looked at some of the info on cross platform design. I can't find the answer to one question I have however.
What I would like to do is design my UI's in Delphi (Windows) and X-Code (Mac) with the underlying guts of the program being OS agnostic C++ code. Is this possible to achieve? I see lots of talk about Cross Platform Compilers, Frameworks and GUI tools but I really want to keep the interfaces 100% native.
Please forgive me if this an absurd question but I am relatively new to the world of programming and learning along the way. My company has an extensive catalog of Delphi applications for windows developed over the past 15 years and Delphi is where I have spent most of the last year.
If you are comfortable working with Object Pascal take a look to the FreePascal compiler and Lazarus which is a free cross-platform IDE (available for Windows, Linux, Mac OS X).
You should have a look at wxWidgets http://www.wxwidgets.org/ for programming 100%-native.
From my point of view I can't see the benefit of using two different and specific gui designers for two (or more) target platforms. It should be easy to share the code if the platform specific parts are clearly separated in your architecture. wxWidgets gives you the ability to use the same gui definition in both platforms without loosing the native character.
Personally, I wouldn't use C++ for UI design anymore. But why are you using two IDE's? I suggest to use a more abstract language (like Java with Netbeans/Eclipse or even better C#/.Net with VS/Blend) for this UI/event/interaction stuff keeping only some specific parts in an native optimized binary code.
.Net/Mono can use differnt toolkits for the ui style. Today, being "native" within the context of UX and look and feel does mean to follow system specific guidelines, I think.
This could be reached by views and adpaters (see google for some design pattern).
Look and feel is just a point of styling an app and it could be a native looking style, too. In the WPF-world handles are used only for the host window (and some legacy compatibility reasons using windows forms) but the user won't feel the differenc if you are styling your app like the former win-api-ones.
Qt has also an platform independent approach for the C++-world but is not really native. Qt draws its own controls with a native look and feel (if needed) and comes also with the option to use/share one definition of the UI between different platforms.
Your question is not absurd by any means - you're looking for the solution to a problem we've all been dealing with for many years - how to achieve cross platform compatibility and code reuse. But perhaps there are some points that you need clarification on:
As others have said, C++ is not the only 'OS agnostic' language - in fact most languages are 'OS agnostic' - what normally isn't (and cannot be) OS agnostic is the compiler, the GUI libraries etc. Pascal, C++, Python, C#, Java and many others have SDK's for various OS's, much of it open source.
If for some reason you are set on C++, check out Embarcedaro C++ - a Delphi clone using C++ instead of Object Pascal.
And IMO you should investigate Qt: http://doc.qt.nokia.com/latest/index.html - Qt is an excellent 'OS agnostic' framework that includes GUI widgets as well as many other powerful libraries that span pretty much the whole scope of modern PC computing.
Although c++ is the native language for Qt development, there are quite a few 'language bindings' available to make Qt programming possible with other languages. (varying degrees of functionality are supported depending on the binding implementation) I understand there is an Object Pascal language binding for Qt using Lazarus - I haven't tried it yet but it sounds very interesting.
Also, a word of caution: separating your GUI from the 'underlying guts' of your application such that it is OS agnostic can be quite challenging in complex applications - I think a good place to start is by reading up on the MVC paradigm.
HTH

Easiest way to build a cross-platform application

I have read a few articles in the cross-platform tag. However, as I'm starting a fresh application (mostly a terminal/console app), I'm wondering about the easiest way to make it cross-platform (i.e. working for Linux, Mac OS X, and Windows). I have thought about the following:
adding various macro/tags in my code to build different binary executables for each operating system
use Qt platform to develop a cross-functional app (although the GUI and platform component would add more development time as I'm not familiar with Qt)
Your thoughts? Thanks in advance for your contribution!
Edit: Sounds like there are a lot of popular responses on Java and Qt. What are the tradeoffs between these two while we're at it?
Do not go the first way. You'll encounter a lot of problems that are already solved for you by numerous tools.
Qt is an excellent choice if you definitely want C++. In fact, it will speed up development even if you aren't familiar with it, as it has excellent documentation and is easy to use. The good part about it is that it isn't just a GUI framework, but also networking, XML, I/O and lots of other stuff you'll probably need.
If not necessary C++, I'd go with Java. C++ is far too low level language for most applications. Debugging memory management and corrupt stacks can be a nightmare.
To your edited question:
The obvious one: Java has garbage collection, C++ doesn't. It means no memory leaks in Java (unless you count possible bugs in JVM), no need to worry about dangling pointers and such.
Another obvious one: it is extremely easy to use platform-dependent code in C++ using #ifdefs. In Java it is a real pain. There is JNI but it isn't easy to use at all.
Java has very extensive support of exceptions. While C++ has exceptions too, Qt doesn't use them, and some things that generate exceptions in Java will leave you with corrupt memory and crashes in C++ (think buffer overflows).
"Write once, run everywhere." Recompiling C++ program for many platforms can be daunting. Java programs don't need to be recompiled.
It is open to debate, but I think Java has more extensive and well-defined library. The abstraction level is generally higher, the interfaces are cleaner. And it supports more useful things, like XML schemas and such. I can't think of a feature that is present in Qt, but absent in Java. Maybe multimedia or something, I'm not sure.
Both languages are very fast nowadays, so performance is usually not an issue, but Java can be a real memory hog. Not extremely important on modern hardware too, but still.
The least obvious one: C++ can be more portable than Java. One example is FreeBSD OS which had very poor support for Java some time ago (don't know if it is still the case). C++/Qt works perfectly there. If you plan on supporting a wide range of Unix systems, C++ may be a better choice.
Use Java. As much bashing as it gets/used to get, it's the best thing to get stuff working across any platform. Sure, you will still need to handle external OS related functions you may be using, but it's much better than using anything else.
Apart from Java, there are a few things you can run on the JVM - JRuby, Jython, Scala come to mind.
You could also write with the scripting languages directly( Ruby, Python, etc ).
C/C++ is best left for applications that demand complete memory control and high controllability.
I'd go with the QT (or some other framework) option. If you went with the first you'd find it considerably harder. After all, you have to know what to put into the various conditionally compiled sections for all the platforms you're targeting.
I would suggest using a technology designed for cross-platform application development. Here are two technologies I know of that -- as long as you read the documentation and use the features properly -- you can build the application to run on all 3 platforms:
Java
XULRunner (Mozilla's Development Platform)
Of course, there is always the web. I mostly use web applications not just for their portability, but also because they run on my Windows PC, my Ubuntu computer, and my Mac.
We mainly build web applications because the web is the future. Local applications are viewed in my organization as mostly outdated, unless there is of course some feature or technology the web doesn't yet support that holds that application back from being fully web-based.
I would also suggest Github's electron which allows to build cross platform desktop applications using NodeJs and the Google's Chromium. The only drawback for this method is that an electron application run much slower than a native C++ application due to the abstraction layers between Javascript and native C++.
If you're making a console app, you should be able to use the same source for all three platforms if you stick to the functions defined in the POSIX libraries. Setting up your build environment is the most complicated part, especially if you want to be able to build for multiple platforms out of the same source tree.
I'd say if you really want to use C++, QT is the easiest way for cross-platform application, I found myself using QT when I need an UI even though QT has a large set of library which makes pretty much everything easier in C++.
If you don't want to use QT then you need a good design and a lot of abstraction to make cross-platfform application.
However I'm using more and more Python bindinq to QT for medium size application.
If you are working on a console application and you know a bit of python, you might find Python scripting much more comfortable than C++. It keeps the time comsuming stuff away to be able to focus on your application.

How can I build an application like Thunderbird? Which language should I select? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I don't want to build the Thunderbird functionality. I just want to build a project with plug-in features, cross platform, and easy to install. Is there any document which point to the development of Firefox or Thunderbird?
I know the Thunderbird is build in C++, then how can i get these kind of graphics and all other function.
Please help me.
In the spirit of other answers, I feel obliged to point out that Mozilla provides the platform they used to build their applications, including Firefox and Thunderbird, -- see XULRunner.
With XULRunner you
develop interfaces in XUL (cross-platform UI description language that Firefox and Thunderbird use) or even HTML,
develop program logic in JavaScript or, if you really need to, C++ (or even Python, like Komodo does),
have support for the same extension mechanism as used Firefox/Thunderbird
Here's a partial list of applications built on top of XULRunner: XULRunner Hall of Fame.
To answer your original question, the Mozilla platform provides rich functionality on many platforms by specifying a set of cross-platform APIs (e.g. (oversimplifying) XUL for interface definitions) and implementing each API on each platform.
Implementing such a cross-platform layer from scratch is lots of work, so instead of trying to look at and copy Thunderbird's implementation, you should pick one of the cross-platform solutions mentioned in the answers here (Mozilla, Eclipse, QT, wxWidgets, etc.)
Each has its strengths and weaknesses, without knowing your current expertise and requirements it's not possible to pick one for you.
You can browse the source code of Firefox here:
http://mxr.mozilla.org/firefox/source/.
And Thunderbird:
http://mxr.mozilla.org/seamonkey/source/.
Anyway if you want to build a portable app with plug-ins I suggest you forget about trying to copy Mozilla and learn Qt or wxWidgets instead.
Eclipse RCP can be a good solution to build rich cross-platform client applications with plug-in features.
Eclipse RCP is based on Java and SWT technologies.
Here is a list of applications build with Eclipse RCP. A demo mail client build with RCP is also available here. Another great software build with RCP is RSSOwl, a feed reader.
While selecting a language/platform for development, I think the following points are to be thought of:
Development support for the features looking for.
Maintainability - in terms of the support of the platform/language, how much it is supported for maintenance.
Compatibility with the platforms of intention (cross platform etc.)
Future expandability of the language/platform
C++ is simply a great language. The rest (making use of rich graphics etc.) is to learn...
Lots of options and others have already suggested good ideas. Java will make your life (reasonably) easy but C/C++ give you more power at the expense of needing to abstract APIs.
I should add be careful - it'll likely be difficult to make changes to your app once you have committed to one set of technologies and done some serious development without re-writing. For example, if you chose C and the Apache Portable Runtime, you might have a hard time converting to something else. Likewise if you write a UI in swing, converting to SWT/Eclipse will mean a UI rewrite. I don't want to discourage you, just add a warning that I think x-platform apps require quite careful planning.
A few notes r.e. the Mozilla tree too. Thunderbird/Firefox etc essentially build from the same source tree, just using different components. The Mozilla build system is pretty complicated, in my opinion more so than the Linux Kernel. Thus, Manuel's suggestion about forgetting Mozilla is a good one unless there's something to be gained by their route.
Mozilla's category manager makes it very easy to add plugin support to your application, but like other posters said, you'll have a fair hill to climb before you get there.

Any good C/C++ web toolkit? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've been looking around and came across the WT toolkit, Is it stable? Any good?
I was stumped on how to go about this in C++, given the lack of libraries and resources concerning web developement. (CGI/Apache)
The purpose of my application is to populate some data from a Sybase ASE15 database running GNU/Linux & Apache Hence allow some user interactions.
I am going to use Sybase open client library (libct) to retrieve columns from the Server, feed this data back to wt model/view.
My requests:
Is there any more practical solution rather than using other scripting languages?
I mean by practical, an interface with ODBC retrieving, and MVC mechanism?
If not available in C++, any alternative in Java?
C++ isn't a very popular choice for
web applications - probably because
it's too easy to leave security holes,
and development time tends to be a lot
slower than for the scripting
languages.
Dynamically typed scripting languages convert compile-time errors to runtime errors. Detecting those might not be as easy as reading through the compiler output. Scripting languages may be OK for quick-and-dirty simple projects. Beyond a certain level of complexity one needs strongly typed, well-structured languages. Such as C++, or Java.
Most scripting languages encourage sloppy programming.
As to the "security holes": if you refer to buffer overruns, allocation/deallocation errors, the answer is "STL". And proper training of course :-)
http://www.webtoolkit.eu/wt#/
http://cppcms.sourceforge.net/wikipp/en/page/main
C++ web service framework
For starters. There are certainly more I'm sure - a healthy google search probably wouldn't hurt. Also, you could try the #C++ channel on freenode - they have an offtopic channel that you can ask about if you want to talk about non STL C++ and the people there would happily answer your questions I'm sure. Good Luck.
tntnet (http://www.tntnet.org) is great for creating web applications with C++.
Give this one a look. I never much liked Wt's design. But then, I'm kind of an anti-framework guy.
http://cppcms.sourceforge.net/wikipp/en/page/main
CGI programs are pretty damn easy to write in both C and C++ - you don't really need any special library, though having one will obviously make development a little faster. Do you really understand how CGI works? Basically, your program reads environment variables with getenv(), does some processing, and then writes some HTML out to the program's standard output.
You might want to check out klone:
http://koanlogic.com/klone/index.html
Basically, it's a framework AND server that makes writing C++ web backends easy...
The best web toolkit for C/C++ would be Apache httpd. Just write a module and you can use libct to access your database.
There is MVC modules out there like mod_spin but I don't have any experience with it.
C++ isn't a very popular choice for web applications - probably because it's too easy
to leave security holes, and development time tends to be a lot slower than for the
scripting languages. I'd say 99% of web applications don't need the speed that
C++ brings.
So this leads to a lack of good frameworks.
From my fairly light look at the area I'd say Wt is probably your best bet, although
it's more of a library of useful things (like page templates) than a framework.
I'd seriously consider not doing this in C++ though. Even Java (I prefer C++ myself) has
much stronger support for web development.
Another alternative may be the "FastCGI / CGI C++ Library" that is aimed for Boost integration at someday: http://cgi.sourceforge.net/
Qt is going to grow day by day. And Wt is the trying to stand for web tool kit based on Qt. C++ the powerful language and the best in my opinion. If you like gnu projects and independent tech. I really suggest to use them. I used PHP, Phyton, C#, VisualBasic, Fortran etc. but I did not like as much as C++ among of them.
I gave Wt a try and really liked it. I will not give you any cons or pros for using it from scratch, but when you have a backend written in C/C++ with millions of API entries then Wt is an obvious choice. There are some very powerful features that is easier to use for example dynamically loaded tables. Signal processing on the server etc.
One thing I really disliked at Wt is that it is not compatible with Apache on Windows as of time of this writing. You either have to use Unix, or IIS on Windows. Wt also offers its own http server, that is very convenient for developing your applications but I would not trust it in the role of production server as I am not sure of its security.
My personal choice for web development is Ruby on Rails, but if you have to chose between C, C++ or Java for web development, my suggestion is to use Java with JavaServer Faces
Apache Celix looks like a promising active project that meets the requirements of this (albeit old) question. See: http://celix.apache.org/
From the Apache Project description page:
Celix is an implementation of the OSGi specification adapted to C. It will follow the API as close as possible, but since the OSGi specification is written primarily for Java, there will be differences (Java is OO, C is procedural). An important aspect of the implementation is interoperability between Java and C. This interoperability is achieved by porting and implementing the Remote Services specification in Celix.

Will Learning C++ Help for Building Fast/No-Additional-Requirements Desktop Applications? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Will learning C++ help me build native applications with good speed? Will it help me as a programmer, and what are the other benefits?
The reason why I want to learn C++ is because I'm disappointed with the UI performances of applications built on top of JVM and .NET. They feel slow, and start slow too. Of course, a really bad programmer can create a slower and sluggish application using C++ too, but I'm not considering that case.
One of my favorite Windows utility application is Launchy. And in the Readme.pdf file, the author of the program wrote this:
0.6 This is the first C++ release. As I became frustrated with C#’s large
.NET framework requirements and users
lack of desire to install it, I
decided to switch back to the faster
language.
I totally agree with the author of Launchy about the .NET framework requirement or even a JRE requirement for desktop applications. Let alone the specific version of them. And some of the best and my favorite desktop applications don't need .NET or Java to run. They just run after installing. Are they mostly built using C++? Is C++ the only option for good and fast GUI based applications?
And, I'm also very interested in hearing the other benefits of learning C++.
yep, C++ is absolutely great. Check Qt. It has a great Python binding too, so you can easily prototype in Python, and when/if you need extra performance, porting to C++ is a mostly 1:1 translation.
But in fact, writing C++ isn't so hard either when you have a great platform, the worst part is writing all the class declarations :-)
If you want to build Windows applications that will run without frameworks such as .NET or virtual machines/interpreters, then your only really viable choices are going to be Visual Basic or C/C++
I've written some small Windows apps before in C++ code, and there is definitely a benefit in terms of speed and ease of deployment, at the expense of difficulty going up for development. C++ can be very fast, natively compiles, has many modern language features, and wide support. The trade off is that it's likely that you'll need to write more code in certain situations, or seek out libraries like Boost that provide the functionality you're after.
As a programmer, working in C++ and especially in C is good experience for helping you understand something just a tad closer to the machine than say, .NET, Java or a scripting language like VBScript, Python, Perl etc. It won't necessarily make you a better programmer, but if you are open to learning new lessons from it you may find that it helps you gain a new perspective on software. After all, most of the frameworks and systems you depend on are written in pure C, so it will never hurt you to understand the foundations. C++ is a different animal from straight C, but if you develop in C++ for Windows you'll likely find yourself working in a mix of C and C++ to work with Windows APIs, so it will have a trickle-down effect.
I wrote C++ windows apps for 10 years and switched to c# about 2 years ago to work on the latest product. I am embarrassed by how pathetic the C# app is. It takes 20 seconds to start up, you have to wait a second or so for it to switch between screens. I've used some third party GUI control library, and that leaks memory like a sieve! My app runs at 150 meg, and its doing hardly anything.
I am looking to go back to C++.
You can use MFC, it will be far quicker than .Net. Or, if you really want to burn, check out WTL - aLthough, there's not much documentation for that. I suggest you go with either MFC or Qt because you'll find plenty of good information and tutorials for them.
I can see that C# can be quicker to develop with, and maybe in some future version it will be quicker and smaller.
You will hate my answer:
The biggest bottlenecks in GUI development usually are not because of the language. After all most of the time in most applications the UI is idling, waiting for some user input. I can hear your screams already, but I said in most of the apps.
Let's put it this way: I am pretty sure that one can design a good UI on top of the .Net CLR. Learning C++ is a good thing, but will not solve the inherent problems of developing a good UI.
As always. It depends.
As long as you stay away from microsofts large Frameworks, as MFC, .net etc your applications can be blazing fast, but hard to code. Your benefit: You will really learn how windows is working behind its nice(?)surface. Just look into the initialisation code for COM-Objects and you know what I mean. You will never see such things in VB or C#
You have to program each button, each window and each control by yourself, sending silly window messages, however your applications are small, very small. This is an forgotten art:
Write small, fast programs
Good luck!
If you're committed to learning the raw, gritty details of Win32, then C++ will get you there. If you're not, then you'll end up using a bunch of wrappers anyway. For something like a small utility or especially something like a shell extension (where trying to use .NET will cause you problems anyway), C++ will let you write effective code with the absolute minimum in external dependencies. For a larger app, YMMV - a lot of the UI sluggishness out there comes from poor design: naive algorithms, an unwillingness to spin off non-trivial operations onto separate thread(s), reliance on badly-written 3rd-party components instead of custom controls... Mistakes easily made in any language.
Here is my honest answer to this.
First, I think every programmer should learn C/C++ just for the fact that by learning C++ you learn about programming. It is a systems-level language. You have to consider the finer details of memory management and so forth. I am shocked at how many programmers do not understand the foundational aspects of a programming language or computer system. By learning C/C++, you force yourself to understand programming at a more intimate level. On top of that, if you learn how to program in C/C++, you can program in almost anything.
That isn't to say C/C++ is always the right tool for the job. It can be a total pain to debug and take longer to write more meaningful code. However, it is perfect for those situations where you need absolute control of how a program executes.
This goes to say, I don't prefer C/C++ for UI programming. You still have to use a windowing framework specific to the OS you run on (MFC,Win32,Motif,GTK,QT,etc.). These frameworks don't lend themselves to easy learning curves. For at least Windows development, .NET is really the future of UI development (even though surprisingly MFC got a major overhaul for Vista that does stuff .NET doesn't even do yet). If you write your UI in .NET, it is easier to maintain and for others to maintain.
I typically write my UI in .NET and backend in C++.
Yes and no. It's all about optimization...And since C++ allows you to work on a lower level C++ is one of the best languages to write fast applications.
However those low-level mechanics implemented in C++ could be very annoying if you're used to more abstract approaches to OOP.
Testing your software in C++ is usually a long process.
If you are looking for speed anyway, C++ would definitely be one of the best choices.
C++ will indeed potentially get you a leaner, meaner and faster application (if you do it right).
However, the .NET framework is built for comfort from a developer point of view; a vast improvement over Win32 API or MFC, which may seem like hard work in comparison, So consider how you will implement the aspects for which your application depends on .NET (there are other frameworks available that may be easier than MFC or Win32 API), and also consider the costs and license issues of using such frameworks; for example the free VC++ Express Edition for example does not include MFC support.
If you know where you application is sluggish, C++/CLI may be a solution; allowing you to mix managed and native code to accelerate the parts that need it. However if it is the GUI that is intrinsically slow rather than the application processing; this may not be a useful path.