Why c++ and other languages don't have built in classes?

Everyone have to built some basic classes when learning the oop concept and even for developing database for some organization some some classes are frequently used like student class,employ class ,person class and more. My question is that why languages don't provide them on it's own ?
Because there is no single implementation for these objects. That being said, there ARE some built-in classes. std::cout and std::string are two common ones.
Probably because standardisation of such a class wouldn't work across the board.

One company's person class might need different information to another company's person class. Having a standard version with loads of fields would be a little inefficient.

Faiz Muhammad wrote:
when learning the oop concept

What better way to learn than implementing your own class?
Besides the above, there's a point where you have to stop adding functionality to your language. There are thousands of functions and classes are that immensely more useful than your examples., but you either leave most of them out, or get humongous language implementations (e.g. Java, .NET) to accommodate all that code.
some some classes are frequently used like student class,employ class ,person class and more.


Are you seriously suggesting that programming languages should come with a class meant to represent a student?
some classes are frequently used like student class

While learning C++ (and maybe other languages), you will come across classes such as "student" because that is likely to be meaningful and easy to relate-to for the person who is learning.

That is deliberate, because the emphasis is on making the C++ object correspond to a real-world object. This means the actual student of the programming language can use their knowledge and understanding of the real world and how it behaves to guide the development and understanding of the program which is written.

On a separate topic, C++ does provide the Standard Template Library (STL) in order to save application developers from having to re-invent solutions to common problems over and over again.
Last edited on
Topic archived. No new replies allowed.