I use EnableExplicit for virtually everything I code BUT making it the default creates one more hurdle to overcome by complete beginners to the language.
Traditionally one of the big features of Basic is that beginners can ignore all code housekeeping/declarations and still get simple programs to work. [The only major way in which this is not supported by PureBasic is that 1-D arrays (vectors) whose maximum subscript is 10 or less have to be DIMmed, but traditionally this did not need to be done.]
Making EnableExplicit the default would be another departure from this tenet of simplicity.
I agree that a default for Disable/Enable Explicit should be settable in the options/preferences provided:
1. In a brand new installation the option should initially default to DisableExplicit (for the reason mentioned above).
2. The default Disable/Enable Explicit should NOT be be one of the editor settings saved at [for example] the end of a source file. Otherwise the compiler could default to a Disable/Enable Explicit state that you would be unable to predict.
A IDE Option for default setting is a good idea, i would use it. I never write
one line code
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
ts-soft wrote:A IDE Option for default setting is a good idea, i would use it. I never write
one line code
But akj has a point:
akj wrote:The default Disable/Enable Explicit should NOT be be one of the editor settings saved at [for example] the end of a source file. Otherwise the compiler could default to a Disable/Enable Explicit state that you would be unable to predict.
However, if it were an IDE-only setting then I think it would be ok. Writing something using EnableExplicit won't break when someone uses it without. And if you've enabled it in your IDE and code won't compile then it should be expected that you know how to handle it.
The Editor-Settings should only work if nothing set in the source.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
I doesn't use any Define, i have only one word outside a Procedure
Okay, some shared vars a declared
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
> If it you have no problem putting 'Define' before every single variable,
> why is it such a big deal to put a single 'EnableExplicit' in the source ?
That's an awesome point! There's no comeback to that.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak wrote:If it you have no problem putting 'Define' before every single variable, why is it such a big deal to put a single 'EnableExplicit' in the source ?
It's because they think EnableExplicit enables the porn and violence mode, and they don't want their bosses to see that. It's more discreet if the option is hidden in the preferences window.