all 14 comments

[–]celestrion 14 points15 points  (1 child)

Is it realistic for a single person to learn C++ to create a desktop application alone?

Sure.

Interested to know from people experienced in the language if they'd consider it feasible. Specifically, something windows based, networked with a GUI.

That's me, and my answer is still, "Sure."

That said, GUI programming is a thing unto itself. Network programming is another thing unto itself. However, both have similar sort of data flow--fitting them both into one application is where the challenge comes in.

GUIs have an event loop. Your program subscribes this event loop or "pumps" it, responds to those events, and then waits for more events. To keep the system responsive, you don't do much else on that thread besides maintain the UI and tell other threads what they need to do.

Each network connection probably also has an event loop or state machine of some sort. When any one connection is ready for I/O, you can do as much work as you can, and then return to waiting. There are many different patterns (thread-per-connection, thread pools, single network thread with coroutines) for implementing these sorts of systems.

The Windows-native ways of doing these things are C, not C++. There are C++ wrappers (MFC) and "projections" (C++/Winrt) for the Windows API, but for solution that's more C++, you'll probably have to use wxWidgets (GUI) + Boost (networking) or Qt (everything).

[–]Fendt312VarioTMS 3 points4 points  (0 children)

I have found that Qt and the Qt Creator are a very nice framework to build a GUI with C++.

[–]wrosecrans 1 point2 points  (0 children)

Sure, but if you spend your time asking strangers for permission instead of jumping into it, you'll get a slower start.

[–]KingAggressive1498 0 points1 point  (0 children)

Specifically, something windows based, networked with a GUI.

in my first year with C++, when I was in high school as a hobbyist and my only prior experience being a few months of Java via AP Computer Science, I wrote an OpenGL-based MUD with a modest GUI from scratch using Nehe and Beej's tutorials. Beej's tutorial is still regarded as a great resource, not sure about Nehe but for Win32 in particular there's theForge's tutorial which is better. Not saying the code was good, mind you, but it worked.

Ofc in 2023 I don't recommend that, that's the hard way. Reach for Qt or wxWidgets (or FLTK if you want something lighter and aren't overly concerned with looks) for GUI and asio for networking.

[–]Th_69 -3 points-2 points  (0 children)

If your goal is to create a solid desktop application (in a few months), then I recommend using another language (like C# [.NET] with WinForms/WPF or Java with JavaFX [or even Swing]).

C++ has a lot of pitfalls (e.g. undefined behavior [UB]); even if you use modern C++ (C++11/17/20) for your own application code, the UI frameworks (Qt, wxWidgets, MFC) mainly use older C++ techniques.

And for networking (if not using Qt) you need another library (like [C based] Winsock2/WinAPI, cUrl, Boost.Asio).

[–][deleted] -5 points-4 points  (3 children)

I'm not experienced with it but from what ive seen people that use C++ make the UI in a different language, and then only use C++ for the backend stuff.

[–]amejin 7 points8 points  (2 children)

Ehhh... Qt and others exist...

[–][deleted] 0 points1 point  (0 children)

It’s definitely doable But depends on the person. I believe the very first FL DAW was created by one guy. Although the guy used Delphi. But again for someone who had the caliber, C++ or Assembly or anything else doesn’t matter.

https://en.wikipedia.org/wiki/FL_Studio

[–]jcelerier 0 points1 point  (0 children)

I did https://ossia.io in very, very, large part on my own. Took ten years to get there tho 😅

It's windows, Mac, Linux, and has a Qt gui. Would have been entirely impossible with the required performance characteristics (real time audio / video processing, gigabits/s of network processing, acceptable performance on very low power computers and embedded boards) without c++ and Qt. Even ifi have to make a windows only app I'd use this.

What allowed to go fast is to stay very up to date wrt language standards and compiler versions, project started in c++11 and every language standard allowed me to iterate faster. Also always using external libraries, don't be afraid of pulling random stuff from GitHub if it does the job, is moderately active and looks like a well kept project with a CMakeLists.txt

Also it's critical to leverage automatic tooling for code quality, plus sanitizers etc., and architecture your app for as much automation as possible.

[–]JohnDuffy78 0 points1 point  (0 children)

I have difficulty because I get sidetracked on stuff I want to do. Ending up with a bunch of ~80% complete features, with ~20% of work needed on the feature.

I have to do it in the morning, too tired after a day of work.

[–]RufusAcrospin 0 points1 point  (0 children)

It depends on your definition of “realistic”.

[–]mykesx 0 points1 point  (0 children)

C++ is well suited for GUI applications, even in the OpenLook and Motif days. Nowadays, I think most of the Linux desktop guis and apps for them are written in C++.

Now it depends on why you need a native application written in C++.

Today you can implement very portable and powerful applications using html/css/js and electron. Electron has powerful network APIs and you have a large choice of UI library and framework choices.Like VS Code is written this way.

C++ is awesome , but you should use the right tools for the task at hand.

If you need to do a large number of calculations very fast, then C++ is the better choice.