Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

My OO...

Name: Anonymous 2011-12-13 3:19

...it's violated!

http://programmers.stackexchange.com/questions/17031/when-c-handles-pop-in-your-c-code-and-break-your-pretty-oo-design

Anime avatar. Passive-aggressive rant. Autismal as fuck. That's gotta be someone from /prague/, amirite?

Name: Anonymous 2011-12-13 4:52

>>2

I think you're missing something

"is it safe?"

Say I'm writing a graphics library, and I don't want certain parts of my window class to be touched, as letting the user fuck around with them willy nilly will crash the program (however they need to be there). Things like, oh I don't know, the dimensions of the window. Sure you can ask for it, but changing what the program thinks is the dimensions and what is actually the dimensions would be just plain silly.

Here comes the OO programmer. He declares the dimensions of the window private, and creates getter functions in case the programmer needs to know what they are, but makes no possible way of changing them outside of the constructor function.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List