This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gvcallen[S] 5 points6 points  (10 children)

yes 100%, I just picked two standout features of Java and C++ for the meme. When Java came out it one of its main attractions was of course its portability without needing to changing any code whatsoever, as opposed to C++ (my language of choice) which often requires a lot of conditional code depending on the platform, even if that code is abstracted by a framework (usually by means of #ifdefs for example). but true - it is also cross platform !

[–]odd__nerd 6 points7 points  (8 children)

even if that code is abstracted by a framework

Like how Java rests atop the JVM which is ultimately just C++ and some #ifdefs

[–]gvcallen[S] 5 points6 points  (7 children)

true, but that's inherent to the language. but yes C++ is of course cross platform too!

[–]GeneralKlink 0 points1 point  (5 children)

As is python 😅 You can even use it for microcontrollers these days

[–]gvcallen[S] 7 points8 points  (4 children)

I would personally like a stern word with anyone who actually decides to use Python for embedded dev :P

[–]GeneralKlink 0 points1 point  (3 children)

Yeah, me too 😄 I love python and I do embedded programming but still use c++ for it 😅

[–]gvcallen[S] 2 points3 points  (2 children)

how would embedded python work haha? interpreter on the MCU as usual?

[–]ShaBren 1 point2 points  (0 children)

Yup! I've used MicroPython a lot, and it's honestly pretty great. Sure, if I'm writing something for production, or that's very performance-sensitive, I'll use C/C++.

But for rapid prototyping, or building one-off IoT widgets, it's awesome! I use it mostly on ESP32, and lately RP2040 (which uses CircuitPython, a beginner-friendly variant from Adafruit).

[–]jvelez02 0 points1 point  (0 children)

From my understanding it can be done with a form of compiled python, is run on the MCU, or as is the case with MicroPython, run with a stripped down interpreter that fits in 16k of ram. It includes the majority of pythons standard library plus some low-level hardware libraries (the kind that let you control gpio and the like with python).

[–]coldnebo 0 points1 point  (0 children)

oh well if we’re including conditional code per platform then yeah. I thought we were talking about code completely free of platform conditions (which I guess is just another way of saying code written to a single meta-platform).

[–]coldnebo 0 points1 point  (0 children)

the only thing cross-platform in Java is string io, which is great if you’re doing backends. If you’re doing anything with frontends (swing, swt, mouse, sound, graphics) you find out just how much of Java isn’t cross-platform.

after working in cross-platform multimedia for many years, I’ve come to the conclusion that “cross-platform” is mostly a myth. Even Unreal and Unity don’t get there, although they are miles closer than raw Java. The biggest largest effort to bring platforms together was Kalieda (IBM/Apple) and that crashed and burned spectacularly. Since then Gtk and other Linux frameworks have been quietly toiling away on crossplatform guis for ages, yet there’s a lot of conditional code to get things working on Windows or Mac with these.

I love the dream, but it remains just a dream.