May 18, 2022
On Sunday, 15 May 2022 at 21:33:24 UTC, Ali Çehreli wrote:
> ....
> I still think my answer is the real one. My implied question remains: Why does C++ have struct and class disticnction? I know they have different default access specifications but does that warrant two kinds?
> ....

Here is a very interesting article that researches this subject.

https://belaycpp.com/2021/09/17/history-of-c-explanation-on-why-the-keyword-class-has-no-more-reason-to-exist/

May 19, 2022

On Wednesday, 18 May 2022 at 10:53:03 UTC, forkit wrote:

>

Here is a very interesting article that researches this subject.

Yeah, he got it right. It is syntax sugar that makes verbose C++ code easier to read. Use struct for internal objects and tuple like usage and class for major objects in your model.

But Simula used class for more: coroutines and library modules. So, you could take a class and use its scope in your code and thereby get access to the symbols/definitions in it.

The successor to Simula, called Beta, took it one step further and used the class concept for functions, block scopes, loops, almost everything.

The language Self went even further and collapsed the concept of class and object into one... perhaps too far... People prefer Typescript over Javascript for a reason. 😁

1 2 3 4
Next ›   Last »