Computer Science Canada

Where do i start?

Author:  shadowNET [ Tue Sep 11, 2012 4:19 pm ]
Post subject:  Where do i start?

I have wanted to start learning to program in C for a while, but i dont know where to begin! Sad i know i need a compiler and an editor like notepad++ but other then notepad++ i dont know where to get this stuff. Also if anyone knows some basic tutorials i can foll ow it would be greatly appriciated. Thanks in advanced! Very Happy

Author:  Tony [ Tue Sep 11, 2012 5:17 pm ]
Post subject:  RE:Where do i start?

C has a fairly steep learning curve. Why did you want to start with C in particular?

Author:  shadowNET [ Tue Sep 11, 2012 6:01 pm ]
Post subject:  Re: Where do i start?

Just somthing basic like a date or clock etc, even the basic "hello world" script would suffice but primarily the tools i will need to compile and edit C code

Author:  mirhagk [ Tue Sep 11, 2012 6:11 pm ]
Post subject:  RE:Where do i start?

Is this your first language?

Author:  shadowNET [ Tue Sep 11, 2012 6:18 pm ]
Post subject:  Re: Where do i start?

Im going to say yes, because the only other language i have done is turing, which honestly doesnt really count for much, although i did do a bit if java a little while ago but nothing major, i wrote a few scripts for a botting program

Author:  mirhagk [ Tue Sep 11, 2012 6:42 pm ]
Post subject:  RE:Where do i start?

Okay well I'd suggest looking into more high level languages like C#, python or even just C++, but if you're dead set on C, probably the best way is to pick up a book on it, or find an online tutorial, they'll explain getting compilers and everything you need.

Author:  shadowNET [ Tue Sep 11, 2012 6:54 pm ]
Post subject:  Re: Where do i start?

alright thanks for the help, ill look into that now Mr. Green

Author:  Insectoid [ Tue Sep 11, 2012 7:46 pm ]
Post subject:  RE:Where do i start?

Quote:
I'd suggest looking into more high level languages like C#, python or even just C++


I would suggest the opposite. C actually isn't a bad choice coming from Turing. Both are procedural languages. You can probably convert most of your (non-graphical) Turing programs to C just by replacing the syntax & function names. You don't have to worry about learning OOP or some other paradigm, but you can when you take on C++ (which you needn't bother with until you've learned enough C).


In my opinion, high-level languages suck all the fun out of programming. If you just want the final product, by all means learn C#. But if you'd rather write a program than use it, C/C++ will serve you well.

Author:  mirhagk [ Tue Sep 11, 2012 8:34 pm ]
Post subject:  RE:Where do i start?

the biggest differences between C and C# are essentially how much you have to worry about the basics, how easy libraries are to use, and how much the language offers. I'd say the funnest part of programming is discovering and utilizing new tools, and with a higher level language you get MANY more tools to learn and use. You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer". Higher level languages take away syntax errors and let you have freedom to program, and then give you amazing tools to use, and you can keep learning new features over and over.

<sarcasm>But no I think programming in machine language is probably the most fun because assemblers just sucks all the fun out of programming</sarcasm>

Author:  Insectoid [ Tue Sep 11, 2012 10:09 pm ]
Post subject:  RE:Where do i start?

Quote:
But no I think programming in machine language is probably the most fun because assemblers just sucks all the fun out of programming


I know you were being sarcastic, but assembly is fun. It's just damn hard to write anything significant in it.

Quote:
You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer".


I'm sorry, but that statement is absolutely ridiculous and completely untrue.

Author:  [Gandalf] [ Tue Sep 11, 2012 10:47 pm ]
Post subject:  Re: RE:Where do i start?

Insectoid @ 2012-09-11, 10:09 pm wrote:
Quote:
You can learn all the syntax of C in a single lecture, and then you'll just spend the rest of your programming days being like "crap I only had 1 equals sign in that if statement" and "I forgot to dereference that pointer".


I'm sorry, but that statement is absolutely ridiculous and completely untrue.

It's a valid point: the syntax of C is pretty trivial and easy to master, however it is also much more difficult to learn how to write expressive and bug free C code. Often times, the examples mirhagk used will be caught on compile time or with static analysis, however that only counts for so much in a language which can be a nightmare to debug.

Author:  wtd [ Tue Sep 11, 2012 11:22 pm ]
Post subject:  RE:Where do i start?

Or we could just give him Hello world!

code:
#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("Hello, world!\n");

    return 0;
}


For what it's worth, my Whirlwind Tour of C.

Author:  Amarylis [ Wed Sep 12, 2012 6:26 am ]
Post subject:  RE:Where do i start?

code:


#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    cout >> "Hello, World!\n";
    return 0;
}



Wouldn't that be the proper C? (I thought stdio was C++ library)

Author:  Insectoid [ Wed Sep 12, 2012 6:59 am ]
Post subject:  RE:Where do i start?

You've got it backwards. iostream, namespaces and cin/out are C++. stdio/printf are C.

Author:  shadowNET [ Wed Sep 12, 2012 4:20 pm ]
Post subject:  Re: RE:Where do i start?

wtd @ Tue Sep 11, 2012 11:22 pm wrote:
Or we could just give him Hello world!

code:
#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("Hello, world!\n");

    return 0;
}


For what it's worth, my Whirlwind Tour of C.


Yes i think thats a great idea, i think ill settle with C for now thanks for all the replies

Author:  bl0ckeduser [ Wed Sep 12, 2012 11:01 pm ]
Post subject:  Re: Where do i start?

This has already been done many times, but I can recommend the "K&R" book.
Also there is the comp.lang.c newsgroup for advanced pedantic questions
and the ##c channel on freenode.


: