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

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,739
Latest member
Clint8040

Latest Threads

Top