Welcome, Guest. Please login or register.

Author Topic: Beginner Programing  (Read 8011 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« on: February 22, 2003, 10:48:04 PM »
Basic is good to learn simple things like variables, loops and stuff like that.  It gives immediate feedback during execution so you can see some of the common beginner mistakes easily.

The only reason Basic used to be so much easier to learn on was that you didn't have to manage windows and other OS stuff just to print a message to the screen.  It also came with the machine and you could pick up magazines that had dozzens of programs you could type in.  There's nothing quite like typeing in programs and then running them to teach you how things work.  You could run the program and stop it at any time to see what code was executing and you could see how something actually worked a line at a time by stepping through the code.

The most common problem with C is you can't just start programming like basic.  You have to learn about include files, compilers, linkers and object libraries just to print "hello world" on the screen.  

If you have access to a PC, there used to be a C interpreter that would let you do the same thing with C.    Not sure what it was called but you could do the same kind of stuff as Basic.  A search on Google turned up several C interpreters.  CINT works on the console (text only) so it might be worth checking out.

Once you have the basics of programming down you'll want to learn about compilers and object oriented programming.  Compilers first I'd say.  Integrated development environments are a nice way to ease into it but the old Turbo C is a lot easier than the new IDE's.

Java is nice because it prevents you from doing things that would be perfectly legal in C but very undesirable.  However, you dive into the concept of objects rather quickly and the complexity and number of objects could overwhealm you in a hurry without help.
One plus is the availability of free development environments, tools and documentation.

 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #1 on: February 22, 2003, 11:12:10 PM »
Oh yeah, one other thing.  it was much more difficult to crash the machine in Basic than it is in C/C++.  That can be very frustrating for a beginner.  Pointers can be very tricky and can cause you problems even if you've been programming for years.  That's part of the reason so many people like Java.  It doesn't let you poke around in memory like C does.
 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #2 on: February 22, 2003, 11:28:37 PM »
You can find links to free C/C++ Compilers and Interpreters here.

If you have a PC the old Turbo C, Turbo C++ and Turbo Pascal are available free.  Also, a newer Borland C++ compiler is available without the IDE.
 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #3 on: February 23, 2003, 01:27:16 AM »
I know a lot about AmigaBasic.  The problem with AmigaBasic is that it doesn't even run if you have too much memory.  It also does it's share of crashing too.

I used to write libraries for AmigaBasic so that it could do a lot of advanced stuff.  Picture loaders with color cycling, all sorts of sound routines, mod music players... you name it.  The libraries were written in C and assembly.  I *might* still have the docs and examples for the libs somewhere if anyone was actually interested.

If you choose to go with AmigaBasic (which I always thought sucked), try to pick up a copy of  the Absoft Basic compiler (I think that was the one we used).  It worked with most standard code and added some extensions that were nice as you get more advanced.

FWIW, I did some looking around and there is a C interpreter that works like Turbo C.  It's called the Quincy C interpreter.  But it is for the PC.

 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #4 on: February 23, 2003, 06:02:02 PM »
I (for one) am not trying to push them to C.  Learning C is as much about learning the tools as it is about learning the language.  That makes it tougher on a beginner that may not like programming anyway.

If it were an older Basic like I learned on I'd say stay away from it.  I don't remember what additional features the Basic compiler we used added, but the code didn't use line numbers, GOTO or other things that teach bad programming practices.   We wrote a full accounting package in it.  With an editor you can write macros for you can compile wth a single keystroke.

Learn a little on the interpreter.  Once you start having problems with it's bugs or speed, find the compiler.  It will introduce you to compilers and make your programs run a lot faster.  Once you see the difference you won't want to go back.

I try to get people to start C on the PC because:
1. The tools are excellent and old ones are free.  Turbo C/C++ baby you through the development process... which really helps a beginner.  I know a lot of programmers that can't make heads or tales of make files.  
2. You don't need to learn the Amiga Window and I/O architecture if you write for DOS.  Having to use lots of complex structures before you even know what one is kinda raises the learning curve.
3. Amigas are now old enough they are dieing right and left.  I may have lost most of my Amiga source code thanks to a dead motherboard.  Nothing worse than working on a project for months and then having it wiped out by a hardware failure.
 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #5 on: February 23, 2003, 10:35:45 PM »
Look, a lot of you are making suggestions that don't make much sense.

1.  What does the person want to do with it?  If they want to write a game or do some cool graphics scripting languages and Rebol don't make any sense.  Frankly, they don't make much sense most of the time anyway.

2. Are they considering a career as a programmer and trying to figure out if they like it?  C/C++ and Java are what they will use the most.  Knowing Unix, Perl and Unix shell scripting are next in line on the need to know list.  Most of the applications I've written in the last 5 years were web based.  That means HTML, DHTML, Javascript, etc...

3. I honestly think programming for the Amiga can be fun but if you ever want to make a career of it... think PC.

As for learning bad habits by using AmigaBasic... WHY?  The stuff we used to write looked more like Pascal than Basic.  You obviously haven't seen a lot of AmigaBasic.

Quote

Aw rats! You couldn't save the HD?


My 3000's hard drive interface started flaking out and now the hard drive won't validate... come to think of it I don't think it even appears to be formatted at all according to the computer.

*IF* I transferred the source to the 1200 I purchased then I'm ok... but at the moment I don't have a monitor that even works with that.

It's no big deal really.  Just bumbs me out to lose all that code.  I had a lot of routines in assembly for picture fades, color cycling, decompressing ILBM images... all designed to link to SAS C.  It could be directly linked with from C or accessed from Basic through a shared library.

 I also had a 64180 emulator, some custom speach stuff that sounded much better than the narrator device... all sorts of toys I was working on at one time.

Actually, I don't care as much about that as some personal stuff that's probably gone forever.
 

Offline jdiffend

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 302
    • Show all replies
Re: Beginner Programing
« Reply #6 on: February 24, 2003, 02:00:19 AM »
@MarkTime wrote:
Quote
p.s. I just saw your own post above where you eschewed GOTO and LINE NUMBERS....so why did you even ask me this question? Just an AmigaBASIC lover?


referring to my post:
Quote
If it were an older Basic like I learned on I'd say stay away from it. I don't remember what additional features the Basic compiler we used added, but the code didn't use line numbers, GOTO or other things that teach bad programming practices. We wrote a full accounting package in it. With an editor you can write macros for you can compile wth a single keystroke.


The AmigaBasic code we wrote didn't have a single line number.  It used actual names.  It didn't use GOTO either.  It's not perfectly structured but it isn't as bad as you imply.  I've seen plenty of nasty C code.  And frankly, modern Basics including VisualBasic have, at best, a poor implementation of object oriented programming.  

Let's face it... bad programmers write bad code no matter what language they use.  

If all the guy wants to do is play with mandelbrots (or whatever) on his Amiga who cares what language he starts with and if he uses line numbers or GOTO statements?  The point is, people are making all sorts of suggestions without even asking what he wants to do.  It doesn't do any good to use objects, compilers, IDE's or whatever if he get's so frustrated learning it that he never finishes a single program.

If, after completing a few small programs he's still interested, then he should dive into object oriented programming with Java or C/C++ and learn more structured programming... no argument there!  AmigaBasic will drive him nuts for a large project.

AmigaBasic will let him get his feet wet without the time and effort required just to install a compiler.   But he should definately go to something else as soon as he's ready.