08-11-2024, 01:21 AM
I tend to write programs for speed using the tips and tricks learned over the years with QB64 like using DO...LOOP instead of FOR...NEXT and the like.
If those tips/tricks happen to work well with efficiencies like you point out then heck ya, I'm all for them. Your SELECT CASE use above is very ingenious and I'll start using that. I don't seem to able to think outside of the box as far as you do when it comes to clever, but still understandable, optimizations.
One aspect of QB64 I'm trying to use more is the _MEM family of statements for extremely efficient code when working with large data sets, such as images. RhoSigma's image processing library was a huge help in my understanding of how to do this.
Some times I'll come up with very "clever" code, in my mind anyway, that uses very little code to achieve a big outcome. However, documenting that and then coming back to it six months or year later will probably result in, "what the heck was I thinking here?" So if my "clever" code has no efficiency benefit I'll usually break it down to something more understandable for my sanity later on when I revisit it or for someone else that may be looking through the code.
If those tips/tricks happen to work well with efficiencies like you point out then heck ya, I'm all for them. Your SELECT CASE use above is very ingenious and I'll start using that. I don't seem to able to think outside of the box as far as you do when it comes to clever, but still understandable, optimizations.
One aspect of QB64 I'm trying to use more is the _MEM family of statements for extremely efficient code when working with large data sets, such as images. RhoSigma's image processing library was a huge help in my understanding of how to do this.
Some times I'll come up with very "clever" code, in my mind anyway, that uses very little code to achieve a big outcome. However, documenting that and then coming back to it six months or year later will probably result in, "what the heck was I thinking here?" So if my "clever" code has no efficiency benefit I'll usually break it down to something more understandable for my sanity later on when I revisit it or for someone else that may be looking through the code.