Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> If an object is just there to store data and no behavior

Then why do you have it at all?



To define a valid shape for related data.


I suppose because the language doesn't have typed records. You have to simulate them with objects.


Sometimes many different values are related to each other and it is useful to keep them close together for explicitness (and other reasons).


... to store data?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: