Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is better for a student programming in C++ to learn for writing GUI: C# vs QT? [closed]

I'm a teacher(instructor) of CS in the university. The course is based on Cormen and Knuth and students program algorithms in C++. But sometimes it is good to show how an algorithm works or just a result of task through GUI. Also in my opinion it's very imporant to be able to write full programs. They will have courses concerning GUI but a three years, later, in fact, before graduatuion. I think that they should be able to write simple GUI applications earlier. So I want to teach them it.

How do you think, what is more useful for them to learn: programming GUI with QT or writing GUI in C# and calling unmanaged C++ library?

Update.

For developing C++ applications students use MS Visual studio, so C# is already installed. But QT AFAIK also can be integrated into VS.

I have following pros of C# (some were suggested there in answers):

  • The need to make an additional layer. It's more work, but it forces you explicitly specify contract between GUI and processing data. The border between GUI and algorithms becomes very clear.
  • It's more popular among employers. At least, in Russia where we live. It's rather common to write performance-critical algorithms in C++ and PInvoke them from well-looking C# application/ASP.Net website. Maybe it is not so widespread in the rest of the world but in Russia Windows is very popular, especially in companies and corporations due to some reasons, so most of b2b applications are Windows applications.
  • Rapid development. It's much quicker to code in .Net then in C++ due to many reasons.

And the con is that it's a new language with own specific for students. And the mess with invoking calls to library.

like image 876
flashnik Avatar asked Mar 17 '10 23:03

flashnik


People also ask

Is C good for GUI programming?

All operating systems are written in C. So, any application, console/GUI you write in C is the standard way of writing for the operating system.

What programming language is best for GUI?

Java seems to have the best built in support for GUI programming, however, C++ using the MFC libraries has more than adequate tools for GUI development and may be a better choice when speed and efficiency are important.

Does C have a GUI library?

Many programming languages bolster GUI improvement as one of the centrepieces of its language highlights. C has no such library connected to it like the string library, IO library, etc, that we every now and again use.


1 Answers

It is better to familiarize students with Qt, as Qt is actually C++. C# is a completely different beast, and if you use C#, you will very likely get your students confused about what things are Microsoft- or C#-specific vs. what is actually defined in the ISO C++ standard, whereas this will be more obvious with just C++. Moreover, Qt and C++ are portable, so your students who are using Mac OS X or Linux will thank you for choosing a cross-platform framework (Qt also works on Windows); whereas, if you use C#, you will force your students to use Windows (yes, there is Mono, but it doesn't work nearly as well as Qt does across platforms).

You might also be interested in using my C++ Project Template which provides sufficient infrastructure for devleoping a Qt GUI application in C++ using CMake, and has been tested and verified to work under Mac OS X and Ubuntu Linux (and, if I get feedback on Windows, I will ensure it works there too). The template includes code that brings up a "Hello World" GUI in Qt when run with the "--gui" commandline option.

like image 89
Michael Aaron Safyan Avatar answered Oct 25 '22 00:10

Michael Aaron Safyan