• Please review our updated Terms and Rules here

Coding and computer logic for a complete beginner

I never hit a wall; I did some incredibly complex stuff in BASIC. Speed and size of course neccesitated the use of ML routines within BASIC programs, however. I still use my assembler which runs in BASIC to this day. I wrote text editors, word processors, databases, and large games in BASIC.

The only reason I switched to Pascal was that I had switched to the MS-DOS platform. I hated QBASIC, and switching to a different BASIC was not an option for me. I used C for a very short while but quickly abandoned that for Pascal, where I found I could do everything I could do with C, only much easier.

My knowledge of BASIC eventually helped in my careers (in the past). I used Visual BASIC a lot over the years, and BASIC Stamp. If I hadn't already known BASIC, I would have needed to learn both of those anyway.

As to the OP, what are the old machines? If any of them are the type that come with built-in BASIC (excepting the IBM PC/XT/AT/PS/2 series'), BASIC is almost mandatory. If they run CP/M or MS-DOS, Pascal really is the way to go.
 
It isn't that complicated things can't be done is Basic, it is more that it
is often of little help in doing complicated things.
A person such as KC9UDX may be able to organize and use it to solve difficult
problems.
For most, Basic tends to make programs flat, when they should really have
hills and valleys. ( sorry, about the best way I could describe it ).
The first program I wrote in Basic was a disassembler for the 8080.
I've since written many disassemblers, assemblers, simulators, application specific
editors and other programs. I could do these in Basic, even today, having not
written any for many years but can't imaging why I'd want to work around
the clumsiness of the language to get it done.
Most modern Basics are not as bad as earlier ones but still one tends to
write flat code unless one makes the effort to build the hills and valleys.
Dwight
 
If one were to learn a "right" language, I suspect that many would suggest Ada. It's complete and, in the universe of languages, fairly modern.

Let's not forget what the "B" stands for in "BASIC"...

For what it's worth, I don't consider "Visual BASIC' to be BASIC at all. If you're looking for a relatively pure version, try "True BASIC".
 
As to the OP, what are the old machines? If any of them are the type that come with built-in BASIC (excepting the IBM PC/XT/AT/PS/2 series'), BASIC is almost mandatory. If they run CP/M or MS-DOS, Pascal really is the way to go.

Here's my current list!

  • Apple IIe
  • Atari 800XL
  • Commodore 64
  • ZX Spectrum
  • Acorn Electron
  • BBC Micro
  • Amstrad CPC 464
  • MSX2
  • XT clone
  • Atari STE
  • Amiga 500
  • Acorn Archimedes

So yeah, BASIC is pretty widespread
 
That's a nice list :) But on the 8-bitters I think you're going to find that eventually you'll want to drop down to machine language, and on the 16/32-bit systems you can pretty manageably get a nicer higher-level language going (C, one of the newer, less clunky Pascals, or try to wrap your head around Forth.)
 
...and the BASICs offered for the machines on that list differ in their implementation. All have "extensions" over the ANSI X3.60-1978 standard; several don't even hew to the standard at all.
 
Well, frankly, knowing BASIC, and understanding structured programming, made me understand Visual BASIC without help. I did take a class to learn Windows operating system programming, and would have struggled to make user-friendly programs in VB without that.

I prefer real BASICs over VB though, if I have to use one or the other. The advantages of VB over real BASIC are not advantages when you consider the disadvantages. The most egregious disadvantage is the inability to directly access memory. That's where real BASIC can still do just about anything you would want to do (albeit painfully) and VB just can't.

i've even written self-modifying code in both Applesoft and Commodore BASIC. I don't recommend getting to that point (!) but you sure can't do that in VB.

But like I was saying earlier, it depends on the target. If it's Amiga or something that runs Unix, then C is the obvious goal for someone who doesn't already know other languages. Next, if it's the stereotypical 70s or 80s 8-bit machine that is designed to primarily run BASIC, then it's essential to learn that BASIC, with the manuals that came with the machine, or one of the plethora of third-party books. Again, if it's MS-DOS or CP/M, you just can't beat Pascal as a beginner. If it's something with a toggle-switch front panel, hex keypad, monitor, or tape interface as a primary means of interaction, machine language really is the best way to start. For other vintage systems there are other appropriate ways to start but I'm not expert on those. But aside from those, as much as I think Forth, Ada, and things like True BASIC, or a hoarde of other alternative languages are great languages to learn and use, and to strive for, I just don't think they're appropriate for someone who wants to learn simple computers.

Again, I just can't think of a better way for anyone in the OP's position to start other than machine language on a simple, down-to-earth machine. And the best thing I know of like that is one of these things, of which there happens to be one for sale on ebay.uk:

ScienceFair_MicroTrainer_System_s1.jpg


Following the instructions in that book is the best way I know of to learn what computers are, what they can do, and how to make them do it, all without prior experience.
 
Here's my current list!

  • Apple IIe
  • Atari 800XL
  • Commodore 64
  • ZX Spectrum
  • Acorn Electron
  • BBC Micro
  • Amstrad CPC 464
  • MSX2
  • XT clone
  • Atari STE
  • Amiga 500
  • Acorn Archimedes

So yeah, BASIC is pretty widespread

Well I have to apologise for my last post; it took me so long to write it that the context got lost.

With that list, if you don't want to buy more hardware, I do believe it would be best to start out with BASIC on one of the first three. The Beeb might fall into that category, too, I don't know enough about them to say.
 
That's a nice list :) But on the 8-bitters I think you're going to find that eventually you'll want to drop down to machine language, and on the 16/32-bit systems you can pretty manageably get a nicer higher-level language going (C, one of the newer, less clunky Pascals, or try to wrap your head around Forth.)

Eventually, yes. But not right away, in my opinion.
 
Alternatively, you may want to just pick up one of the many incarnations of the Arduino and build something that actually does something real. Programming tools abound and there's a very large community of people coding for the things.
 
It isn't that complicated things can't be done is Basic, it is more that it
is often of little help in doing complicated things.
A person such as KC9UDX may be able to organize and use it to solve difficult
problems.
For most, Basic tends to make programs flat, when they should really have
hills and valleys. ( sorry, about the best way I could describe it ).
The first program I wrote in Basic was a disassembler for the 8080.
I've since written many disassemblers, assemblers, simulators, application specific
editors and other programs. I could do these in Basic, even today, having not
written any for many years but can't imaging why I'd want to work around
the clumsiness of the language to get it done.
Most modern Basics are not as bad as earlier ones but still one tends to
write flat code unless one makes the effort to build the hills and valleys.
Dwight

I agree that most BASICs are lacking many features of other languages, but what do you mean by "flat"? Everything in the global scope? No pointers, classes, templates? Something else?
 
If you nest more than one or two times in Basic, you have made it unmaintainable .
I would pick C over Basic.
Modifying to add new features require careful design up front so you don't get
into a corner.
I don't recommend languages that get you too far from the machine unless you expect
to get payed to do it. You still need to know that a computer is binary and what that
means. I met a Python programmer that claimed to program for 10 years that didn't
know that ASCII was just a particular bit pattern.
That is a shame as he will surely add to bloatware that we are already buried in.
Also, programming languages that are not modular in some form are beyond the
ability to test large programs for correctness ( not that anyone seems to actually
test their own code correctly ). Attempting to properly test code that can't be broken
into less the 4 decision point ( conditional branches ) is not creating tested code.
It is just an odds game then. Hopefully it is not critical software.
Dwight
 
Hairy, sure. Unmanageable? Not at all.

A legal pad documenting each block of code is all I use. Each block corresponds roughly to a procedure in a structured language. Blocks just aren't always contiguous lines of code.

I find this works, but fully documenting inline just doesn't. Not only is the code fragmented and the documentation needs to reflect that, but comments take space and execution time and aren't easy to read after typing LIST, anyway.
 
Machine code looks pretty intense. Might take me a while to build to that.

Wikipedia states that the original arcade version of Defender, released in 1981 by Williams Electronics and written by a team led by Eugene Jarvis, was written in assembly language. The target processors were Motorola 6809 CPU with a 6800 handling audio.

Assembly language was practically a necessity for arcade games - at least "shoot-'em-up" - because of the limits of the hardware, both speed and capacity. 2 MHz was "fast" for a processor of those days. Assembly language is, generally speaking, accepted to be both faster in execution and smaller in memory footprint than higher-level languages. Sprite collision detection and controller response time were two issues that assembly code helped resolve.

But the Defender game code was specific to the arcade machine. Any other version released, and there were many, had to be "ported" (rewritten) to another machine. All code is ultimately specific to a machine.

I hope you won't try a rewrite of Defender as your first project. As a place to start the BASIC that came with one of your machines is as good as any. You will probably outgrow it -certainly the line-oriented version of it - and then you can look at what else you would like to work with.

-CH-
 
Back
Top