Welcome, Guest. Please login or register.

Author Topic: Newbie Coding?  (Read 5213 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline nastyTopic starter

  • Sr. Member
  • ****
  • Join Date: Nov 2005
  • Posts: 460
    • Show only replies by nasty
Re: Newbie Coding?
« Reply #14 from previous page: January 03, 2006, 04:44:43 PM »
Thanks guys for all the 2 cents/pennys/rubys and anything else there is :lol:, its most useful  
Specs:
A1200PT, mediator c/w voodoo 3 2000, sb128, 60G HDD,OS3.9,LITEON CDR, nec 4x4 changer,External Scan Doubler,Cocolino adapter,PS2 keyboard adaptor.

Morphos 2.6, mini mac g4 @ 1.25ghz.
 

Offline uncharted

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 1520
    • Show only replies by uncharted
Re: Newbie Coding?
« Reply #15 on: January 03, 2006, 04:52:00 PM »
It depends.

If you don't want to invest huge amounts of time I'd go for Blitz Basic (it's freeware now IIRC so you've got nothing to lose in trying it).  You can do some quite complicated things rather easily.  It's fun to mess around with, and you can dip in and out whenever you want.

However Blitz Basic won't really satisfy you if you have bigger aspirations, while there have been some applications written using Blitz Basic (BlackIRC springs to mind) you're better off with C.  There are other advantages such as being cross-platform.

If you do decide to go with C, I have 2 bits of advice:-

1.  It's tough, you won't create anything interesting for ages. Stick with it.  You won't get anywhere until you understand the core concepts thoroughly.

2. Don't rely on just one book, none of them cover everything, and there are various ways to skin a cat.  The biggest mistake I made when learning C was that I only had one, book which it turned out missed a lot of important stuff.  It always helps when you have differing explanations anyway.
 

Offline AmigaEd

  • His Dudeness, El Duderino
  • Hero Member
  • *****
  • Join Date: Jan 2005
  • Posts: 512
    • Show only replies by AmigaEd
Re: Newbie Coding?
« Reply #16 on: January 04, 2006, 01:05:26 AM »
Greetings,

Not to Hijack the thread...
I hate doing things the easy way, I learn best by trial and error and by example(poor or good). Can someone point me to some well documented C or C++ examples of Amiga code?

Thank you and Regards,
AmigaEd
"Pretty soon they will have numbers tattooed on our foreheads." - Jay Miner 1990

La Familia...
A1K - La Primera Dama -1987
A1K - La Princesa- January 2005
A2K - La Reina - February 2005
A2K - Doomy - March 2005
A500 - El Gran Jugador - April 2005
A1200 - La Hermosa Vista - May 2005
A2KHD - El Duro Grande - May 2005
A600 - Prístino - May 2005
A1200 - El Trueno Grande - July 2005
CDTV - El Misterioso - August 2005
C64 - El Gran Lebows
 

Offline Merc

  • Sr. Member
  • ****
  • Join Date: Apr 2002
  • Posts: 312
    • Show only replies by Merc
    • http://chebucto.ns.ca/~ah210/Profile.html
Re: Newbie Coding?
« Reply #17 on: January 04, 2006, 01:23:12 AM »
I started with Basic (AmigaBASIC of course!) but when I started my job after school I picked up a copy of Practical C Programming (link) and basically learned C in a few weeks -- I highly recommend this book to anyone looking to learn; it teaches C but also some good programming practices and debugging strategy, and does it all without being too boring :)
 

Offline Castellen

Re: Newbie Coding?
« Reply #18 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 Plaz

Re: Newbie Coding?
« Reply #19 on: January 04, 2006, 03:58:28 AM »
An additional warning about using C, C++ and other similar langauges..... The libraries.

The good .... The libraries save you tons of time by making available prewritten modules that can do a lot of work for you. No need to "reinvent the wheel". Just call the appropriate function/method in the correct library and off your program chugs. Many times it may not even be necessary to know what's in the lib, only that you know what data to send it. (Super simplified analogy!)

The bad (IMHO) .... The libraries are typically written by a coding guru or group of gurus. Some libs are simple and do simple jobs. Others are very indepth, read like egyptian hyrogliphics and do "magical" things to data and hardware. The libs are important to know and use. Many times you have to use non-standard libs written by other developers so it may be necessary to read through them and their docs. As a newbie I found many of them hard or impossible to read for some time. It was a great frustration that I wasn't warned about when I got started and I think it could be one of the road blocks that crash many a newbie.

Each OS has it own libs that you need to know and access to make your code hum and keep it compliant accross platforms. A lib that does a graphic in linux, doesn't necessarily apply to Amiga, MOS, MUI or windows and vi-see-versa. You learned a lib that came from AmigaOS2.x, but you may have to relearn the lib for OS4, or even a totally different lib if the program is going to try and use MUI.

So just keep in mind these extra parts and you'll do ok. I really hit a frustrating wall when the libs showed up. I thought I was just going to write all my own code as I used to do in ASM and basic. Nope, those darn pesky libs are going to be part of your C/C++ world. I can only suggest that you get good with the programming syntax. Be a great reader. It's much like reading a novel you've never seen before. Learn your language well and no matter what book you read, you will always be able to understand the story.

@thread
Thanks for some other good tips and suggestions I think I'll use a few of them myself.

Plaz

 

Offline AmigaEd

  • His Dudeness, El Duderino
  • Hero Member
  • *****
  • Join Date: Jan 2005
  • Posts: 512
    • Show only replies by AmigaEd
Re: Newbie Coding?
« Reply #20 on: January 04, 2006, 04:27:17 AM »
Castellen,
I tried to download your code example from your link but I can seem to get it to download.

Anyway, Yes, I agree that the well thought out, planned, approach is best. But, I'm just looking to see some examples of code that will help me see how the Amiga code "ticks" and that will give me something to change, modify and try different things.

I'm not a C programmer, but I've done some coding in the past. Even wrote some ASM programs for the Amiga 20 years ago. I just need to start jogging my brain.

I have downloaded the AmiDevCpp development environment and it looks pretty nice, but seems that much of the docs are in German. I can read some of it, but not enough. I would like to get some code examples that will compile under AmiDevCpp. I can then run the programs using WinUAE or A1200, A600, A500, A2000, A1000, CDTV, AROS, Etc.

Thank You,
AmigaEd
"Pretty soon they will have numbers tattooed on our foreheads." - Jay Miner 1990

La Familia...
A1K - La Primera Dama -1987
A1K - La Princesa- January 2005
A2K - La Reina - February 2005
A2K - Doomy - March 2005
A500 - El Gran Jugador - April 2005
A1200 - La Hermosa Vista - May 2005
A2KHD - El Duro Grande - May 2005
A600 - Prístino - May 2005
A1200 - El Trueno Grande - July 2005
CDTV - El Misterioso - August 2005
C64 - El Gran Lebows
 

Offline Castellen

Re: Newbie Coding?
« Reply #21 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 AmigaEd

  • His Dudeness, El Duderino
  • Hero Member
  • *****
  • Join Date: Jan 2005
  • Posts: 512
    • Show only replies by AmigaEd
Re: Newbie Coding?
« Reply #22 on: January 05, 2006, 12:11:53 AM »
Castellen,
Thanks, got it downloaded and will look it over a bit later this evening? Any ideas where I can find some more examples that I can download?


Regards,
AmigaEd
"Pretty soon they will have numbers tattooed on our foreheads." - Jay Miner 1990

La Familia...
A1K - La Primera Dama -1987
A1K - La Princesa- January 2005
A2K - La Reina - February 2005
A2K - Doomy - March 2005
A500 - El Gran Jugador - April 2005
A1200 - La Hermosa Vista - May 2005
A2KHD - El Duro Grande - May 2005
A600 - Prístino - May 2005
A1200 - El Trueno Grande - July 2005
CDTV - El Misterioso - August 2005
C64 - El Gran Lebows
 

Offline Castellen

Re: Newbie Coding?
« Reply #23 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.
 

Offline AmigaEd

  • His Dudeness, El Duderino
  • Hero Member
  • *****
  • Join Date: Jan 2005
  • Posts: 512
    • Show only replies by AmigaEd
Re: Newbie Coding?
« Reply #24 on: January 05, 2006, 12:49:26 AM »
Castellen,

I've sent you a PM....

I have GoldEd, somewhere I've got TuiTed squirled away, but the AmiDevCpp environment also has syntax highlighting.

I did start looking around Aminet but it's difficult to tell if its worth the time to download some of the files or not.

Regards,
AmigaEd
"Pretty soon they will have numbers tattooed on our foreheads." - Jay Miner 1990

La Familia...
A1K - La Primera Dama -1987
A1K - La Princesa- January 2005
A2K - La Reina - February 2005
A2K - Doomy - March 2005
A500 - El Gran Jugador - April 2005
A1200 - La Hermosa Vista - May 2005
A2KHD - El Duro Grande - May 2005
A600 - Prístino - May 2005
A1200 - El Trueno Grande - July 2005
CDTV - El Misterioso - August 2005
C64 - El Gran Lebows