Content deleted Content added
re |
→Modern C++: Reply |
||
Line 34:
:: P.s. it's not OK to specify the return type as {{tt|int32_t}}, that type is neither required to be {{tt|int}}, nor is it even required to exist (it's an optional type alias). The return type of {{tt|main}} [https://eel.is/c++draft/basic.start.main#2 must be {{tt|int}}] --[[User:Ybab321|Ybab321]] ([[User talk:Ybab321|talk]]) 10:42, 23 February 2024 (UTC)
:::The code seemed comparable enough. it has the same functions and control flow. And it compiles with {{code|1=gcc -std=c++20 -Wall -Wextra -pedantic}} with only some unused argument warnings. As far as MSVC, you just have to add {{code|#define _USE_MATH_DEFINES}} to get {{code|M_PI}}. Or you could define M_PI directly. But I don't think changing the code like that would make it any more clearer. I would say it is the clearest information the Carbon developers have given as to what they don't like about C++. I guess what you're saying is that the content is not allowable under [[WP:SELFSOURCE]] because it is self-serving and makes false claims about what a typical C++ program looks like. I'm not seeing that though? Many C++ programs use M_PI, e.g. [https://github.com/search?q=M_PI+language%3AC%2B%2B&type=code&l=C%2B%2B in this Github search], generally defining it themselves but there are also a lot of programs [https://github.com/search?q=_USE_MATH_DEFINES+language%3AC%2B%2B&type=code doing use_math_define].
:::Now as a contrary point, I have looked at various programming language articles on Wikipedia and generally they don't do language comparisons, merely language examples. But cc @[[User:Nexxl|Nexxl]] who added the comparison. [[User:Mathnerd314159|Mathnerd314159]] ([[User talk:Mathnerd314159|talk]]) 00:03, 24 February 2024 (UTC)
|