Thread: How can I learn?

  1. #1
    Princess of code universe programmer1's Avatar
    Join Date
    Nov 2011
    Location
    Wonderland
    Posts
    38

    How can I learn?

    I am the beginner of C. How can I be a good programmer?I read your book suggestions. I bought a "Deitel". But is it enough? Should I take more books?Or shoul go a C-course?What else?

  2. #2
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    I will echo CommonTater on this; read the book from cover to cover and do the exercises.

    Write other programs in C. Start small with small programs in a area you are interested in learning.
    Some write small games.

    One thing I add to CommonTater list is reading good C code help me to learn how to write better code.

    I also read this site and other sites FAQ and Tutorials
    Cprogramming.com FAQ
    C, C++ Programming Tutorials - Cprogramming.com


    Tim s.

  3. #3
    Registered User sagar474's Avatar
    Join Date
    Jun 2011
    Location
    Kakinada
    Posts
    56
    a good book is great. but just reading books dos not help us to be a good programmer.
    you should work with some programming logics.
    develop your own programs of your interest.
    take challenges.
    find out why an bug had occurred.

    work with structs pointers and arrays. then you can understand things better

  4. #4
    Princess of code universe programmer1's Avatar
    Join Date
    Nov 2011
    Location
    Wonderland
    Posts
    38
    Thank you for your offers I was told c is harder than java. Is this true? I mean do I try to learn java?

  5. #5
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    I think that many people might consider it harder to accomplish things in C, ie, they find java easier to use.

    I don't know if that means C is a harder language to learn tho. C is very straightforward and fairly minimal, while java is very object oriented, which is something you don't need to understand (at least, not for a while) with C. OTOH, you need to understand low level memory management very early on with C, which is less of a concern in java.
    Last edited by MK27; 11-10-2011 at 03:05 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by programmer1 View Post
    Thank you for your offers I was told c is harder than java. Is this true? I mean do I try to learn java?
    C is a very simple language, about 30 or so keywords, and a fairly simple set of grammar rules. This you can get down in a day.

    Programming on the other hand is hard... concepts, beginning with a good book that you will still be learning 20 years from now ...the biggest part of our time is understanding and planning... actually writing code is a very small part of the work programmers do.

    Java might be easier, but it also makes sloppier programmers who rely upon the built in houscleaning and memory management in many situations that will cause errors in C... C will make you a careful programmer which carries well to Java... unfortunately the opposite is not true.

  7. #7
    Registered User
    Join Date
    Nov 2011
    Posts
    161
    Always glad to hear what 'programers' do CT. It's good to have insight in how one in the field handles situations.
    In relearning C, I thinks it's imperative that one don't just read fast and run through any lesson/ book/ tutorial, but
    to actually try and grasp what was learned, play with a compiler, run very short programs and change many different things
    to see what happens. I'm reading right now C Primer Plus by Stephen Prata and it is one of the best Tech books I've read in a long
    time. He answers questions before they come to your mind and he explains each thing more than one way. Sure, the book is 900 pages long,
    760 if you don't count the reference material, but it reads like a novel.
    I think to get anything you have to be really interested in it and really curious enough to explore it. Not just do the exercises and run on to the next thing.
    Okay, back to lurking the forums.

  8. #8
    Princess of code universe programmer1's Avatar
    Join Date
    Nov 2011
    Location
    Wonderland
    Posts
    38
    Thanks for your answers . I don t know Java but I guess I will learn that language later(In school). C is my priority, maybe I will learn C so well and I can learn C++ easily . Or I am just dreaming

  9. #9
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by programmer1 View Post
    Thanks for your answers . I don t know Java but I guess I will learn that language later(In school). C is my priority, maybe I will learn C so well and I can learn C++ easily . Or I am just dreaming
    This is just me talking...

    C++ is a huge confusing mess. I've tried I don't know how many times to get my head around it and just plain can't. Object Oriented Programming bears little or no reseblence to how my head works and it just won't sink in. Of course your experience might be different but I would never recommend C++ to a new programmer. Get some other skills like C and maybe Java first...

    Also, don't idealize any programming language. They all have their strengths. They all have their weaknesses. It's mostly a matter of picking the right tool for a given job...

  10. #10
    Princess of code universe programmer1's Avatar
    Join Date
    Nov 2011
    Location
    Wonderland
    Posts
    38
    Thank you for your advice CommanTater . I ve just thought, they are both C, they must be similar, but it is obvious that they are not

  11. #11
    spaghetticode
    Guest
    As far as I understand things, C and C++ can be very similar, since C++ was designed to be fully compatible to C. But C++ also has enhanced features like a better OOP support. That's why problems are usually solved differently in C++ than in C. Shouldn't be too much of a problem to write C-style programs in C++, which makes the languages look similar - but if you do so, it's just not good and idiomatic C++.

  12. #12
    Registered User slartie's Avatar
    Join Date
    Oct 2011
    Location
    Denmark
    Posts
    6
    As a fellow newbie in the realm of C (I've dabbled since '94), I would recommend you download a tarball with a simple game. A DIKU based MUD (Multi User Dungeon) game is one way to go. DIKU itself has a very small code base and is written entirely in C. There's enough code there for a complete game, but not so much that you will struggle to find out what does what.

    Another MUD I can recommend is ROM. It's a larger code base, but still very manageable. And besides, playing a MUD is a lot of fun, especially if you gather some friends on the server.

    Studying a classic MUD will provide you with some solid understanding about many aspects of C programming, and everything is very straight forward.

    At http://www.mudbytes.net/ you will find their Code Repository - an excellent resource for someone learning C.

    Oh, and one more thing. Some of these sources packages, won't compile right out of the gate, so you'll also learn a little bit about tweaking your compiler to make things play nicely

    Best of luck.

  13. #13
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by programmer1 View Post
    Thank you for your advice CommanTater . I ve just thought, they are both C, they must be similar, but it is obvious that they are not
    If you talk to the C++ crowd they will tell you that C++ is C on steroids.
    My experience is that it's more like C on crack.

    The programming mindsets are totally different. It's not just different grammar or new keywords... to fully deploy C++ code you have to *think differently* than you do with C, Pascal, ASM etc.

    Yes most C++ compilers will compile most C code, provided you understand the incompatibilities... In fact we see that here all the time; people inadvertantly using gcc, mingw, vc++ etc. to compile C programs in C++ mode then wondering why things don't work.

    Now, don't get me wrong on this... C has it's share of problems too. The most tragic of which is the total absence of a real string type. Second to that is it's reliance upon the program's stack for variable storage. And it's complete lack of runtime error checking is a very close third. The language itself was conceived at a time when a "virus" wasn't even a glimmer in daddy's eye and through several sweeping updates of the language (google "C89 standard" and "C99 standard" for examples) they have utterly failed to compensate for any of these deficiencies and even insisted that for historical reasons we should not fix them.

    C++ was supposed to address these issues and did not. Even C++ has no native string type (C++ strings require conversion before use with OS APIs) although it has a pretty decent strings library. It still relies upon the stack for everything and has almost no runtime error checking that the programmer himself does not add to programs. Instead they went hyper-complex and created a monster with libraries that pretend to solve problems they do not.

    The next attempt to solve the problems was "managed code" (.NET and JAVA) returning to the bad old days of interpreters and runtime modules in the hope of improving the quality of code. All they really did was to make things yet again more complex for the programmer.

    Ironically, there was a language that addressed all these issues *and* it was around at the same time as C was gaining popularity. Pascal had real strings, created arrays and structs on the Heap not the Stack, and had a full suite of runtime error checks that could be used while debugging your code and even left in distribution code. It was a simple language, different than C but no more complex, but with OSs being written in C, it never really caught on. I worked in Pascal right up until Borland killed it by re-making the language as Delphi, which was a strongly OOP oriented language. The whole thing died a rather untidy death when C++ came along and started making a big fuss about how it was compatible with C.

    To be honest, I've always held that a programming *language* should be as simple as possible (that is, use a minimum number of keywords to guarantee general applicability) be as safe as possible (runtime error checks, exception handline, etc) and be as compatible with the underlying OS API as possible (able to directly import headers and libraries)... But as far as I can tell from extensive searching, such a laguage does not yet exist.
    Last edited by CommonTater; 11-11-2011 at 02:05 AM.

  14. #14
    spaghetticode
    Guest
    @CommonTater - it's "inside" opinions like this that make me doubt sometimes whether learning C++ is really worth the effort. I used to do a lot of Java learning in the past and I got quite far with it. But it never really satisfied me since I wanted to be a bit more "basic" than this. Additionally, I don't like the idea of being dependent on the goodwill of a huge company, especially not with a company like Oracle. I have been a linux user and a follower of the ideas and the philosophy of open source for many years now, and I haven't come across any good news in connection with the name "Oracle". I worked through a basic book of C, but since I like Qt way better than GTK+, everywhere I look I happen to find C++ and OOP.

    I started several times trying to learn C++, but I don't get the feeling I am moving on in any way. I never had that feeling with C, where I definitely saw progress. Parts of me really *want* to learn C++, but then other voices inside my head always tell me that I'd be better off sticking with C and working my way through GTK+.

  15. #15
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by dennis.cpp View Post
    @CommonTater - it's "inside" opinions like this that make me doubt sometimes whether learning C++ is really worth the effort. I used to do a lot of Java learning in the past and I got quite far with it. But it never really satisfied me since I wanted to be a bit more "basic" than this. Additionally, I don't like the idea of being dependent on the goodwill of a huge company, especially not with a company like Oracle. I have been a linux user and a follower of the ideas and the philosophy of open source for many years now, and I haven't come across any good news in connection with the name "Oracle". I worked through a basic book of C, but since I like Qt way better than GTK+, everywhere I look I happen to find C++ and OOP.

    I started several times trying to learn C++, but I don't get the feeling I am moving on in any way. I never had that feeling with C, where I definitely saw progress. Parts of me really *want* to learn C++, but then other voices inside my head always tell me that I'd be better off sticking with C and working my way through GTK+.
    First off, don't get me started on "Open Source"... lets just say "Too many cooks spoil the broth". One perfect example of this is the D programming language. The compiler's author did an amazing job with the core language but then he stupidly opened the libraries for open source development. A year later he's got two competing libraries, both loaded with a bunch of crap nobody will ever use and totally incompatible with eachother. Nobody ever created a full import of Windows API and now the thing is virtually abandoned... Dead D.

    I kept telling myself it was time to move on from C and Windows API... "there just has to be something better" says I... Well after messing with something like 20 or 30 different languages and their libraries I keep on ending up back on C. I seem to either hit a wall where the language just doesn't make sense to me or some grand flaw reveals itself.

    Then after messing with several different compilers and IDEs for C, I always seem to land myself back on Pelles C which, far as I can tell, is the only IDE/Library/Compiler that "does it all" as far as Windows is concerned.

    I've been around this loop so many times I'm getting dizzy. There is no denying that C is lacking (as I outlined above) but experience tells me that it's the only viable alternative I have available to me at this time.

    To be honest... If there was a version of traditional Pascal with a full set of Windows API imports, support for unicode, and a compiler that reliably generated both x86 and x64 binaries, I'd be there in a heartbeat. At one point I "extracted" the base Pascal out from under Delphi, redid the RTL (Run Time Library) to remove dependence on Objects, rewrote a few functions for better perfomance and worked with that for most of 4 years. It worked just fine except for a number of missing Windows imports that I never could get working.

    (And yes I know about "Free Pascal" but as a friend of mine says: "It's an ant farm ... full of bugs")

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Where did you learn it?
    By swgh in forum Game Programming
    Replies: 13
    Last Post: 05-12-2006, 03:55 AM
  2. Do I have to learn C, to...
    By eu.stefan in forum C++ Programming
    Replies: 10
    Last Post: 04-04-2006, 01:37 AM
  3. You have to learn C in order to learn C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 07-16-2004, 10:33 AM
  4. Were to learn.
    By Black&White in forum C++ Programming
    Replies: 9
    Last Post: 05-19-2004, 04:05 PM
  5. how well do you learn?
    By iain in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 11-21-2002, 11:49 AM