ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: The Complete BASIC Optimization Guide

The Complete BASIC Optimization Guide
Posted by Michael on 12 July 2006, 04:47 GMT

Arthur O'Dwyer has recently updated his classic TI-83 BASIC programming optimization guide, The Complete TI-83 Basic Optimization Guide. Version 2 features a wealth of new information regarding all facets of BASIC optimization. After perusing through this latest version for this news article, I would highly recommend it to all serious BASIC programmers. It is certain to mention an optimization trick that you've never thought of.

  Reply to this article


The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.


Re: The Complete BASIC Optimization Guide
kalan_vod  Account Info
(Web Page)

Great work, I will need to check this out. I hope many find it helpful.

Reply to this comment    12 July 2006, 05:27 GMT

Re: Re: The Complete BASIC Optimization Guide
Chipmaster  Account Info

I imagine the section on timings will be very useful: not only for picking between similar functions (ipart( vs. int(), but also for settling disputes. Great job on the guide; I can see that alot of work went into this.

Reply to this comment    12 July 2006, 05:55 GMT

Re: Re: The Complete BASIC Optimization Guide
Snave2000  Account Info

I read the whole thing at one sitting, and I must say that the guide is rather comprehensive. I liked how the author explained the mechanics of some of the optimizations. All in all, great job!!

Reply to this comment    12 July 2006, 06:10 GMT


Re: Re: Re: The Complete BASIC Optimization Guide
kalan_vod  Account Info
(Web Page)

I have read this just now also, and I find it useful also. I have know most of these things through Kenny Hammond (Weregoose), and from experimenting. This guide is very useful and I picked up a few things from it. Great work, and I know this took quite some time and work so I am glad it received the feature it deserved!

Reply to this comment    12 July 2006, 06:46 GMT


Re: Re: The Complete BASIC Optimization Guide
elfprince13 Account Info
(Web Page)

an excellent guide, although I didn't really find any new information. good job nonetheless.

Reply to this comment    15 July 2006, 13:44 GMT

Re: The Complete BASIC Optimization Guide
Person Dude  Account Info

Just in time. It may come in handy now...
I am writing a fishing game in BASIC (I only know BASIC).

Reply to this comment    12 July 2006, 14:39 GMT

What's optimization???
RainbowMonkey Account Info

Is that like which commands are faster, and which ones are better for different things? I'm know most of BASIC, and i'm learning C, but i've never heard of BASIC optimizatoin. Enlightenment would be appreciated.

Reply to this comment    12 July 2006, 15:26 GMT

Re: What's optimization???
Snave2000  Account Info

Well, in this case, optimization mostly means little tricks that save memory, and, on occasion, speed up execution. For example, you can leave off the closing " on strings and do implied multiplication (instead of A*B, do AB, which is faster anyway). One of the tricks I like best is internal subroutines.

Reply to this comment    12 July 2006, 15:51 GMT

Re: Re: What's optimization???
RainbowMonkey Account Info

Oh I see. Thanks, I was pretty sure that was what it was anyways, but I just wanted to make sure in case I missed an extremely helpful download. Is optimization possible in assembly or c? If it is, is it really that much faster since they are both pretty fast to begin with? Thanks again.

Reply to this comment    12 July 2006, 22:31 GMT


Re: Re: Re: What's optimization???
kalan_vod  Account Info
(Web Page)

Anything can be optimized, as it is just improving the code by size or speed.

Reply to this comment    12 July 2006, 23:07 GMT


Re: Re: What's optimization???
yellowPig Account Info

That's the only part of programming on my 83+ that I miss...on the Voyage, you can't do most of that. (Although I much prefer being able to have 8 character long variable names) :)

Reply to this comment    13 July 2006, 03:47 GMT


Re: What's optimization???
Peter Fernandes  Account Info
(Web Page)

Is that like which commands are faster, and which ones are better for different things? -->> None are faster than good C equivalents, and none are good for any things. Learn C. :)

Reply to this comment    13 July 2006, 15:20 GMT


Re: Re: What's optimization???
Snave2000  Account Info

I quote: "None are faster than good C equivalents, and none are good for any things. Learn C. :)"

Correction: ASM is the fastest. It will beat C hands down every time (though some compilers *can* generate extremely efficient code, on occasion). Since the Z80 ASM language is relatively easy to learn (compared to that of, say, the Pentium IV (possibly one of the worst chips ever designed in terms of cooling, by the way)), I say: learn ASM :-)

Reply to this comment    14 July 2006, 16:19 GMT

Re: The Complete BASIC Optimization Guide
anykey  Account Info
(Web Page)

This is nice! Basic is a language that requires mess optimizations like this to make anything good. Until now, not many of them have been formally documented. Good work!

Reply to this comment    12 July 2006, 16:15 GMT

Re: The Complete BASIC Optimization Guide
jhamm Account Info

Finally updatement!

This news still doesn't apply to me! WAAAAAAAAAAAAAAAH!

Reply to this comment    12 July 2006, 17:49 GMT


Re: Re: The Complete BASIC Optimization Guide
Kevin Ouellet Account Info
(Web Page)

I thought ticalc.org stopped featuring basic stuff tho, at least thats what someone told me. It might apply only for games tho. Nice tutorial anyway it will help us, even me maybe (I am still learning new stuff >.<)

Reply to this comment    13 July 2006, 00:30 GMT


Re: Re: Re: The Complete BASIC Optimization Guide
jhamm Account Info

You're right, the stuff is helpfull for what i've seen. The only problem is that i'm a 68k calc person, but still, the BASIC languages are similiar so this news kind of does apply to me.

r=1-sin(theta)

Reply to this comment    13 July 2006, 02:30 GMT

Re: The Complete BASIC Optimization Guide
Matthew Baron  Account Info
(Web Page)

I read this when it was first uploaded, and was very impressed with how thorough the guide was. Very good for anyone!

Reply to this comment    12 July 2006, 19:06 GMT

Re: The Complete BASIC Optimization Guide
calc84maniac  Account Info

This is amazing! I had no idea that you could assign a string to a list! Thanks a lot!

Reply to this comment    12 July 2006, 19:51 GMT


Re: Re: The Complete BASIC Optimization Guide
something1990 Account Info

That's what I love about this guide. It's not just another guide that just tells you to remove end parentheses and quotation marks and tells you implied multiplication and all that old stuff. It really demonstrates great optimization techniques with many different data types. That string to list thing really helped me streamline my stat sprite code. You can do something like "augment(L1+A,L2+B->L5 and "augment(L3+C,L4+D->L6, do Plot1(Scatter,L5,L6,dot , and all you have to do next is update A,B,C,D and do any draw command. The guide is full of speed-optimization techniques like this.

Reply to this comment    14 July 2006, 17:25 GMT

Re: The Complete BASIC Optimization Guide
Brian Lott Account Info

yes!

there is still hope hor peopel who want to write efficiently. I am getting tired of people writing bloatware. Thank you for writing this!

Reply to this comment    12 July 2006, 21:27 GMT

Re: Re: The Complete BASIC Optimization Guide
yellowPig Account Info

I know what you mean; I was looking at the code for a BASIC trisolve program, and I saw (2*A*B*.5) in the middle somewhere.... :(

Reply to this comment    13 July 2006, 03:50 GMT


Re: Re: Re: The Complete BASIC Optimization Guide
Brian Lott Account Info

that's bad.

I hate seeing people put an equation on multiple lines.

:A^2+B^2->C
:C^0.5

:'(

Reply to this comment    13 July 2006, 18:47 GMT

Re: Re: Re: Re: The Complete BASIC Optimization Guide
Matt M Account Info

same here, although if you then needed to do "Disp C", or "C+A->X" it would be more efficient on 2 lines.

Reply to this comment    13 July 2006, 20:40 GMT

Re: Re: Re: Re: The Complete BASIC Optimization Guide
yellowPig Account Info

Actually, I have occasionally done that, if I have to be able to show my work on a timed test.... ;)

Reply to this comment    14 July 2006, 04:05 GMT


Re: Re: Re: Re: The Complete BASIC Optimization Guide
Inquit Account Info

Usually that's a bad thing to do, however... if your equations start containing tests and many, many variables - say you want to use one equation to define whether or not a move is illegit in a game of chess - then you may want to separate the equations into multiple lines. Takes more space (though if you write efficiently, not too much of it either), but can save many a bug.

----------

On a side note, has anyone ever considered storing a world (which is entirely based around an object existing or not existing at any given location) into a list two-dimension list?

The code wouldn't be fast (because large world require lots of work retrieving the data by int( and log( expressions) - but it would be very economical with space.

Reply to this comment    15 August 2007, 11:46 GMT


Re: Re: The Complete BASIC Optimization Guide
Matt M Account Info

and that is my problem with computer software. now it seems like all programs are big and slow -- I think microsoft assumes everyone has high speed internet with their 20+MB updates. and software is getting bigger and slower since it's designed for newer computers.

Reply to this comment    13 July 2006, 20:38 GMT


Re: Re: Re: The Complete BASIC Optimization Guide
burntfuse  Account Info
(Web Page)

Sorry for this being off-topic, but you should try Red Hat 9, which runs fine on my dual-450 Mhz PII machine, or even the latest version of Knoppix, which despite having the latest kernel and KDE version AND running completely from the CD, which slows everything down anyways, ran slowly but wasn't unusable on a 350 Mhz PII with 196 MB of RAM (at least until I tried installing an icon theme through the control center - then it froze).

Reply to this comment    14 July 2006, 14:31 GMT


Re: Re: Re: Re: The Complete BASIC Optimization Guide
Matt M Account Info

well...I can't really switch OS's because I use my laptop for college...and they have to approve the configuration for their network...but I do occationally use INSERT (for UBCD) when I have boot trouble.

The college recommends everyone upgrade to XP Pro and Office 2003 Pro...I don't want to and won't unless absolutely neccesary.

I only just upgraded from XP Home SP1 to SP2...I'll stick with Office XP Pro as long as it works...

Reply to this comment    15 July 2006, 00:18 GMT


Re: Re: Re: Re: Re: The Complete BASIC Optimization Guide
burntfuse  Account Info
(Web Page)

>The college recommends everyone upgrade to XP Pro and Office 2003 Pro

Ugh, I hate it when they try to make everyone buy the newest versions of Microsoft's products even if what they have works fine for them.

Reply to this comment    15 July 2006, 17:51 GMT


Re: Re: Re: Re: Re: Re: The Complete BASIC Optimization Guide
Snave2000  Account Info

Basically, that's the configuration they want you to have, and if you encounter any "problems" (i.e. the network is configured for one and only one version of the OS, or something equally <insert favorite derogatory description here>) because you aren't using their "recommended" configuration, they tell you to upgrade before they even try to help you...

Reply to this comment    17 July 2006, 15:41 GMT

1  2  3  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2011, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer