# Programming Tips

**URL:** <https://boards.straightdope.com/t/programming-tips/230803>\
**Category:** Miscellaneous and Personal Stuff I Must Share\
**Created:** [February 24, 2004, 1:33am UTC](https://boards.straightdope.com/t/programming-tips/230803 "2004-02-24T01:33:57Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![iampunha](https://avatars.discourse-cdn.com/v4/letter/i/74df32/32.png) [@iampunha](https://boards.straightdope.com/u/iampunha)\
**Post date:** [February 27, 2004, 3:42am UTC](https://boards.straightdope.com/t/programming-tips/230803/21 "2004-02-27T03:42:59Z")

</div>

You might try (and this will require either a lot of trial and error or finding someone who knows how to make TI-8X matrices play nice) storing said variables in a matrix. Since you don’t use matrices a lot until probably algebra (and even then only with systems using them to solve by inverse matrix method), and after that not much until linear algebra (which you probably won’t be able to get until college), the odds of you accidentally saving over same matrix with one from, say, your homework, are fairly slim.

---

<div class="post-metadata">

**Author:** ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)\
**Post date:** [February 27, 2004, 4:45am UTC](https://boards.straightdope.com/t/programming-tips/230803/22 "2004-02-27T04:45:56Z")

</div>

> [@dwalin](#):
>
> Well, first I’m going to finish the game I’m working on now, all several stages of it, then I think I’ll probably do **Thrasymachus** ’ PQ-esque game, and then I’ll try that game again.

Okay, one more tip if you want to do an adventure game. I said text output would eat up memory, but so will input! So learn and be able to use the **Menu** command. One time I tried to play a game (what it was I don’t remember) where the programmer had set something up like “Pick 1 for Hit, 2 for Spell, 3 for Flee” and then used an **Input** statement. Clumsy! Especially when there’s something built in that handles just that. My games tended to just use the arrow keys and **getKey** , but I did use **Menu** once or twice.

---

<div class="post-metadata">

**Author:** ![Captain\_Carrot](https://avatars.discourse-cdn.com/v4/letter/c/f0a364/32.png) [@Captain\_Carrot](https://boards.straightdope.com/u/Captain_Carrot)\
**Post date:** [February 27, 2004, 10:47pm UTC](https://boards.straightdope.com/t/programming-tips/230803/23 "2004-02-27T22:47:25Z")

</div>

I LOVE Menu!!! It’s so much simpler than If-Then and it can fit more text. I also love Text and String, which allow me to write several sentences on one screen, and require a password for each level of my game. There are probably other uses for String, but I don’t know what they are yet.

I got a QBasic compiler online; are TI-BASIC and QBasic very similar?

---

<div class="post-metadata">

**Author:** ![TPWombat](https://avatars.discourse-cdn.com/v4/letter/t/bbce88/32.png) [@TPWombat](https://boards.straightdope.com/u/TPWombat)\
**Post date:** [February 28, 2004, 12:12am UTC](https://boards.straightdope.com/t/programming-tips/230803/24 "2004-02-28T00:12:32Z")

</div>

> [@friedo](#):
>
> Here’s a useful tip for you people working in languages with C-derived syntax:
> 
> When comparing a variable against a constant for equality, put the constant on the left. e.g.:
> 
> ```auto
> 
> if (0 == x) { 
> ...
> 
> ```
> 
> That way, if you’re in a caffeine-adled brainfart at 4AM, and you accidentally use an assignment operator instead of a comparitive operator, you get a far more useful compiler error instead of a bizarre mysterious “hmm, this isn’t working right” error.

That is frickin’ briliant. Thanks 🙂

[Previous page](https://boards.straightdope.com/t/programming-tips/230803.md?page=1)
