1. Global variables should not be allowed without a prefix "global".
int x; // compile failure!
static int y;
global int x; // ok
(this should be turned on as an option). I should be able to search for "global" and find them all
(and remove them, because globals are pointless and horrible, especially in the modern age of multi-threading).
2. Name-hiding should require an explicit "hide" prefix, eg.
int x; // compile failure !
hide int x; // ok
I hate name-hiding and think it never should have been in the language. It does nothing
good and creates lots of bugs. Similarly :
3. Overloads and virtual overrides should have an explicit prefix.
This ensures that you are adding an overload or virtual override intentionally, not by accident just because the names happen to line up. The entire C overload/override method only works by coincidence; like it's a coincidence that these names are the same so they are an overload; there's no way to say "I intend this to be an overload, please be an error if it's not" (and the opposite; I intend this to be a unique function, please error if it is an overload).
Similarly, it catches the very common error that you wrote a virtual override and it all worked and then somebody changes the signature in the base class and suddenly you have code that still compiles but the virtuals no longer override.
4. C-style cast should be (optionally) an error.
I should be able to flip a switch and make C-style casts illegal. They are the devil, too easy to abuse, and impossible to search for. There should be a c_cast that provides the same action in a more verbose way.
5. Uninitialized variables should be an error. (optionally).
int x; // compile failure!
int x(0); // ok
Duh. Of course. Same thing with member variables in class constructors. It's ridiculous that it's so easy to use uninitialized memory.
6. Less undefined behavior.
Everything that's currently "undefined" should be a compile error by default. Then let me make it
allowed by setting pragmas, like :
which then changes those usages from compile errors to clearly defined operations.
7. Standardize everything that's sort of outside the standard, such as common pragmas, warning disablement, etc.
The way to do this is to have a chunk of standard that's like "you don't have to implement this, but if you do the syntax must be like so" and then provide a way to check if it's implemented.
Just a standard syntax for warning disablement would be great (and of course the ability to do it in ranges or even C scopes).
Things like SIMD could also be added to the language in this way; just simple things like "if you have a simd type it is named this" would massively help with standardizing shit which is different on every platform/compiler for no good reason.
8. (optionally) disable generation of all automatic functions, eg. assignment, copy construct, default construct. The slight short-term convenience of these being auto-generated is vastly outweighed by the bugs they create when you use them accidentally on classes that should not be copied. Of course I know how to put non-copyable junk in classes but I shouldn't have to do that; that should be the default, and they should only be copyable when I explicitly say it's okay. And you shouldn't have to write that out either, there should be a "use default copy" directive that you put in the class when you know it's okay.
9. Trivial reflection. Just give me a way to say "on all member variables". There's no reason not to have this,
it's so easy for the compiler to add, just give me a way to do :
In which the compiler generates the list of members for me, I don't have to manually do it.
void Reflect( t_op & op )