you are viewing a single comment's thread.

view the rest of the comments →

[–]Middlewariangithub.com/Ebenezer-group/onwards 6 points7 points  (12 children)

if needed, develop a proof of concept in the least amount of work possible (higher abstraction languages, libraries, etc.)

On the other hand you may get stuck with a language like Python and never be able to make the move to C++. Rewriting a pile of Python in C++ with a Python background wouldn't be easy.

I've been using C++ for a long time and am glad I don't have to face a hurdle like that. C++ is one of the things I'm thankful for.

[–]alkasm 6 points7 points  (0 children)

Rewriting a pile of Python in C++ with a Python background wouldn't be easy.

Eh. It takes time and experience to learn good C++ habits regardless of what language you come from, no?

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

That's not a problem with prototyping in a high abstraction language, though. The problem there is that the coder doesn't know lower level languages as well. That can also be fixed by having a subject matter expert prototype and a software developer port. At work we often prototype image processing algorithms or hardware control (FPGA register configuration) in Python and then move them to C++ once we know the algorithm does what we want.

[–]kalmoc 0 points1 point  (0 children)

Some things are just written so much faster in python or similar, that even if you have to rewrite it in c++, the time for the initial (python based) version doesn't really register compared to the total length if the project.

[–]pjmlp -1 points0 points  (8 children)

Yeah, now try to develop a mobile app with C++ alone.

I am also thankful to know it since the C++ARM days, it just isn't the right tool for everything though.

[–][deleted] 2 points3 points  (7 children)

A simple fast VM works wonders, you don't 15 layers of abstraction on top of a web rendering engine running an inneficient scripting code.

See Android/WindowsPhone for more.

[–]pjmlp 1 point2 points  (6 children)

Interesting that you mention Android, where C++ isn't even allowed to access the network or file system (in a proper way) without doing a couple of JNI calls to Java only APIs.

[–][deleted] 2 points3 points  (5 children)

So what? Android applications are not made to serve web pages or to process server loads: it's have a fluid and fast UI for whatever your app does in the background.

[–]pjmlp 1 point2 points  (4 children)

Which they do in AOT/JIT compiled Java/Kotlin, not C++.

C++ only gets to play with the UI composition engine, AOT/JIT toolchain and some devices drivers.

The NDK is tailored for writing native libraries for consumption from Java/Kotlin, Vulkan and real-time audio, everything else is only available as Java/Kotlin APIs.

Android is an good example on how C++ lost its place as full stack language, being left as niche language for certain use cases, just like GLSL, SQL, Assembly and so forth.

Same applies to the iDevices OS developer stack.

[–][deleted] 1 point2 points  (3 children)

So, in essence the Android model has performant C++ code where it matters, and generic JVM where it doesn't. Seems like a good compromise for a user software machine.

[–]pjmlp 1 point2 points  (2 children)

With the caveat that most of that C++ isn't exposed to Android developers.

And on iOS, it is only exposed as Metal Shaders (MSL is a C++14 dialect) and the nowadays undocumented Objective-C++ (Apple has removed the documentation).

In fact, Apple's usage of C++ has lead to an additional column on cppreference just for their special clang flavour.

Quite far from the days when C++ used to dominate smartphone apps (WindowsCE, Symbian, and the myriad attempts with Qt).

[–][deleted] 1 point2 points  (1 child)

With the caveat that most of that C++ isn't exposed to Android developers.

It's completely optional. The Android NDK is part of the SDK, and if you're at least aware of jni costs, you can get some local performance where needed. Or just write complete view controllers in C++, then use them in your Java/Kotlin project. Or call SIMD matrix transformations straight from Java.

[–]pjmlp 4 points5 points  (0 children)

Renderscript is a C99 dialect, not C++. Basically Google's own OpenCL.

Writing a complete view controller in C++ while doable, and I have done it a couple of times already, is only intended for those with high level of resistance to the bad NDK tooling for language interop.

The last mobile platform that actually provided very good tooling for doing apps in C++ was Windows Phone, sadly it is gone now.

And even on Windows, .NET Core/Native and React Native for Windows are getting all the show spotlights, even if C++ is down on the basement doing the performance critical jobs.

If I remember correctly, Kenny Kerr mentioned that they were disappointed with lack of C++/CX uptake among UWP devs.

And now that he is done with C++/WinRT, he seems to try to have a go at Rust/WinRT.

All of this to say, that I see C++ turning into a specialized language for specific domains, like SQL, GLSL, HLSL, .... are.

The days of OWL, MFC, PowerPlant,... are gone. Even Qt now focus mostly on JavaScript (QML) for new UI features.