Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Prism
Therefore, in some languages, _variables are reserved for the system implementation.

I'm not sure I understand you. I'm not a computer programer. I was refering to a Freeper who is known as _FED because his user name starts with a _ and he probably is a cop. I'm alway on the lookout for newbies who say things like "Because it's the law" too much. I just won't trust them anymore.
The sad thing about this country is that if the Founding Fathers were alive today, they wouldn't recognize it any more. I posted an article about the Bill of Rights last week. You might want to read it.
Stay Free...if you can
W1

34 posted on 09/08/2001 7:50:28 PM PDT by watcher1
[ Post Reply | Private Reply | To 26 | View Replies ]


To: watcher1, _jim
In programming, certain conventions are adopted so there is no conflict (stepping on toes) in the naming of variables.

One of these conventions is the use of _ as first letter in variable name, this is a domain (group) of variables reserved for "system implementation" -- the 'inner workings' of something.

Example:

I might make an object called a counter. It has a 'public interface' and the rest of it is its guts, the inner workings. This is done so there is no way to get an object contaminated-- or in a state that shouldn't be possible.

My counter is constructed by a function, whereby I recieve an 'instance' of the counter--

variable c= new Counter(0,10)

the 0 is the starting count, the 10 is the increment.

so now I can say--- c.incr();c.incr(); and c is now equal to 20 (but c is also a counter object).

now you see what I mean by contamination and states that should be impossible (c==9) for instance.

Whew huh. Ok. when you MAKE/design this object, you need an internal number to keep track of the value you are AT, or representing, this is called a private member of the object, and (may) be labeled _count.

It is the IMPLEMENTATION (insides) of the counter object, compared to the INTERFACE (outside/user) part. The user doesnt need to know how a counter works on the inside, they just need to know how it is going to behave on the outside -- functions like c.incr(),c.decr(),c.reset(), etc.

So now maybe you see why I find it interesting that certain posters would choose to underbar thier names, like _Fed, and _Jim.

What do you think?

So _jim, how long you been programming for the government? Or is it just a hobby < Smirk >

39 posted on 09/08/2001 8:20:53 PM PDT by Prism
[ Post Reply | Private Reply | To 34 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson