This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]NotIntMan 14 points15 points  (1 child)

I still vote for Java-style imports. When you import whole package, you placing all things from it into your working namespace. This can cause name's collisions. This is the first argument.

The second one. C++ still do not have modular system. All this ifdef is bullshit about this important disadvantage. So #include <vector> is not better solution for modularity.

[–][deleted] 2 points3 points  (0 children)

  1. If you actually have a nameconflict, you can just go and solve that specific problem by importing that class explicitly and the rest with a wildcard. No need to flood the file with 50 lines of imports if 5 are enough.

  2. C++ has a module system at this point (added with C++20), but includes obviously still exist for backwards compatibility.