Which C++ version you guys are using?
1 karma · joined April 13, 2021
Which C++ version you guys are using?
Please see this commend by Ivan,
https://www.reddit.com/r/cpp/comments/s0mhf/qt_5_moving_away...
> Afterwards go learn how to create a GUI for macOS, iOS, Android, ChromeOS, Windows, WebOS (as shipped by LG) or even Fuchsia, using only their SDKs and nothing else.
Why use native SDK when there is QT?
The same can be said for Java. Why use Swing when there is native SDK?
Ahahhaa
The way you treat C++ is unfair.
It's your job to make it not to leak. You have to write Modern C++ wrappers around C libs.
Similarity, The same can be said for Java. You can do low level in Java.
C++ is not C. C++ has backward compatibility with C.
Look at Boost folks, they wrote a Modern C++ wrapper around a C HTTP parser.
> And as I said, I’m familiar with RAII, it’s really great when the given object is scope-based, but can’t do anything otherwise.
Nothing is impossible.
You can use Scope Exit Guard with QT Widget.
https://github.com/ricab/scope_guard
> And if the new subclass has some non-standard object life cycle you HAVE to handle that case somewhere else, modifying another aspect of the code. It is not invisible, unless you want leaking code/memory corruption.
Again, Scope Exit Guards solve your problem!
No body understands it even at electron orbitals. Your understanding will be wrong in next decade if not wrong already. Computer Arch is proprietary.
Give a try for C++17.
Zero Cost Abstractions RAII
It's a beast.
2. QT not moving away from pure C++.
C++ apps always been more responsive than java swing and electron.
Please tell me why you can't. C++ is both not one. It's a multi paradigm language.
In Modern C++, the low level details invisible.
> Every memory allocation/deallocation have to be thought out again and tested
True If you're writing C with Classes or Java Style C++.
>> C with Classes >>> malloc()
>> Java Style C++ >>> new and delete everywhere
> There are plenty of cases where you can’t really pinpoint a scope-exit where this given object should be reclaimed.
Show me. I'd bet your case can be solved with xvalues.
> A GC is a necessity in many concurrent algorithms that simply could not be written without.
Show me a concurrent algorithm that needs GC.
> but what if the requirement has changed now touching on a core of your program.
C++ is a OOP language just like Java. You do it same way as you do in Java. Use inheritance.
> major refactor as it is another low level lang
No. It's not a low level language if you write Modern C++.
The case for Java very clear prior 2011 but now C++ has caught up.
See list of companies using C++ QT for GUI,
I bench-marked using Intel vTune.
for loop is interesting. It's why Tensorflow Core written in C++ instead Java.
I don't know any complex C++ program that employ their own GCs when C++ has RAII which is superior to GC.
Just give a try for C++11/14/17 and you will see which one is more maintainable and expressive.
Look at Chromium codebase. It's the most beautiful codebase I've ever been to.
I've done a lot of CRUD web apps in C++ using expresscpp [1] and I would say it's easy as ABC.
A lot of Java folks haven't tried C++11/14/17 (Modern C++).
C++ is Zen of OOP.
AOT compilers exists for Java, Net, Javascript. I however doubt the user experience of those.
For example, GraalVM mentions the following,
"There is a small portion of Java features are not susceptible to ahead-of-time compilation, and will therefore miss out on the performance advantages. To be able to build a highly optimized native executable, GraalVM runs an aggressive static analysis that requires a closed-world assumption, which means that all classes and all bytecodes that are reachable at run time must be known at build time. Therefore, it is not possible to load new data that have not been available during ahead-of-time compilation."
You just need to know your tools, that's it. Plenty people forget -O flag and existence of libraries like Folly.
If you combine PGO along with these must knows, you seriously will become much more faster.
I don't think C++ and Rust are for just low-level. I've build a lot of GUI apps and distributed ones with C++
QT is a beast.
The issue with Java is the reverse engineering. Back in 90's, The main selling point for Java was to prevent it, because at that time the bytecode was hard to understand at least. Now tools has grown and it's fairly easy to reverse engineer Java, even if one obfuscate it.
As for C++, Inline code and template code make it pain in ass.
I'm sure big companies that care about intellectual property would use C++ over Java anytime. C++ also has mature obfuscation tools that make it even more difficult.
Java has it's place. It's great language if you use in server side or isolated env (From commercial viewpoint).
Nevertheless, I've built many web apps using C++ too.
[0] https://bugs.chromium.org/p/chromium/issues/detail?id=835887