Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some thoughts about C++ #788

Closed
playgithub opened this issue Jul 3, 2016 · 5 comments
Closed

Some thoughts about C++ #788

playgithub opened this issue Jul 3, 2016 · 5 comments

Comments

@playgithub
Copy link

playgithub commented Jul 3, 2016

  • As a programming language
    C is perfect.
    C++ tries to take the advantage of semantic, so genius grammar is in demand :)
    C++11 introduced some grammar candies: initilizer_list, auto, for (auto e:v), etc. Candy is candy, you can't take candy grammar seriously. The classic grammar should be taken seriously, so it should not be mixed with the candy grammar. If you mix classic grammar with candy grammar, it becomes less classic, i.e. not classic.
    I think seperating them explicitly will make C++ more excellent.
  • As a library
    STL is good enough :)
@playgithub playgithub changed the title Some thoughts about C++ standards Some thoughts about C++ Jul 3, 2016
@jwakely
Copy link
Member

jwakely commented Jul 3, 2016

This seems to be a purely personal opinion with no concrete suggestions for changing anything. The idea of separating "classic" features from the more modern ones would be highly controversial, arguably the modern features make code clearer and simpler.

https://github.com/cplusplus/draft/wiki/How-to-tell-if-an-issue-is-editorial

@jwakely jwakely closed this as completed Jul 3, 2016
@playgithub
Copy link
Author

playgithub commented Jul 3, 2016

I mean new grammar and classic grammar can be all there, but some of the new grammar is not so strict, I call them candy grammar, what about to seperate candy grammar and classic grammar in language level, something like namespace.

@jwakely
Copy link
Member

jwakely commented Jul 3, 2016

That's definitely not an editorial change, so this is the wrong place to propose it. It's also a terrible idea. Just because you don't value the new language features doesn't mean they should be relegated.

@playgithub
Copy link
Author

playgithub commented Jul 3, 2016

  • Let me express my opinion more clearly
    C is perfect, but only experienced talented programmers can use it properly. If C can be used to write good programs, why make C++ more and more complex?
  • Be concrete, take initializer_list for example
    1. It is not common to initialze a container (vector, list, ...) with hard coded constant values, isn't it? And I think it is not a good practice to hard code a vector / list, so the grammar should not encourage this, so no initializer_list. If the programmer need do it indeed, he/she can do it easily, even more suitable for his/her situation. The point is a good programming language should naturally encourage good programming .
    2. initializer_list introduce a new rule for constructor priorities, who a serious programmer wants to remember such a rule?

@jwakely
Copy link
Member

jwakely commented Jul 3, 2016

This is the wrong place to discuss your opinions on good use of C++. std::initializer_list is not only for initializing standard containers. Even if it was, there are valid uses for initializing them with constants, and initializer lists also allow populating containers from variadic parameter packs.

Just because you don't like modern C++ style does not make it inferior, and this is the wrong place to discuss it. Please find somewhere else, e.g. https://groups.google.com/a/isocpp.org/forum/#!forum/std-discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants