2 ms·
In case of TS vs JS it's well advertised that: > existing working JavaScript code is also TypeScript code For C++, it's been decades since anything like that
by shprd 2y ago
In case of TS vs JS it's well advertised that:
> existing working JavaScript code is also TypeScript code
For C++, it's been decades since anything like that was true.
> C++ is, like Typescript to Javascript, almost a superset of C except for a few changes that break things.
"Almost" and "few changes" are doing some heavy lifting here. Advertising and insisting incorrectly that C++ is a superset is only doing harm to both languages and causing confusion like the one in the post. It might have been true some 30+ years ago, but let's stop spreading it (outside of historical context) and misinforming others.
Please see:
- https://en.m.wikipedia.org/wiki/Compatibility_of_C_and_C++ https://en.m.wikipedia.org/wiki/Compatibility_of_C_and_C++
- https://www.stroustrup.com/bs_faq.html#C-is-subset https://www.stroustrup.com/bs_faq.html#C-is-subset