Why are Set & Get important?

J

Jorgen Grahn

It depends. I've a counter class, which is nothing more than an
int which takes care of initialization and overflow detection
(and doesn't support anything but ++ and --).

Yes, that was the kind of thing I was thinking of -- removing
flexibility and assigning specific meanings to existing types.
I'd probably use a lot more
such classes if they didn't require so much effort to write;

I have done it recently (see the thread "Simple and clear ways of
creating distinct types" from back in January) and I have to say I am
happy with it. The effort wasn't as big as it seemed at first, and the
benefits were sometimes magical -- lots of silly mistakes no longer
could happen, finding good names for things became easier, ...

But I noted that when I have stable, tiny building-blocks, I *am*
tempted to be a bit sloppy with the bigger objects which have
behaviour.

/Jorgen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top