Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to I start learning C?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
ericxx2005
Apprentice
Apprentice


Joined: 05 Apr 2005
Posts: 231
Location: 10 square miles surrounded by reality

PostPosted: Sun May 08, 2005 8:57 pm    Post subject: How to I start learning C? Reply with quote

I consider myself almost a guru in hardware, and becoming one slowly in gentoo/linux, but I find myself wanting to learn programming. Should I start with C, C++? Does anyone have any links to good websites for this sort of learning? I did a google search, and most of the links seem to assume you have some sort of programming background. I have only very little visual basic experience, and thats it. Where does one start?
Back to top
View user's profile Send private message
acasto
Apprentice
Apprentice


Joined: 06 Feb 2004
Posts: 236
Location: Durka-Durka-Stan

PostPosted: Sun May 08, 2005 9:09 pm    Post subject: Reply with quote

Here's one of the many threads on learning programming that popped up on Off-The-Wall. You may want to do a search on OTW for programming threads. It's exlcuded from the regular 'quick search' function so you'll have to spcifically select it in the search page to do it.

https://forums.gentoo.org/viewtopic-t-333090-highlight-learn+programming.html
_________________
Leerrroooooyyyyyyyy JENKINS!!!!1111...................

"You know the Nazi's had pieces of flare.. that they made the Jews wear."
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sun May 08, 2005 9:10 pm    Post subject: Reply with quote

C and C++ are very connected and overlapping. It is very hard to be proficient in one and know nothing about the other.

This thread came up a few days ago, you may find it usefull:
https://forums.gentoo.org/viewtopic.php?p=2389420#2389420

My personal suggestion is to find some random C tutorial ( Google ) and get solid with the syntax alone at first. This is an insanely important step.
Then get this book: http://mindview.net/Books/TICPP/ThinkingInCPP2e.html
It will teach you a lot of design and OOP , apart from the syntax of C++.

Once you have an idea of the languages the rest is tools and API details. Yet, before you start digging API you should know the abstract ideas behind it ( OOP for example ) and the syntax of the language.

Hope that helps.
Back to top
View user's profile Send private message
ericxx2005
Apprentice
Apprentice


Joined: 05 Apr 2005
Posts: 231
Location: 10 square miles surrounded by reality

PostPosted: Sun May 08, 2005 9:15 pm    Post subject: Reply with quote

I definately plan on investing in some books on it, including other areas (especially in Linux), but as of now my bank account is -$200, not including my $1000 Best Buy bill, lol. I'm looking for any kind of website that might give me a 'heads up' or 'basics' on programming before I indulge into books.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sun May 08, 2005 9:22 pm    Post subject: Reply with quote

This thing http://mindview.net/Books/TICPP/ThinkingInCPP2e.html you can download for free. I've run out very basic sites though.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Sun May 08, 2005 9:25 pm    Post subject: Reply with quote

You may also check this out:
http://www.awprofessional.com/bookstore/product.asp?isbn=0321219147&rl=1
Looks good, never had it though.
Back to top
View user's profile Send private message
cSoundr
n00b
n00b


Joined: 10 Mar 2005
Posts: 12

PostPosted: Mon May 09, 2005 1:53 pm    Post subject: Reply with quote

I don't know about C++, but for C you should definitely look into getting Kernighan and Ritchie's "The C Programming Language." Definitely one of my greatest resources.
Back to top
View user's profile Send private message
Gherald
Veteran
Veteran


Joined: 23 Aug 2004
Posts: 1399
Location: CLUAConsole

PostPosted: Mon May 09, 2005 1:57 pm    Post subject: Re: How to I start learning C? Reply with quote

ericxx2005 wrote:
I consider myself almost a guru in hardware, and becoming one slowly in gentoo/linux, but I find myself wanting to learn programming.
Should I start with C, C++?

No, you should not. Start with either python or shell scripting. Once you can make useful programs with either of those, you can look into C/++
Back to top
View user's profile Send private message
pacde
n00b
n00b


Joined: 03 May 2005
Posts: 60

PostPosted: Mon May 09, 2005 2:39 pm    Post subject: Reply with quote

I disagree. I think people should start with C and learn how their computer works first, it provides a building experience for everything else. Yes its a pretty steep learning curve, but if you want to program C is the root of all programming languages. Im assuming its not scripting you want to do, but programming right? Learn C - it will give you the foundation for C++, Java (although thats a paradigm shift) and whatever other programming you want to do including PHP. If you find C too hard, go for PHP. Its a scripting language, but its like C in a lot of ways and it will help you learn C. I really think people who want to program should start with the base - and that is C.
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Mon May 09, 2005 3:19 pm    Post subject: Reply with quote

Quote:

I think people should start with C and learn how their computer works first, it provides a building experience for everything else.

I agree. Sometimes my web-dev friends get into really stupid situations by not having a clue on how the system works. You need not have written a window manager in C before moving on, but having a grasp of it is something that IMO helps a lot.
Back to top
View user's profile Send private message
transienteagle
Apprentice
Apprentice


Joined: 24 Dec 2003
Posts: 190
Location: UK

PostPosted: Mon May 09, 2005 4:51 pm    Post subject: Re: How to I start learning C? Reply with quote

Gherald wrote:
No, you should not. Start with either python or shell scripting. Once you can make useful programs with either of those, you can look into C/++


I'am with Gherald on this one;

Reasons

(1) You can do a huge amount of useful stuff using shell scripting. Take a look at the init scripts for examples.
(2) You need to understand shell scripting if you want to do simple system administartion / automation
(3) You can start to do useful things straight away
(4) Gives you confidence

Once you are happy with your first shell scripts move to a "scripting language" Python/Perl/PHP/Ruby (Ruby is real nice and totally elegant)

Reasons

(1) Quick to get up and running
(2) Gui coding much much easier
(3) No worries about code/compile/link (not that this is an issue, but if you are starting out its easier if you dont have to do it)
(4) You can start to see results much quicker than coding in C which will give you confidence.

Confidence is all important !!!!!!!!!!!

Coding in C/++ will not make you a better programmer, or make you have a hairier chest or give you a bigger nob. (I do however have it on good authority that coding in C using Vim does)

C is not the root of all programming languages (far from it in fact)

Fortran 1957
Lisp 1958
Algol 1958
Cobol 1959
Pascal 1968
smalltalk 1972
C 1972 (co-inciding with the birth of Unix)
C 1974 Reference manual produced
C++ 1986

my 0.02c worth

rgds

TE
Back to top
View user's profile Send private message
Gherald
Veteran
Veteran


Joined: 23 Aug 2004
Posts: 1399
Location: CLUAConsole

PostPosted: Mon May 09, 2005 5:32 pm    Post subject: Reply with quote

pacde wrote:
I disagree. I think people should start with C and learn how their computer works first, it provides a building experience for everything else. Yes its a pretty steep learning curve, but if you want to program C is the root of all programming languages. Im assuming its not scripting you want to do, but programming right? Learn C - it will give you the foundation for C++, Java (although thats a paradigm shift) and whatever other programming you want to do including PHP. If you find C too hard, go for PHP. Its a scripting language, but its like C in a lot of ways and it will help you learn C. I really think people who want to program should start with the base - and that is C.

I'm sorry, but the year is 2005. No beginner should have to do their own memory management.

PHP does one thing well: web programming. If that's your main interest, then it's a good place to start. But other people should learn a more general language.

Java would be fine, but not as good a first choice as Python, mostly due to the needlessly bloated syntax:
Code:
public class printOneLine {

      public static void main ( String[] args ) {

            System.out.println( "OMG I HATE TEH JAVA !!1" ) ;

      }
}

It's all fine and dandy for professional software engineers, but beginners shouldn't have to type so goddamn much just to print a line.

Some reading:

http://www.catb.org/~esr/faqs/hacker-howto.html
http://www.hetland.org/python/instant-hacking.php
http://www2.linuxjournal.com/article/3882
http://www.python.org/doc/current/tut/
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Mon May 09, 2005 5:41 pm    Post subject: Reply with quote

Quote:

I'm sorry, but the year is 2005. No beginner should have to do their own memory management.

I am a suporter of the best-tool-for-the-job position. Sometimes it is C , sometimes Java. Managed memory has pros and cons, like everything else. I just say that having good idea of C is usefull because you may ocasionally have to interface C code, even if most of your project is Java. For example to use the serial or USB port in Java on Linux you have to write a JNI wrapper around the C API.

Quote:

It's all fine and dandy for professional software engineers

No, you are wrong :wink: It outright sucks ( try to open a file and read a string ). This one thing ( input/output ) C has done with two functions - scanf/printf and Java with some 30 classes.
There is nothing 'fine and dandy' here :D
Back to top
View user's profile Send private message
Gherald
Veteran
Veteran


Joined: 23 Aug 2004
Posts: 1399
Location: CLUAConsole

PostPosted: Mon May 09, 2005 5:48 pm    Post subject: Reply with quote

IvanYosifov wrote:
Quote:
I'm sorry, but the year is 2005. No beginner should have to do their own memory management.

I am a suporter of the best-tool-for-the-job position. Sometimes it is C , sometimes Java. Managed memory has pros and cons, like everything else. I just say that having good idea of C is usefull because you may ocasionally have to interface C code, even if most of your project is Java. For example to use the serial or USB port in Java on Linux you have to write a JNI wrapper around the C API.

Fine, let me break this discussion down to terms you'll understand. A beginner's job description is "Learning to programming for the first time." Python is most often the best tool for this job. A programming language that requires you to manage your own memory is most often one of the worst tools for this job. Comprende?
Quote:
Gherald wrote:
[Java is] all fine and dandy for professional software engineers

No, you are wrong :wink: It outright sucks ( try to open a file and read a string ). This one thing ( input/output ) C has done with two functions - scanf/printf and Java with some 30 classes.
There is nothing 'fine and dandy' here :D

For professional software engineering, it does not suck. If you just want to hack code quickly, it does suck. Enter Python...
Back to top
View user's profile Send private message
IvanYosifov
l33t
l33t


Joined: 15 Oct 2004
Posts: 778
Location: Bulgaria

PostPosted: Mon May 09, 2005 6:07 pm    Post subject: Reply with quote

Quote:

A programming language that requires you to manage your own memory is most often one of the worst tools for this job. Comprende?

I simply don't see how programming in a non-memory-managed language like C would be easier if you have experience in some memory-managed one. I suggested C because

1) the abstraction is simple ( much simpler than OOP )
2) Sometimes in life you have to use C so it is practicall to know it.

Of course, if ericxx2005 is interested in some area like web-programming - he should jump right on PHP. If however, he is interested in more general programming, at some point he will have to do some C and I don't see any benefit of putting it off.

Naturally, I speak from my personal experience and learning path, which is C,C++,Java in that order. If yours is different - then your suggestion will be different. After all ericxx2005 can just check out both Python and C and see which suits him better.

Quote:

For professional software engineering, it does not suck.

Sorry for the wording. I was refering to the IO API, only. Java is great most of the time.
Back to top
View user's profile Send private message
bendagr8
Tux's lil' helper
Tux's lil' helper


Joined: 04 Sep 2003
Posts: 135
Location: OR

PostPosted: Mon May 09, 2005 6:07 pm    Post subject: Reply with quote

cSoundr wrote:
I don't know about C++, but for C you should definitely look into getting Kernighan and Ritchie's "The C Programming Language." Definitely one of my greatest resources.


I usually don't get in on these pseudo flame-wars, but it's finals week, and I hate studying.

IF you really do have a good hardware knowledge as you say, I must second this book. Great reference book, and great way to start if you're technical understanding is already on par.If you are a younger guy who thinks they know a lot, but doesn't know much at all, (like I was when I got the book), I would definitely go for a more hand-holding type book "A beginners guide to [language]" or, "How to program in [language]" first.

I'm a big advocate for learning C first, but if you aren't willing to put in the time, and struggle of getting it right (again, which I wasn't when I got the book), don't bother with it yet. C isn't a language where you can do tremendously useful stuff on your own, right away, even though you know the syntax. IMO, designing good software in C, is more difficult than any other programming task I have done. The nice thing about C, which has kept me hooked, is most everything you probably use was written in C, and being proficient in C allows you to modify it at your will.

If want to be different, try Ruby. I've heard some wonderful things, and it shouldn't have the steep learning curve/convoluted syntax like Java/C/C++.
Back to top
View user's profile Send private message
hjnenc
Veteran
Veteran


Joined: 15 Aug 2004
Posts: 1599
Location: Vienna, Austria

PostPosted: Mon May 09, 2005 6:20 pm    Post subject: Reply with quote

In my opinion, programming is about algorithms, data structures, and clever division of large problems into smaller pieces that are easy to deal with independently.
Programming language is secondary.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 18120

PostPosted: Mon May 09, 2005 6:26 pm    Post subject: Reply with quote

Plenty of these threads already. I'll see about digging one up later.
_________________
Those who know what's best for us must rise and save us from ourselves.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum