Programming Terms

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Programming Terms

Post by Ginto8 »

XianForce wrote:
ismetteren wrote:
Ginto8 wrote: *encapsulation: making everything private and only accessible through functions.
[/list]
Nice list, i think this one is wrong though. I dont really know how to describe what it really is, since im not good at descriping stuff and english isent my main language, but to "encapsulate what varries" is a OOP design principle, where you put stuff that you are going to change in a different class(the strategy design patternhttp://en.wikipedia.org/wiki/Strategy_pattern, so you dont have to change that class later, but can instead just write another class, and use it instead, so that you can follow the open/closed principle.

But maybe encapsulation has a more general meaning too..
Yeah, I'm pretty sure what Ginto posted is sort of a means of implementation of encapsulation.

Encapsulation is like hiding data away to make things simpler.
Okay I changed it. How do you like this?
*encapsulation: Hiding class data so that the class can control all access to it.
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
wearymemory
Chaos Rift Junior
Chaos Rift Junior
Posts: 209
Joined: Thu Feb 12, 2009 8:46 pm

Re: Programming Terms

Post by wearymemory »

Ginto8 wrote: Okay I changed it. How do you like this?
*encapsulation: Hiding class data so that the class can control all access to it.
Perhaps your definition would be more meaningful (and lengthy :| ) if you explained it in more depth, and provided an explanation as to why it is a factor in determining a well-designed API from a poorly designed one. I would define encapsulation as:
Encapsulation or Information Hiding wrote: The fundamental design-concept of a module that hides its internal data and other implementation details from other modules, so that modules communicate only through their APIs and are unaware of each others' nuts and bolts, is known as encapsulation or information hiding.

While the separation of a module's API from its implementation does not necessarily result in better performance, it speeds up maintenance, development, and testing, and it facilitates optimizing, invariants, and software reuse.

The general principle is to make each module, its instance data and implementation, as inaccessible as possible. Exceptions can be made for static, constant variables that are immutable*, or if the module will not be a user-accessible part of the public API, then there is nothing wrong with making its instance data public.

*Note: arrays are not immutable, and should be defensively copied before being accessed if at all possible
Last edited by wearymemory on Tue Aug 17, 2010 9:56 am, edited 1 time in total.
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Programming Terms

Post by Ginto8 »

wearymemory wrote:
Ginto8 wrote: Okay I changed it. How do you like this?
*encapsulation: Hiding class data so that the class can control all access to it.
Perhaps your definition would be more meaningful (and lengthy :| ) if you explained it in more depth, and provided an explanation as to why it is a factor in determining a well-designed API from a poorly designed one. I would define encapsulation as:
Encapsulation or Information Hiding wrote: The fundamental design-concept of a module that hides its internal data and other implementation details from other modules, so that modules communicate only through their APIs and are unaware of each others' nuts and bolts, is known as encapsulation or information hiding.

While the separation of a module's API from its implementation does not necessarily result in better performance, it speeds up maintenance, development, and testing, and it facilitates optimizing, invariants, and software reuse.

The general principle is to make each module, its instance data and implementation, as inaccessible as possible. Exceptions can be made for static and constant variables that are immutable*, or if the module will not be a user-accessible part of the public API, then there is nothing wrong with making its instance data public.

*Note: arrays are not immutable, and should be defensively copied before being accessed if at all possible
these are supposed to be general definitions, not in-depth explanations. Go to google if you actually want to fully understand it all :roll:
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: Programming Terms

Post by dandymcgee »

Weary must be real bored tonight, he's been digging topics left and right. :roll:
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: Programming Terms

Post by MrDeathNote »

dandymcgee wrote:Weary must be real bored tonight, he's been digging topics left and right. :roll:
You know i was just thinking something along those same lines lol.

EDIT: Chaos Rift Maniac - Woot!!!
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: Programming Terms

Post by XianForce »

MrDeathNote wrote:
dandymcgee wrote:Weary must be real bored tonight, he's been digging topics left and right. :roll:
You know i was just thinking something along those same lines lol.

EDIT: Chaos Rift Maniac - Woot!!!
Congratulations :D
User avatar
Khearts
ES Beta Backer
ES Beta Backer
Posts: 50
Joined: Sun Oct 10, 2010 5:07 pm
Current Project: Super Mario Bros Clone and 3D Engine
Favorite Gaming Platforms: Dreamcast
Programming Language of Choice: C/++

Re: Programming Terms

Post by Khearts »

Uhh:

Singleton ??
Heap ??
"Foo" ??
User avatar
Ginto8
ES Beta Backer
ES Beta Backer
Posts: 1064
Joined: Tue Jan 06, 2009 4:12 pm
Programming Language of Choice: C/C++, Java

Re: Programming Terms

Post by Ginto8 »

Khearts wrote:Uhh:

Singleton ??
Heap ??
"Foo" ??
Singleton: A method of restricting a class so that it can only have 1 instance at a time
Heap: a more loosely-structured version of the stack, used for dynamic memory allocation
foo: just a standard generic name for a function (or sometimes a variable). Don't ask me where it comes from, idk
Quit procrastinating and make something awesome.
Ducky wrote:Give a man some wood, he'll be warm for the night. Put him on fire and he'll be warm for the rest of his life.
User avatar
Khearts
ES Beta Backer
ES Beta Backer
Posts: 50
Joined: Sun Oct 10, 2010 5:07 pm
Current Project: Super Mario Bros Clone and 3D Engine
Favorite Gaming Platforms: Dreamcast
Programming Language of Choice: C/++

Re: Programming Terms

Post by Khearts »

I feelz morz edukated! Thkz!!
ladygaga627

Re: Programming Terms

Post by ladygaga627 »

Just want to say you are great...like this topic so much...learning more ine here.
________________
Like shopping when i have a good time.
Rs Gold|Diablo 3 Items|Wedding casino To Celebrate Your Love story|Runescape Gold|D3 Items
Post Reply