Welcome, Guest. Please login or register.

Author Topic: Newbie Coding?  (Read 5238 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Castellen

Re: Newbie Coding?
« on: December 31, 2005, 11:41:51 PM »
My advice would be to learn something universal and portable like C.

There's plenty of "teach yourself" books and websites available, but you need an overdose of motovation and self discipline to get through most of them.

As with most things, it's a major learning curve to begin with and very frustrating, but once you understand the basics, you suddenly just click and everything starts to makes sense.

I took a part time beginners C course at Polytech, was the best thing I ever did.  Made the learning process so much easier.  That would be my #1 suggestion for learning a new language.

As for Amiga programming, I use SAS/C but there are other freeware(?) compilers like GCC and Dice, though I've not used them.  Also there is Storm C from H&P which is supposed to be OK.

Last bit of advice, don't set your expectations too high.  Many beginners have this misconception they'll be writing Quake 4 within a few months months of learning C.  That isn't going to happen :-)  Start simple and progress your way through simple text user interfaces, eventually moving onto ReAction/MUI GUIs and the likes.

Hope that helps.  And happy new year!
 

Offline Castellen

Re: Newbie Coding?
« Reply #1 on: January 01, 2006, 04:40:32 AM »
Agreed, Dennis Ritchie's book (K&R) is probably one of the best C references available, though probably not overly useful for the beginner.

One of the learning C books recommended by many is "Teach yourself C in 24 hours" by Sams Publishing.
It takes you through 24 x 1 hour lessons.
I tried it, but I always ended up not quite understanding things properly, hence the Polytech course I took where the tutor gave a good explanation to my many questions.  Worked out well as I'm as thick as a whale omelette at the best of times  :-)

Took me a few months to actually get the hang of it though as I'd programmed in BASIC and Motorola assembly before, C was a completely different approach on everything I'd ever known about programming.

There's also a Yahoo mailing list called amiga_bcg which an Amiga specific C programmers group.  It's a good place to seek answers to C questions in general as well as Amiga specific programming.
 

Offline Castellen

Re: Newbie Coding?
« Reply #2 on: January 04, 2006, 03:26:04 AM »
@AmigaEd
I've taken Structured Programming courses on C where we were taught that good programming techniques involve:

- Planning exactly what you're going to do before writing any code (using flow charts, design structure diagrams)

- Using a "top down" approach to programming so that you can see the big picture of what's going on

- Structuring code with good commenting, tidy layout, non-cryptic names for variables, etc


There's a bit more to it than that of course, which pretty much applies to any code, not just C.

If you want an example of some C code written for AmigaOS, here is a small program I wrote this morning.
It's hardly the most advanced or best written code on the planet, but it's simple, easy to read through, easy to maintain and works OK.
In fact by downloading from that link above, you'll be executing the compiled version of it, proving for yourself that it does in fact work :-)
 

Offline Castellen

Re: Newbie Coding?
« Reply #3 on: January 04, 2006, 04:42:56 AM »
Sorry, I typed the link name wrong.
Try this instead.

Forgot to mention as well, if you're looking for a simple, free text editor with C (and HTML) syntax highlighting, give TuiTED a try.  Needs a bit of configuration via tooltypes to get it nice, but it does a good job despite being a beta release.
I've just spent the last 2 months writing embedded C for the Motorola 68HC11 using it.
 

Offline Castellen

Re: Newbie Coding?
« Reply #4 on: January 05, 2006, 12:38:07 AM »
Aminet contains plenty of programs which include source listings.

Unfortunately many of the sources aren't very well structured and have little if any commenting, so trying to read through and understand them is not as simple as it could be.
Of course there are some sources on Aminet which are very well written.

If you want, I could email some of the C sources I've written over the years.  They range from fairly good to pretty crap :-)

Here's a tip for you:
If you can read through the source and understand what it's doing without too much hasstle, then chances are it's been well structured and layed out.

It also helps to view C source with an editor which does syntax highlighting, such as TuiTED or GoldEd AIX.  Specific parts of the text being different colors help a lot.