[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Run time debugging for includes



PureBytes Links

Trading Reference Links

Y --
I agree with you.  Both declaring and initializing variables would help my programming a lot.  It would force me to be more disciplined in my thinking as well as my programming.  But, as you say, it should be optional.  Others who do not need my crutch should not be required to carry it.
-- Keith

jtoth100 wrote:

Hi all,

debugging includes is not easy and handy in any script language. So
instead of making the GUI to reduce clicks my suggestion would be to
reduce possible error cases.

Most errors come from undefined/uninitialized variables. If AFL
language would have an "OPTION" to require definition of all
variables then most common errors could be vanished.
Visual Basic 6.0 never was my favorite language and environment. It
was for average Joe to do basic level programming. It did not require
declaring variable just like AFL or any script language. But I had to
use it years ago. At that time all serious developer started each
module in VB with "Option Explicit On". This caused an error at
parse/compile time if a variable was not defined explicitly but was
referenced anywhere in the code.

How would it help?
Most probles come from just creating variables by assigning a value
to an "identifier". However if you misstype an "identifier" or code
execute in a code path where variable does not get
defined/initialized you get an error. The worst thing is that these
errors are hidden until the rearly executed code path is executed
(typical runtime error). If definition of variables are required even
these code paths are checked for proper variable usage.

This should be an option for advanced users which is turned on on
purpose. So all code out there could run with no change.

Variable assignment and definition could be merged to one statement
like in any modern language (e.g.: var x = 0.5;) This way declaration
is required and initialization can be done as well.

I know it does not guaranty that all runtime error are gone. But with
disciplined coding most can be avoided and the need for debugging is
vastly reduced.

So I would not go for GUI change request but to improve AFL as a
script language.

Regards,

Y



__._,_.___


**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___