Recommendation: use strict
BlitzMax Forums/BlitzMax Programming/Recommendation: use strict
| ||
Trust me, use strict. Even if you only turn it one once, clean up the errors, and turn it off again. I'm converting a bunch of old Blitz code that seemed to work perfectly fine - and strict has uncovered 3 bugs so far that I never noticed before... |
| ||
Nice! |
| ||
lol. Yeah, I've seen a number of bugs in code people hae postd that didnt cause a crash or malfunction but caused bad efficiency. Could have been prevented with strict. |
| ||
Or better yet, make strict the default, and make people have to declare "nonstrict"! :) |
| ||
I think that in the bigger picture it's good to give people the option to choose for themselves whether they want something to be `enforced` or not. Just making strict be a default that can't be turned of is, to me, offensive. I would of course have to play along but reluctantly. I also don't think it is always necessary. It might be a good recommendation for newbies to help to produce better code. But as always, what suits one person doesn't suit them all. I prefer that they've given us the option of freedom. |
| ||
Strict always helps, it never hurts. |
| ||
Strict always helps, it never hurts. Until you need to use 'Goto' within several nested For-Next loops eh Warren :P Good idea to use it as a temporary debugging method though, I'll bet there is quite a bit of old BB code out there containing a multitude of passive bugs that Strict would've prevented. |
| ||
Until you need to use 'Goto' within several nested For-Next loops eh Warren :P Yeah, that sucks, but it's like taking a sports car back to the dealership because you don't like the color of the ash tray. |
| ||
Strict is good, but I think we need more options than just strict. It will allow people to program more in the manner they are most comfortable with. Something like strict declaration, strict case, and strict basic. You'd be able to combine them so you could force people to declare variables in the same case and not use old basic style programming. Or vice-versa. Programming in a stricter manner could lead to faster code for those who care. |
| ||
Faster? Why would it be faster? Perhaps faster compilation. Not faster execution. |
| ||
Even though I know you know the answer, for completeness anyone else can look on this thread for comments from Mark as to why strict can produce faster code. I still think we need more compiler options anyway by the way :P |
| ||
I think it's because strict doesn't have to allocate variables it doesn't come across, whereas non-strict code has to allocate everything "just in case" or something along those lines. So it will run faster, but I doubt it makes enough of a difference to really matter all that much. |
| ||
Kind of, but also because you'll require less support instructions for some of the features you can't use. I'm guessing that strict would use some assembly code routines that are more efficient and shorter than non-strict because you have less surprises to expect. It's like with some other compilers you have the option to for example drop array bounds checking, which can speed things up a little if your code is well behaved. You're right though, it'd be unlikely to make that much of a performance difference but it may become more important as the compiler matures. |