Darpesh Patel

Greenhorn
+ Follow
since Feb 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Darpesh Patel

In Java and C++, private means private to a class, ie objects of the same class can access each others private variables.
however smalltalk/ eiffel, one of them(I don't remember exactly) has the concept of private meaning private to an object. wherein an object cannot access private variable/ method of another object, although both objects are of the same class.
considering that c++ and java, came after that particular language(smalltalk/ eiffel) there would be some reasoning for making private meaning being private to an object to private to a class.
i guess one of the reason could be speed improvement.
maybe someone else can shed light on this.

darpesh.
Jim, it would be interesting if you would expand on Transfer Vector.
Jim, it would be interesting if you would expand on Transfer Vector.
Many a times while writing program/applications, one has to decide where to put the checks of certain conditions, inside the method/operation being called or in the program calling that particular method.
For eg.
Suppose there is a method called
public byte[] read(File file)
which reads certain number of bytes from the file and returns the read bytes.
Now before reading the bytes, its desirable that one check that the file exists and the program has permission to access the file.
My question is where is it desirable to put this check, inside the read method or in the part of the program calling the read method.
I might have given the wrong example, but I hope u all understand what I want to mean. That is whether checks be made in the method being called or in the calling program.
How does one decide where to put in the check? Is there some simple guiding principle or rule that one follows??