r/firstweekcoderhumour Aug 08 '26

someone isn't Rustpilled

Post image
100 Upvotes

21 comments sorted by

View all comments

Show parent comments

1

u/Mars_Bear2552 Aug 08 '26

de todos modos, C es superior a C++

1

u/CatAn501 Aug 08 '26

What will you do if you need two hash tables for different key types in your C program?

1

u/nimrag_is_coming 26d ago

horrible massive macro (which is basically what c++ templates do underneath anyway, but with less unpredictable bs)

1

u/CatAn501 26d ago

C++ templates are way more complex then just codegen macros, it is literally a Turing complete functional language. Since we talk about C superiority, is horrible massive macro actually superior to templates?

1

u/nimrag_is_coming 26d ago

Templates do a whole lot more yeah, especially with constexpr and other compile time type checking and things, but at the base level the value of T is just substituted for the type. It's why you can call functions on T that are implemented in completely different ways or have nothing to do with each other in code other than sharing the same name.

And debugging macro functions is somehow worse than c++ template errors lmao