C++ rant

Please consider the following standard C++ program.

#include <iostream>
using namespace std;
main(){
  cout << "Hello, World!";
  return 0;
}

What is wrong with this?

  1. ¬†include statement: we are including a header or a piece of source code, why isn’t it called iostream.h?
  2. using namespace std: if standard, it could be omitted and considered standard because it has not been mentioned.
  3. main function: why there are no parameters in it
  4. return statement: do we assume the function has been defined as int….

Ideal version, in my opinion…. but opinions are subjective

#include <iostream.h>

int main(int argc, char *argv[], char *env[]){
  cout << "Hello, World!";
  return 0;
}