What are the benefits of using C over C++ for greenfield projects, setting aside build times and such.
In other words, is there anything that can be done in C that cannot be done at least equally well in C++? Is there something that can be done in C that just can't be done in C++? What are the dealbreakers?
(No language wars please.)
Boosts appreciated: my sphere of influence is quite small. 🙏
Yay!! Again, some compiler decided to change template conversion operator rules.
And again, compilers won't agree with what the standard says or with each other since changing the rules may break users, even though they keep doing it (even in minor versions!) 🤦
I was experimenting with colour distances at work today. I need to find out how similar two colours are, so I wrote a little test program and it was surprisingly pretty.
The algorithm is simple:
Fill the canvas with random colours.
Set the first pixel (top left) to red.
For all pixels, find the most similar pixel and move it next to the current pixel.
To determine the similarity, I calculated the 3D distance in the RGB, HSV and YUV color spaces, which brought very different results. Now, it's quite possible that my HSV and YUV conversion functions were just broken, but that's okay.
As far as I can test, I'm able to do precise reflection on overload set to get the reference kind of each parameters on all overload.
This is true, at least on GCC.
The only way it's possible is to try to call the function many time with a carefully crafted type with a specific set of conversion operators. I can then detect what expressions are ambiguous and which are not and deduce the reference kind of a particular parameter.
Despite me being an absolute performance addict beyond reason, I have decided not to write my dice roller entirely in C++, for now. At least not until Godot 4.2 comes out, which brings hot-reloading to GDExtension.
GDScript is slow, and I really hate wasting people's CPU cycles, but prototyping the game logic is just so much quicker because it's right in the editor and changes are applied immediately.
I am also certain that I will be able to convert GDScript to GDExtension C++ fairly easily, because all I do is call engine functions, basically. It's just a matter of translating the syntax.
Last but not least, It would make a nice case study to directly compare the same implementations in GDScript and GDExtension C++.
#askFedi#fediHelp Is the following pattern known and does it have a name?
I have a number of classes (call them C1, C2, etc) that all derive from the same class B. I have a superclass (template, actually) D that derives from C1, C2 etc. To have a single B, the standard solution is to go with virtual inheritance to close the diamond (so far, so good).
Making a metroidvania-style thing in #cplusplus and #SDL2 inspired by #hollowknight. Don't know how far it'll go, but as linus torvalds once said, "This'll just be a small project, not anything big like the other contenders (or something like that)"
Currently finishing off a HK-style character controller system. It looks jaggedy, but I know that's just because of the lack of any animations, so the next step will be to integrate spritesheets and such. Then level elements and a loading system.
Do you think it's worth spending time studying the C programming language today, considering that #Rust addresses and improves upon many of the fundamental issues found in #C and #cplusplus?? Why?
The software industry, especially in the realm of free software, has mostly settled on a pattern of using C++ for creating performance critical libraries, and creating Python binding to the C++ libraries for scripting. I was hoping Rust might come along and change all this, but it will take decades.
In the mean time, if you want to use C++ but not actually write C++, you can make use of the ECL Common Lisp compiler, which can compile Lisp to C++ code. This gives you all the best features of Common Lisp for programming with the universe of C++ code libraries available to you. You can use a C++ library and still have Common Lisp macros, garbage collection, high-level scripting, S-expressions as serialization, domain specific languages, a proper meta-object protocol that wraps C++ classes nicely, and wealth of choices for functional programming systems from the untyped lambda calculus all the way up the lambda cube to System-F and the Calculus of Constructs. This not only makes ECL a viable alternative to Python for scripting and app development, but objectively better than Python since you can actually turn your Common Lisp scripts into code that gets compiled into a larger C++ application.
With ECL I would have all sorts of C++ libraries available to me:
game engines like Unreal and Godot
3D modeling: FreeCAD, OpenSCAD, Blender
Machine learning, big data, and HPC with PyTorch, TensorFlow, OpenCV, OpenCL
I will continue to contribute to the Scheme and Haskell communities as much as I can. I will continue to pursue my dream of an Xfce-like desktop environment written in Scheme. But no matter how I look at it, I am going to more productive in the long run using ECL and C++.
I was hoping that the software industry would gradually shift over to better, more functional languages like Rust and Haskell. And I would love it if Scheme languages could ever begin to seriously replace Python as a scripting language. But realistically, I think I am going to change tack and meet the industry half way. I think I should probably start using ECL as my language of choice, as much as I would prefer Scheme or an ML-family language like Haskell.
> Fixed a possible crash during the trophy cutscene that could happen if the stadium did not have a scheduled match and was not associated with an owning club.
In eine Diskussion von der Seite einsteigen, unsachlich argumentieren, C und C++ im selben Wort zusammenfassen, einen Informatikprofessor mit mehreren Ehrentiteln beleidigen und direkt nach der Antwort die Gesprächsteilnehmer blocken.
So, like many #GameDev#programming folks, I'm doing a bit of saturday work from home to support the project as it is getting closer to release.
Since my home desktop is primarily a #Linux system, I decided to try and see if I could compile a #Windows game without Windows.
Short answer: No. I could not.
There is actually an #AUR package that gives you a working #MSVC compiler in #Wine, but there is no way to get #MSBuild to work to build .sln and .vcxproj files.
I wonder how much worse the build time would be in a VM 🤔
This is a 48 minute long article that's critical of the Rust hype train vs C/C++. The TLDR is that while security is a problem, the Rust vs C choice as the only choice for low-level systems programming is a “non choice”. The author states that Go is a perfectly fine choice. https://medium.com/
I just heard the bad news that I am probably going to need a new job starting in July.
So, before beginning the regular search, I wanted to ask my Fedi friends if anyone could use a capable C++ programmer with lots of graphics and networking experience. I wouldn't mind a change, so I'm open to anything. Even other programming languages! It would be awesome if I could use Linux to do the work. 🐧
Locations I would consider are: Central Europe, Melbourne, Sydney or Remote