Silverfrost Forums

Welcome to our forums

Programming question

8 Jun 2012 3:32 #10292

This is a general programming question not a fortran question.Can anyone help?

Please can anyone explain me the ,menaing of this statement?

*Are function parameters explicitly verified in the code? *

Can anyone explain through an example? I was eading a check list for a good code and found this.

Christy

8 Jun 2012 9:20 #10297

I suspect it means that you should use a language or compiler that is capable of checking function arguments are used correctly. It is always good practice to get the compiler to check this if you can.

9 Jun 2012 1:52 #10299

This could also be from a list of things to be done when coding a function, eg does ASIN have code to check if the argument is in the range -1 to +1, otherwise report an error. Asks the question : How should a function report an error ?

9 Jun 2012 7:20 #10302

Could this mean the following?

I have a function with x number of arguments.

SO, the programmer should debug and see that every argument has a realistic value.It might so happen that he might have sent arguments to the function from the calling routine which are not used in the function and hence have junk values as they are not declared.

Could this also be an interpretation of that sentence:

Are function parameters explicitly verified in the code?

Christy

10 Jun 2012 4:34 #10307

People mostly answered your question but you can try to find more answers in this table which summarizes what compilers check in subroutines and functions. http://www.polyhedron.com/pb05-win32-diagnose0html

10 Jun 2012 9:48 #10310

Very interesting presentation of the available compilers! When it comes to checking FTN95 is the best - and this is may experience as well.

10 Jun 2012 8:16 #10312

... and if Polyhedron printed the compile time, that might be an interesting statistic.

Please login to reply.