Lack of support for type-safe containers (need to be hack toghether via macros) and overreliance on macros in general (which are not IDE and debugger friendly) are two aspects of C that are off-putting for majority of people in 2026. That's even assuming you're willing to forego pointer/memory safety.
Indeed, picking C doesn't make sense when you actually want to write C++ code in C ;)
Re:The Two Factions of C++
by wasmperson on Wednesday August 19, 2026 @11:40AM
(#49363030)
> Lack of support for type-safe containers (need to be hack toghether via macros)
Are templates really so much better than macros that the latter deserve to be called a "hack"? The following two examples are both type-safe and have roughly the same semantics and #LoC:
Macros:
// pair.h
struct id(pair) { T a, b; };
static inline struct id(pair) id(make_pair)(T a, T b){
return (struct id(pair)){ .a = a, .b = b };
}
#undef id
#undef T
// main.c
#include <stdio.h>
#define T int
#define id(n) n ## _int
#include "pair.h"
int main(void){
struct pair_int p = make_pair_int(12, 13);
printf("%d %d\n", p.a, p.b);
}
Templates: //pair.h
template<typename T>
struct pair { T a, b; };
template<typename T>
pair<T> make_pair(T a, T b){
return (pair<T>){ .a = a, .b = b };
}
//main.cpp
#include <stdio.h>
#include "pair.h"
int main(void){
pair<int> p = make_pair(12, 13);
printf("%d %d\n", p.a, p.b);
}[dead]
> Well, Carbon would have been better off if they just made "C with `match` and sane error handling" instead of whatever it is they are building there over at Google.
Perhaps that might be a better language in a different context, but I don't think that language would have have been better for Google given their goals (e.g., bidirectional interop with C++, incremental automated migration, memory safety, etc.)
Re:The Two Factions of C++
by neutronicus on Wednesday August 19, 2026 @08:27AM
(#49360628)
C++ at least rescues you from defining a million callbacks with a void* context argument that you then cast into whatever you know it actually is
Well.. "C".. though I wouldn't go so far as to call that a good language, either.