Hacker News new | past | comments | ask | show | jobs | submit login

yes but, when you think some more about that means a lot.

There is no such thing as inheritance, you route your data through different functions. There is no such thing as private data, its all public by default.

You can still have strict types I guess, to make sure you are passing the right kind of data into the right function. But most of my experience coding this way is js and lua.

I only code like this for my home projects, I have no idea what it would be like working in a team of 10 programmers all rushing to jam new features into a giant code base.




> There is no such thing as private data, its all public by default

Not in C, put the strict declaration in the h after and the definition in an implementation source file.

Callers of the implementation functions can pass the strict around without seeing any of the fields. Only functions in the implementation can access the fields which results in all acce to the fields going through the implementation only.

Cleaner and safer than letting the caller see everything while only accessing some things.


You don't have to use inheritance, but it's there when you need it.

Private data are also very useful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: