EnableExplicit on by default.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

This would have been more interesting, if you had added a poll. :)

Personally, I always use EnableExplicit (+1 for this request),
unless I test small codes from the forum (-1 for this request).

±0
PB 4.30

Code: Select all

onErrorGoto(?Fred)
akj
Enthusiast
Enthusiast
Posts: 668
Joined: Mon Jun 09, 2003 10:08 pm
Location: Nottingham

Post by akj »

-1 to EnableExplicit always being the default.

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.
Anthony Jordan
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Post by luis »

srod wrote:I wouldn't dare code without the help of enableexplicit! It's a must with complex projects inmo. :)
Same here.

To be honest I started to use PureBasic when the option has been added.

It was the only gigantic massive obstacle between our love. :roll:

Anyway, I find it ok as it is.

Default off, for relaxed programming of simple snippets to test 5 - 10 lines of code.

On by request, for real programming.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

I use it, but this seems like a lot of discussion for what amounts to (maybe) 1 line of code in the program.

Personally, I'd rather have them make changes that were slightly more important.

cheers
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

A IDE Option for default setting is a good idea, i would use it. I never write
one line code :wink:
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.
Image
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

ts-soft wrote:A IDE Option for default setting is a good idea, i would use it. I never write
one line code :wink:
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.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

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.
Image
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

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 ? :mrgreen:
quidquid Latine dictum sit altum videtur
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

I doesn't use any Define, i have only one word outside a Procedure :mrgreen:
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.
Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> 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 ? :mrgreen:

:lol: 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.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

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 ? :mrgreen:
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.
SCRJ
User
User
Posts: 93
Joined: Sun Jan 15, 2006 1:36 pm

Post by SCRJ »

LOL @Trond :lol:

Would be nice to use EnableExplicit by default (+1),
but it's not necessary (-1), so

+0^^
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Post by Poshu »

Would be nice since more PB user would use it (and, common, enableexplicit is a MUST). +1
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

EnableExplicit is essential for any serious PB program you write.
--Kale

Image
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> EnableExplicit is essential for any serious PB program you write

Depends on your skill level and how you name your variables. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply