31 comments

[ 3.0 ms ] story [ 74.8 ms ] thread

     I almost forgot—the IF statement is an expression! You can do the following:

     A ← IF B = 15 THEN 40 ELSE 99
     and A will be 40 if B is 15, otherwise A will be 99. There aren't many languages I've used that have allowed this
I need to introduce this man to the wonderful world of Haskell, Erlang, and other Functional Programming Languages.
Verilog has a conditional operator ?:

condition ? value_if_true : value_if_false

It is used quite extensively in ASIC design.

Python also lets you do this, definitley a nice bit of sugar

``` In [2]: b = 15; In [3]: a = 40 if b == 15 else 99; In [4]: a; Out[4]: 40; ```

and PHP

``` $a = $b == 15 ? 40 : 99; ```

Clojure: (def a (if (= b 15) 40 99))

Also: (def a (cond (= b 15) 40 (= b 20) 50 :else 99))

Why is this desirable? It saves maybe half a dozen keystrokes in exchange for less readable and thus less maintainable code.
On the 2600 if it saved you a byte or two it was a big win. Remember your program had to fit in 64 bytes of memory. Not kilobytes, single bytes. And your numbers are BCD encoded, so they're extra inefficient.
If expressing a conditional costs you more than 1/64 of your storage I'd say the storage is pretty useless for storing code.
Nobody has ever accused Atari Basic of being good.
That's very confusing as other BASIC dialects had used the same syntax in lieu of GOTO. `IF B = 15 THEN 40 ELSE 99` would be equivalent to `IF B = 15 THEN GOTO 40 ELSE GOTO 99`.
It's identical to the ternary operator (for most c like programming languages)
To say nothing of Lisp. Or C with its ?: operator.
What language does not have a form of a conditional expression?
Is there a popular language today that doesn't have conditional expressions?
I'm not sure it's fair to compare a language from 1979 to one from "today." Especially one that fit an entire IDE into 4,096 bytes.
> I'm not sure it's fair to compare a language from 1979 to one from "today." Especially one that fit an entire IDE into 4,096 bytes.

I think it is fair to treat a “not many languages I've used...” comment about a language feature from a 2015 review in the context of current (or, at least, available in 2015) languages, even if the review is of a 1979 product.

Misses "2015" in the title I guess.
Okay, so we have the common trope of "Atari 2600 BASIC was horrible" (and it was), and now "meh, it wasn't that bad". But it seems the only people that actually used the cartridge for more than five minutes are the two groups writing those things. What I want is, "How I Used the Atari 2600 BASIC Cartridge to Do Something Useful". 64 bytes ought to be enough for anyone, amirite?

Seriously, did anyone who bought one do more than plug it in and become very disappointed?

I did not buy it. I traded Night Driver for it (and the paddles). 1980? And yeah, not to put too fine a point on it, just... no.

But, given the replay-ability of Night Driver, still a fair trade.

I think piquing an interest in computer programming for of millions of kids was useful. Millions of kids didn't get the cart, but it certainly made them think about using electronics for more than games.

I'm not sure the BASIC cart was intended to be "useful" as in "productive." I think it was supposed to be a demonstration to young people that they could make a machine do things for them.

I actually cut my teeth with it in 1981 as a child. I liked it enough that I graduated to an TRS-80 programming class at age 9. I owe my fondness to coding from that BASIC Cartridge. Funny enough, I was about to donate it with controllers soon.
Might I recommend the Color Computer for BASIC programming as an example of a highly useful and powerful version that's still being used today to create new games for the system, as well as a simple programmatic access to the peripheral interfaces.
Even the ZX80 / 81 had far more usefulness than Atari BASIC.

People wrote video games for it. Puzzle games like Black Box, board games like Chess (yes, I know the 2600 also had Chess, but you couldn't develop a Chess program on the platform itself).

It's pretty useless for all but trivial programs, but "BASIC Programming" is nevertheless really interesting -- both for what it achieves in a tiny RAM space, and as existence proof that the 2600 is capable of being programmed, and is thus a computer.

I also love the box art -- a 1970s future man, like something out of Logan's Run, twiddling controls on what looks like a very important, sophisticated console, possibly in space, promising much more futuristic awesomeness than the cartridge could ever possibly deliver.

The Atari 2600 BASIC cartridge -- holds a special place in my heart!

You see, as a child possessing the 2600 console in the 1980's -- I never possessed that specific cartridge...

But, oh did I want to!

But now the $64,000 question... WHY?

You see, every other cartridge for the 2600, every other cartridge,

WAS A GAME !!!

But the BASIC cartridge?

It was the one cartridge, the one cartridge out of hundreds, perhaps thousands that existed at the time -- THAT WAS NOT A GAME !!!

In other words, no matter how crappy it was, no matter how many bad reviews it got (and it got plenty of bad reviews and negative feedback even back in the 1980's!) -- it was the one PATTERN BREAKER -- in other words, it was the one cartridge that did not fit the mold/template/class/parameters/specifications/purpose/intent (use whatever terminology you prefer!), etc. -- of all of the other cartridges, of which all, were GAMES...

Because it wasn't a game and thus broke the pattern of all cartridges released up until that point in time -- IT CAPTURED MY ATTENTION!

Now, even though I encountered much better BASICs later on (most notably PET, VIC-20, COMMODORE-64, AMIGA and PC BASICS), and even though, beyond BASIC, I went on to be a programmer later on in life in other more complex languages, the 2600 BASIC Cartridge STILL holds a place in my heart -- if for no other reason than IT WAS DIFFERENT, IT WAS RADICALLY DIFFERENT -- than all of the other cartridges released both before and after it!

That is, it was a PATTERN BREAKER -- an anomaly, a singularity, a "Googlewhack"; call it whatever you will...

Now, on a broader note -- that same pattern of investigating things that seem alien, wierd, or out-of-place, in a variety of contexts, in a variety of disciplines -- has made all of the difference in my life, and to a large part, makes me what I am today...

And the Atari 2600 BASIC cartridge -- was one of the first things that stood out to me as "matching the above pattern" (of my life!), by simply "not matching the existing pattern" (cartridge/gamewise! <g>).

Ah, there's a future essay or blog post here! <g>

> But the BASIC cartridge? It was the one cartridge, the one cartridge out of hundreds, perhaps thousands that existed at the time -- THAT WAS NOT A GAME !!!

What about ET? Pretty sure that was some form of proto high-tech torture device. Certainly not a game.

That bit about it stepping through evaluation of a formula is interesting to me. I've never seen an IDE offer that before, and it'd sure be useful sometimes.