03-13-2010 02:22 PM
Hi,
please verify my answers for the following questions
1.comments should be added to the block diagram.
a. to describe every function
b. to describe the basic functions
c. to describe unfamiliar functions
d. comments are unnecessary as labview automatically adds them.
2.Which of the following functions should be used the replace an element of an existing cluster when the order of the elements in the cluster is unknown
a. Bundle
b. Unbundle by name
c. unbundle
d. bundle by name
Ans
1.c 2.b
Regards
Lavanya
03-13-2010 03:19 PM
1 is c like you said.
2 is d. Unbundle only breaks apart the elements. Bundle puts them together or replaces values in a cluster. And by name is what you want since you don't know the order.
03-13-2010 11:41 PM
I don't know what the official answer to 1) is, but I disagree that c is correct. Two months after you write a program, every function will be unfamiliar. So each fucntion should have comments.
And there should be a lot more comments than just functions. For example, if you multiply 23.324234 times 2, you shouldn't have a comment saying you are multiplying 23.324234 times 2, but you should explain why you are doing that. Otherwise you may remember why you did that (doubtful) but no-one maintaining your code will know why you did that.
Chuck
03-14-2010 12:57 AM
So are you saying it should be A or B?
I certainly can't agree with A. It is a waste of time to comment on every function.
Possibly it could be B, but it depends on what you define as a basic function. I think any function that is "basic" doesn't need a comment because you should already know what it is, or can easily look it up in context help. If you need to comment a function because you are such a new beginner that you don't know what it is, that's fine. But in general, I don't think you need to comment on something that a LV programmer with reasonable experience should know, or that you could easily look up.
I definitely agree with you that the comments are most important, not so much for "functions", but to describe sections of code where it isn't immediately obvious why you are doing what you did.
I guess, I'm curious as to what the "official" answer is. I'm still sticking by C. But I can easily consider this one of those bad, nebulous CLAD questions.
In general, if you are uncertain whether to place a comment or not, then it is best to err on the side of placing too many comments rather than too few.
03-14-2010 03:46 PM
I too agree with Ravens Fan, we have forced to select option C.
NI offcials, can you help us?
03-14-2010 04:07 PM
First one is c;
and the Second one is d;
I think the first one is c due to the fact that "answer a" would incorporate unfamiliar and basic components of your program, so what is basic to you, you don't need to comment, but the unfamiliar concepts should be documented (in other words in a month or year or ect.. You won't forget how to do basic programming practices in labview), but also in the other direction (as in C is incorrect) other people may have to read your code/edit it, and may not feel that there is sufficient commenting due to their own skill set in labview.
03-15-2010 02:04 AM
Hi lavanya,
For the first question,the answer will be option C,For the second question the answer will be option D.For a cluster if we use unbundle function it will give only the data type of every elements in the cluster,if we use bundle by name function we will know exactly the index of each element.
Thanks and regards,
srikrishnaNF
03-15-2010 02:46 AM
1.c
2.d
03-15-2010 05:27 AM
I also agree with 1) c and 2) d. The explanation fo 2nd is clear as explained by muks. Regarding the first question, the arguments given abouse are plausible but both a and b have some negative connotations attached to them. Nobody will expect an answer like :
comments should be added to the block diagram to describe every function OR
comments should be added to the block diagram to describe the basic functions.
d is absurd. So by elimination c is the only possible answer. Although I agree its a stupid question.
Regards,
Shivam Awasthi