Um, the whole point of this discussion is about the claim that C++ is a good language for beginners to learn.
I have problems with using C++ to build real projects with experienced programmers too, but those are mostly different problems.
I have problems with using C++ to build real projects with experienced programmers too, but those are mostly different problems.
> x = [1, 2, 3, 5, 8, 13] # this is a list of integers
> y = set([1, 2, 3, 5, 8, 13]) # this is a set of integers
Actually, that's not the best way to do it:
In C++ {} is syntactic sugar for "Create an initializer_list with these values," which is what happens when it's assigned to an "auto" variable. Not surprising at all. If you want a different type, you need to specify the type that you want.Maybe it's confusing to beginners and people who don't take the time to learn the language, but C++ isn't catering to those people.
Don't get me wrong, there are a lot of "gotchas" in C++, I just don't think the two you've posted are very bad.