Coding Constructs

Have some feedback and input to share?
Don't be shy and drop us a note. We want to hear from you and strive to make our site better and more user friendly for our guests and members a like.
Post Reply
TerryB1
Posts: 306
Joined: Wed Jan 03, 2018 11:58 am

Coding Constructs

Post by TerryB1 »

I don't know if the following has any value in an XSharp environment, but just in case:

Some coding constructs in C# can be used for more that one purpose. For example the try/catch constructs.

Used to catch errors - fine, but the point is such errors may be genuine, unexpected errors, or expected errors used for a specific purpose.

It is the case that program code (managed) can be simplified, and made statistically more efficient, if pre-checking for errors is ignored on the basis that if, and only if, an error is raised, does it need to be rectified.

Communicating this via program code could be simple: instead of try/catch, a simple alternative option guess/if wrong, would suffice.

In the short term this would, I think, help developers to better understand their code in the future.

In the longer term it would make automated checking of code integrity, automated ensurance of documentation accuracy and possibly other things, easier to implement.

Just a thought - but based on what I know and have proved to be feasible. (I realise you may have such constructs already)

Terry
Post Reply