Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: What's the best way to learn C?

  1. #11
    Join Date
    Mar 2005
    Location
    Sydney, NSW
    Beans
    120
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: What's the best way to learn C?

    Knowing Object oriented programming language has nothing to do with programming in Object oriented manner.
    Most users programm in procedural form even using C++, I used to do that untill I went for a training on design patterns.
    If you already know Java, I would suggest learn OOAD with UML and design patterns before opting out for another OO Language.
    Language has more to do with syntax, learn concepts first and then go for Language.
    Might I ask the reason why you want to learn C++ when u already know Java.

    Abhay

    P.S : VB is not object oriented.
    Fiesty all the way

  2. #12
    Join Date
    Feb 2006
    Location
    Tampa
    Beans
    114
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: What's the best way to learn C?

    Quote Originally Posted by Lux Perpetua
    I recommend the book Teach Yourself C in 21 Days by Sam's Publishing.
    I 2nd that, thats a great book if your just starting out in C, the C++ version is good as well for the basics.

    On the C / C++ issue, I HAD to learn C really quickly when I first started in school, most CS/CE departments, ours included teach theory in C. Luckly I've known C++ forever, dont ask why, I was a really nerdy kid I guess. Anyways, the C++ to C transition took like a week... it really did, once you know C++, C is cake, well not cake, but it makes life easier, some of the more elegant points I didnt pick up untill later, actually not untill I forced myself to work soley in C for like half a year. But my nerdyness I not the issue here....

    We have a LOT of people here in school that come in knowing absoutly nothing about programming other than that you can type stuff into your computer to make it do stuff. Learning C for them starting from nothing is always hard and my advice to them is always to go learn C++ or java, then pay better attention to C.

    The java -> C++ -> C transition would go alot smoother then the java -> C -> C++ transition. Think about it for a second, C++ is built on C, its OO where C is not, java is a VERY good first language to learn because it makes learning and understaning OO programming fun, well I suppose "fun" is a relative term, anyways, go from what you know, a very good OO language, to a an intermediate step with C++, then down to the procedual C language, dont loose that inbetween step.

  3. #13
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Quote Originally Posted by Lux Perpetua
    I recommend the book Teach Yourself C in 21 Days by Sam's Publishing.
    The way you know a book is crap is that it starts with "Teach Yourself " and ends in "XX Units of Time". I've read it some ages ago for some class, it's not very good. It's a passable syntax tutorial.

    The reasons are (1) your C knowledge won't be wasted in C++, since the C language is (essentially) a subset of C++;
    Yes, it will. The right way to do something in C is almost universally the wrong way to do it in C++. Conversely, the right way to do something in C++ is impossible in C.

    Knowing C will help you learn C++.
    No, it won't. It'll only serve to confuse.

    Quote Originally Posted by abhaysahai
    Might I ask the reason why you want to learn C++ when u already know Java.
    Because Java is a poor language in lots of ways?

    P.S : VB is not object oriented.
    VB6 barely clears the bar. VB.NET clears it with room to spare, despite being excessively verbose.

  4. #14
    Join Date
    Aug 2005
    Location
    The Local Group
    Beans
    631

    Re: What's the best way to learn C?

    Quote Originally Posted by LordHunter317
    The way you know a book is crap is that it starts with "Teach Yourself " and ends in "XX Units of Time".
    Potshot.
    I've read it some ages ago for some class, it's not very good. It's a passable syntax tutorial.
    It's a very readable book, but it is aimed at people without much computer experience. It's basically a beginner's tutorial.
    Quote Originally Posted by LordHunter317
    Yes, it will. The right way to do something in C is almost universally the wrong way to do it in C++. Conversely, the right way to do something in C++ is impossible in C.
    That wasn't my point. C++ is easier to learn if you're already comfortable with the fundamentals (data types, variables, functions, etc.) and can concentrate on the bigger things.
    No, it won't. It'll only serve to confuse.
    Your opinion, I guess. I, and others, didn't find it confusing.

    Edit: Think of it this way: if you know C, then you already know some C++. Therefore, you have less work to do to learn the rest. The unlearning you have to do is only an issue if you are really set in your ways style-wise and design-wise; the only language features to unlearn are things like "use new instead of malloc" and various features of the library. If you know C++, then you don't necessarily have any idea what C is (knowing that it is some subset of what you already know doesn't help). If you now have to learn C, you have to unlearn most of the C++ language. This can be a painful process. I experienced it when I recently started learning Fortran 77, having programmed in more modern languages.

    I am not saying that a person should learn C first if the goal is only to learn C++. I am saying that if both C and C++ are to be learned, then it makes sense to go for the more primitive one first.
    Last edited by Lux Perpetua; February 26th, 2006 at 07:40 AM.

  5. #15
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Quote Originally Posted by Lux Perpetua
    That wasn't my point. C++ is easier to learn if you're already comfortable with the fundamentals (data types, variables, functions, etc.) and can concentrate on the bigger things.
    Not especially. Books like Accelerated C++ exist for a reason, and are well expected for a reason. And you don't need to know C to read it.

    In fact, if you wanted to learn C, it's probably a better text than any C text I could recommend. I don't know any good C texts that serve as a tutorial that actually teach both the language and sound design at once.

    Your opinion, I guess. I, and others, didn't find it confusing.
    You're clearly confused if you're suggesting one to the other. What value other than syntax does knowing C give to writing correct C++ code?

  6. #16
    Join Date
    Aug 2005
    Location
    The Local Group
    Beans
    631

    Re: What's the best way to learn C?

    Sorry, I didn't see your post. I edited my reply above.

    The value is this: knowing a relatively easy language like C makes it easier to learn a complex extension of it like C++. On the other hand, knowing a full-featured and powerful language like C++ makes it harder to learn a more restricted subset of it.

  7. #17
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Quote Originally Posted by Lux Perpetua
    The unlearning you have to do is only an issue if you are really set in your ways style-wise and design-wise;
    Which is infinitely more important than lanmguage.

    the only language features to unlearn are things like "use new instead of malloc" and various features of the library.
    ITYM you mean all the features of the library. Save for a few small things (e.g., ctype, math) you shouldn't be using the C standard library at all in C++, especially if you're a beginner.

    If you know C++, then you don't necessarily have any idea what C is (knowing that it is some subset of what you already know doesn't help). If you now have to learn C, you have to unlearn most of the C++ language.
    You have to do it anyway if you go the other way, so it's a non-sequitur.

    I am not saying that a person should learn C first if the goal is only to learn C++. I am saying that if both C and C++ are to be learned, then it makes sense to go for the more primitive one first.
    I don't think that's true, as the carryover is limited to solely syntax.

  8. #18
    Join Date
    Mar 2005
    Location
    Sydney, NSW
    Beans
    120
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: What's the best way to learn C?

    Quote Originally Posted by LordHunter317
    The way you know a book is crap is that it starts with "Teach Yourself " and ends in "XX Units of Time". I've read it some ages ago for some class, it's not very good. It's a passable syntax tutorial.

    Because Java is a poor language in lots of ways?
    I realize that Teach Yourself is just a syntactical book, but no book in my openion is crap, its just that they target a different set of readers.

    Java -- a poor language ????
    Java is much better structured in comparison to C++. It implements all the possible sortcomming of earler languages like C++.
    For instance, we all know multiple inheritance can lead to problems in C++, but C++ still allows it. The solution is to use pure virtual base class. Java on the other hand implements this as part of syntactical regulations.
    chances of doing error in Java is much less than in C++. That apart, I am a pure C/C++ programmer and have limited knowledge of Java. Could you please highlight some of the shortcommings of Java w.r.t C++.
    Fiesty all the way

  9. #19
    Join Date
    Nov 2004
    Beans
    2,614

    Re: What's the best way to learn C?

    Quote Originally Posted by abhaysahai
    Java -- a poor language ????
    Yes, it's fundamentally poor in several ways. It lacks closures, and desperately needs them (made all the more irksome by the fact they were stripped before 1.0). The single class hierarchy is a mistake. Object should really be the equivalent of (void*), not all of those operations make sense on all child objects, hence, they shouldn't be in the parent. It was done to make their life eaiser. Generics aren't real generics, but just cast wrappers. This was originally done for backwards compatibility, but then they broke the latter anyway and forgot to fix the generics. Oops.

    I could go on, but Java has plently of major, boneheaded decisions about it.

    Java is much better structured in comparison to C++.
    If by structure you mean syntatically cleaner, sure. No arguments here; C++ is an ugly language.

    If you mean structure in terms of how the Java class library forces you to structure your programs, sure. But that's not a good thing. It's almost universally bad.

    It implements all the possible sortcomming of earler languages like C++.
    If by implements you mean, "fixes", no it doesn't.

    For instance, we all know multiple inheritance can lead to problems in C++, but C++ still allows it.
    Which is why you use it judiciously and correctly. Just because something lets you do bad things isn't a reason to remove it, per se.

    The solution is to use pure virtual base class. Java on the other hand implements this as part of syntactical regulations.
    No, it doesn't. Interfaces aren't pure virtual base classes, they're not implemented this way. And Java's weak MI has more flaws than C++ complicated MI: specifically, there's no way to provide different implementations of inherited methods of the same name. This isn't normally a problem in C++, nor is it a problem in C#.

    chances of doing error in Java is much less than in C++.
    Ahh, but in Java, when you commit it, it's impossible to correct it. The language won't let you. It's impossible.

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •