ea***********@e arthlink.net wrote:
...you experienced programmers of C; did you start with C? What course
of study did you pursue to get to where you are today? Would you
suggest starting with REALbasic first for a n00b? I am completely new
to programming and using a Mac and would like some input as to where to
begin a career in programming. I know this is probably a somewhat
undefined question, but would appreciate you input/advice. Thanks.
Best first language to learn? Perl. Once you've coded in perl you'll
gain an entirely new perspective and appreciation for c (and any other
language that is not perl).
Being serious now, I would recommend something that will get you
familiar with the fundamental logic of coding. Specifically I would
recommend a loosly typed language first so you can concentrate on actual
code logic instead of variables. Once you have a firm understanding of
code logic then you can work on variables. Although it is not the
greatest language in the world, PHP is quite easy to learn however it
will at times open bad doors to programming. PHP is more like C++ than
C, however it will certainly help you get used to the basics of writing
code. As long as you avoid the object oriented aspects of PHP I don't
see why it wouldn't at least give you a boost in the right direction.
Even to this day I still use PHP to create a POC (Proof Of Concept)
before I start coding in C. It's easier to track what is going on
because it eliminates the need of a debugger and you don't have to
concentrate on variables; you only need to concentrate on functionality
and design.
Like many of the others here I learned BASIC first (I too programmed on
a TRS-80, among other things). All in al I would say your first task
should be to learn code logic, followed by portability, and finally
variable types and limitations. Perhaps the biggest problem you're going
to run into with programming in C is knowing what variable type to use
where (e.g., unsigned char * or char *, etc).
If you decide to learn C first, more power to you. Everyone needs
somewhere to start out, so why not use the age-old "Hello, World!"
example - but with a twist. If you are going to be coding in C you are
most certainly going to need to use a debugger. Since this newsgroup
deals with only standard C programming I cannot go into compiler or
debugger specifics, however I will leave you with the following code and
task to learn what is going in inside the code.
#include <stdio.h> /* for printf and friends */
#include <stdlib.h> /* for EXIT_SUCCESS, EXIT_FAILURE, etc */
int main(int argc, char **argv)
{
int i = 0;
i++; /* set a breakpoint here and examine the value of i */
printf("Hello, World! In my first c program i is now %d\n", i);
/* now, set a breakpoint here and examine the value of i */
printf("Increme nting i using the prefix operator: %d\n", ++i);
/*
* since we might be piped to another program we should
* let whoever called us know that we had a successful
* run
*/
return(EXIT_SUC CESS);
}
You may also experiment with the char type. For example (not a complete
program):
char c = 'a';
printf("c: %c\n", c);
++c;
printf("c (after): %c\n", c);
Best of luck,
- Joe