If I had to change a programming language, I would change C++ by getting rid of the need for forward references on methods, classes, or functions that are not defined yet, but are later in the source code.

 

            Here is a code sample that would compile before this change:

 

            void hello();

            int main()

            {

                        hello();

                        return 0;

            }

            void hello()

            {

                        cout << "Hello world!" << endl;

            }

 

            This code sample will compile after the change, but not before it:

 

            int main()

            {

                        hello();

                        return 0;

            }

            void hello()

            {

                        cout << "Hello world!" << endl;

            }

 

            One positive effect this change would have is that if you have two objects that have methods that call methods in the other object, you don't have to add anything like forward references or a base class to make it compile.

 

            Some things this change wouldn't affect are the performance of the program after it is compiled, and a compiler with this change would still be able to compile old C++ or C code.

 

            One negative effect this change would have is that compiling a program will take longer, because the compiler will have to look at the source files once to get the names of functions, variables, etc, then a second time to actually compile the code.

 

            I think this change could also work in several other languages, such as Java and C.  One language that already has this feature is D, and it seems to work fine.

 

            I think that any type of program written in C++ could benefit from this change, however, I can't think of any type of program that can't be written in C++ without this change that could be written after it.

 

            I think this change would probably be occasionally useful, but it would mostly be a convenience.

 

            I think it will be very easy to learn how to take advantage of C++ no longer requiring forward references if a function isn't defined before it is used.