Better Coding Suggestion

Blitz3D Forums/Blitz3D Beginners Area/Better Coding Suggestion

The only big issue is that you don't have any error checking for the case where you run out of elements in your array.

Style-wise: indentation, descriptive variable names. You'll probably get less feedback on code that isn't indented reasonably because most programmers won't like reading it. Good variable names are critical to readability. Change axo to "done" or "is_done" or "loop_done"; never name a variable a random collection of letters and numbers.

note- axo means nothing just turn to 1 to term loop?? faster?


That's micro-optimization. Don't even think about that. It's fine the way it is. Personally, I would make both loops infinite and Return from within them - but that's purely a style choice. Some people don't like functions which return from the middle. Whatever is simpler and more readable to you is what you should go with.

If you're seriously worried about efficiency, you could (a) reuse the freed element in DeleteAlsohere() instead of doing a linear search for a free element after having erased one and/or (b) replace your array with a linked list. But you shouldn't be worried until you can prove that these things are actually costing you performance.