EnableExplicit on by default.

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Rescator
Addict
Addict
Posts: 1769
Joined: Sat Feb 19, 2005 5:05 pm
Location: Norway

EnableExplicit on by default.

Post by Rescator »

Any chance to make EnableExplicit on by default?

Those who wish not to have it on could get a DisableExplicit or a flag in the IDE options.

Reason for this is that I always end up having to put EnableExplicit in my code anyway ;)
It would also reduce the number of false bugreports. :)
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Not everybody likes EnableExplicit ;)
quidquid Latine dictum sit altum videtur
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Save me from EnableExplicit! :?
BERESHEIT
Prod
User
User
Posts: 14
Joined: Thu Mar 31, 2005 3:47 pm
Location: Denmark

Post by Prod »

Totally love it, make it an option in Preferences.
User avatar
pdwyer
Addict
Addict
Posts: 2813
Joined: Tue May 08, 2007 1:27 pm
Location: Chiba, Japan

Post by pdwyer »

Prod wrote:Totally love it, make it an option in Preferences.
+1

That way there is no impact on others but people can still make it their default
Paul Dwyer

“In nature, it’s not the strongest nor the most intelligent who survives. It’s the most adaptable to change” - Charles Darwin
“If you can't explain it to a six-year old you really don't understand it yourself.” - Albert Einstein
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

No need for an option, just type it yourself, or have a blank source file with
it at the top for creating new sources. :roll:
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I prefer it off.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Prod wrote:Totally love it, make it an option in Preferences.
That would break code sharing.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

It wouldn't break code sharing, because you can use Define without it. ;)
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 »

What I mean is that if you copy some code from the forum, it may not compile because it assumed enableexplicit off. Obviously you can add defines to the code, but its best if it works straight away. The people who don't use enableexplicit may not bother to add defines for someone else.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

I wouldn't dare code without the help of enableexplicit! It's a must with complex projects inmo. :)
I may look like a mule, but I'm not a complete ass.
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 »

Code from other without declared variables comes never in any of my
programs. I add this by myself or ignore the code. To many work if i have
on error. Value of my variables overwritten from an include, horrible.

Code without declared variables (EnableExplicit) is useless for other
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
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

Trond wrote:What I mean is that if you copy some code from the forum, it may not compile because it assumed enableexplicit off. Obviously you can add defines to the code, but its best if it works straight away. The people who don't use enableexplicit may not bother to add defines for someone else.
and what?

if it is mocked because I have Explicit default on, I change the compileroption to see it running, or quickly add a "DisableExplicit" to the top of the code...


@topic

I almost always use EnableExplicit.

... but I don't care if it was default or not.
it's just [e] [n] [down] [down] [enter] = 5 keystrokes to put it into the code.
oh... and have a nice day.
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 problem is not EnableExplicit, the problem are the not declared variables.
I can ignore this Keyword, but i can't ignore variables declared on the fly,
this give unforeseeable results included in other sources.

But for your own code only for yourself, you can ignore this feature and
have more fun on error trapping :mrgreen:
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 »

I use it for large projects but I prefer it off for testing/fun/small apps. It's not absolutely necessary for everything I write.

-1 for this.
Post Reply