4 ms·
I found C++ very complex and difficult to work with, though it is very powerful in terms of performance. There is also several years of libraries available in C
by chhs 10y ago
I found C++ very complex and difficult to work with, though it is very powerful in terms of performance. There is also several years of libraries available in C++ that is difficult to leave behind.
If you are looking for something like C++ in terms of performance and has a nicer syntax, you should try the D programming language. It's very nice to use, as fast as safe C++ code (you can write unsafe C++ that is faster), has stronger typing, templates, mixins, and can interface with C /C++ libraries.
I've moved my personal projects over to D, I've started writing a game with OpenGL, SDL, ASSIMP, Devil and it's much easier than C or C++.
Some links for those who are interested:
Main website: http://dlang.org/ http://dlang.org/
Package manager: http://code.dlang.org/ http://code.dlang.org/
Some interesting documentation pages:
Interfacing with C: http://dlang.org/spec/interfaceToC.html http://dlang.org/spec/interfaceToC.html
Interfacing with C++: http://dlang.org/spec/cpp_interface.html http://dlang.org/spec/cpp_interface.html
Templates: http://dlang.org/spec/template.html http://dlang.org/spec/template.html
Inline Assembler: http://dlang.org/spec/iasm.html http://dlang.org/spec/iasm.html
- RobertDeNiro 10y agoHow easily can you use D on something that's not x86? Is there decent cross compilation?
- chhs 10y agoI've not used D on platforms other than x86 but I have heard cross compilation mentioned in the comments of some conference talks. I found this page which has the status of the LDC compiler on various platforms. It looks like it is still under development but I don't know recently that page was updated. Status of various platforms: https://wiki.dlang.org/LDC https://wiki.dlang.org/LDC
- Ace17 10y agoAt least one of the prepackaged D compilers of Debian (GDC) can target ARM, and I've tried it, it works!