do you use strict?

BlitzMax Forums/BlitzMax Programming/do you use strict?

Najdorf(Posted 2005) [#1]
I thought strict was for suckers, then I started to mispell variable names and searching for them everywhere, so I think I'll go strict ;-)


N(Posted 2005) [#2]
I use it on everything.

Edit: Correction. Everything but tests to see if I'm doing something that works before I go ahead and write an OO-ified implementation of the idea.


Sarge(Posted 2005) [#3]
Same here, but sometimes i dont.


Paul "Taiphoz"(Posted 2005) [#4]
i use it all the time.


Dreamora(Posted 2005) [#5]
I use it all the time as BMs behavior is different without strict (variable scopes etc)


amonite(Posted 2005) [#6]
Unless i'm using labels and gotos, yes Strict is useful.


FlameDuck(Posted 2005) [#7]
What Dre said.


Filax(Posted 2005) [#8]
I use it all the time.


Perturbatio(Posted 2005) [#9]
I use it almost all the time. It's very handy.


Muttley(Posted 2005) [#10]
Yeah, I always use Strict. Saves so many problems.

Muttley


ziggy(Posted 2005) [#11]
I use it all the time, and I think it should be by default. I would preffer a RELAXED keyword (for lazy programmers or very small programs), than a STRICT keyword for BMX file. :)


dynaman(Posted 2005) [#12]
always, my personnal opinion is that not using it is for suckers. Much better to have the compiler tell me I'm a bad typist rather then having to find a logic error.


Tibit(Posted 2005) [#13]
What's the point of a RELAXED or LAZY command if you have to type it =)


EOF(Posted 2005) [#14]
After I get the program at finished stage I go Strict. It's suprising how many loose ends turn up.

Are you guys using Framework as well?


N(Posted 2005) [#15]
No, as I'd save writing up the code to use Framework until I was done writing the application and felt nothing else had to be done. So basically, I'd only use Framework for the RC.


Najdorf(Posted 2005) [#16]
What's the point of a RELAXED or LAZY command if you have to type it =)


Everyone looked at me when I laughed out loud in the computer lab.


BTW, do you use globals? Sice I got object orientation, I decided NOT to use globals at all


Dreamora(Posted 2005) [#17]
globals can be used within types as well (then they are quite the same as static in C++) :)


N(Posted 2005) [#18]
Here's a handy use of globals:




Hotcakes(Posted 2005) [#19]
Globals should be kept to a minimum. Local variables are much faster.


Dreamora(Posted 2005) [#20]
Thats true. But global to create type handling list structures (to have a way to say when to destroy an element) are just great :)

Or for instance counters.
beside that you are right, normally for stuff like noel did with the ARB anyone would use const, not global :)


RexRhino(Posted 2005) [#21]
Strict is definitly the way to go. Saves SO MUCH trouble in the long run!


N(Posted 2005) [#22]
normally for stuff like noel did with the ARB anyone would use const, not global :)


You're... insane?

You can't set constants at runtime, Dreamora. In order to see if a video card supports the extensions, you have to check them at runtime.


Dreamora(Posted 2005) [#23]
ah, you're right
but why didn't you use field instead of global? as you use them on instance base anyway due to method new, it would do the job as well :)

( or replace new with a function init () that does the same)


N(Posted 2005) [#24]
So I could do GlHelper.GL_ARB_vertex_buffer_object>0 anywhere in my code without having to create a new instance of the type prior to that.

If it ends up kicking me in the face speed-wise I'll obviously move it to some other means of storage, but thus far I've had no problems.


Dreamora(Posted 2005) [#25]
thats why I put the (..) stuff in :)
I've a similar controlstructure in my particle system which is fully based on Type - Function, Type - const and type - global :)


PowerPC603(Posted 2005) [#26]
I use Strict in most of my code.
I'm developing some modules for my game (it's not going great, because I lack some inspiration and I don't seem to find the perfect structure for it) and I'm using strict in all those modules.
Only for testing those modules with a separate bmx-file, which imports the module, I'm not using strict.