4 ms·
companion objects are one of the best things about modern programming languages. it’s really helpful to think about static and dynamic this way
by foolfoolz 8y ago
companion objects are one of the best things about modern programming languages. it’s really helpful to think about static and dynamic this way
- on_and_off 8y agoCould you elaborate please ? What do they bring on top of static fields and methods ?
- foolfoolz 8y agothey don’t bring any functionality but it is clearer separation. i think it’s easier when you read these components in different scope blocks. they do very logically different things and importing static into instance makes more sense than keeping it all in one. maybe it was just me but i didn’t undserstand static vs dynamic after 4 years of school and into my first job. it took a while to grasp. but now that i know the differences i’d rather keep them isolated