>>9410466
>>9410468
it depends.
in the case of
$ int length = 100;
there's nothing wrong with it, since you're just initializing the int with a literal. as soon as we get to
$ int length = passed_in_from_somewhere;
land, we're allowing implicit, ie information-discarding, type conversion, whereas
$ int length{passed_in_from_somwhere};
will produce a compiler error when passing in a float.
however,
$ std::vector<int> vec(5, 10);
and
$ std::vector<int> vec{5, 10};
do vastly different things; one creates a std::vector, size 5, all 10s, the other creates a std::vector, size 2, 5 and 10.
the latter is the reason why using curly braces for initialization isn't best practice yet. however, i tend to teach favoring curly braces while being aware of fun issues with container/class initialization.
in the end, it remains a matter of opinion. just as C++ remains a language where you still, despite all C++11 and following mitigation efforts, must know what you are doing.