Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow questionStack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Added link to dlang.org
Source Link

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming languageD programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.

Source Link

Yes, you're going to confuse other C++ programmers if you write all your code like that. I have never seen non-template C++ code written that way, with everything in the header file. This has been discussed in depth in a Stack Overflow question as well.

As for actual technical problems with it, a few things come to mind.

  • All your code effectively becomes inline. Your compile times will likely increase.
  • Every recompile will compile the world simply because it has to.
  • You'll have to be careful to not run afoul of the One Definition Rule. Variable names will have to be unique across all source files, since it effectively becomes one giant file.

You also might want to check out the D programming language, which I hear solves a lot of these problems. The D compiler is designed with this style in mind and doesn't have 30 years of C backward compatibility to support.