←back to thread

271 points mithcs | 1 comments | | HN request time: 0s | source
Show context
krapht ◴[] No.45953071[source]
C++: "look at what others must do to mimic a fraction of my power"

This is cute, but also I'm baffled as to why you would want to use macros to emulate c++. Nothing is stopping you from writing c-like c++ if that's what you like style wise.

replies(7): >>45953166 #>>45953176 #>>45953287 #>>45953573 #>>45954009 #>>45954016 #>>45961205 #
loup-vaillant ◴[] No.45953287[source]
> I'm baffled as to why you would want to use macros to emulate c++.

I like the power of destructors (auto cleanup) and templates (generic containers). But I also want a language that I can parse. Like, at all.

C is pretty easy to parse. Quite a few annoying corner cases, some context sensitive stuff, but still pretty workable. C++ on the other hand? It’s mostly pick a frontend or the highway.

replies(1): >>45954654 #
1. CyberDildonics ◴[] No.45954654[source]
There was a language called clay that was C compatible but had move semantics, destructors, templates and operator overloading.