If C had the template keyword I'd probably use C++ a lot less
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
This article discusses the differences between C and C++, especially regarding templates and constexpr. Just like in io games, the choice of programming language is a trade-off between features and performance. The final decision usually depends on the specific needs of each project.
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
This article discusses the differences between C and C++, especially regarding templates and constexpr. Just like in io games, the choice of programming language is a trade-off between features and performance. The final decision usually depends on the specific needs of each project.
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
This article discusses the differences between C and C++, especially regarding templates and constexpr. Just like in io games, the choice of programming language is a trade-off between features and performance. The final decision usually depends on the specific needs of each project.
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Interesting, but not for the reason you think. I just checked the moderation queue and three messages there were latched onto your post.
Yeah some presumably "AI" powered spambot hit my inbox.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
The main reason I prefer C++ over C is
template
** andconstexpr
. Recently they've addedconstexpr
to the latest C standard, but I don't know how deep it goes - if it's as functional as it is in C++. I have very little reason to use C++ otherwise. I'd actually prefer things if I wasn't dealing with classes with things like non-trivial constructors, destructors, and assignment operators. Why? Because RAII isn't very practical without exceptions, and if you're working with multiple different heaps at runtime. I actually like C's simplicity, but dislike the preprocessor. I'd much prefer something typed, and with specializations and recursion. ** They'd have to allow template function specializations, or allow static functions in template structures in order to be particularly useful though. Not sure which route they'd take.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
honey the codewitch wrote:
but dislike the preprocessor.
You can implement your own. :-\
-
honey the codewitch wrote:
but dislike the preprocessor.
You can implement your own. :-\
Nah. To make it any good it needs access to the type information the compiler has built up. It can be a separate pass like C++ does to make it work, but it needs to be integrated into the compiler to do things like typed arguments and specialization.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix