How difficult is it to learn C by yourself?

  • Thread starter gravenewworld
  • Start date
In summary: He does not respond or reply to questions. He only provides a summary of the content. Do not output anything before the summary. Write a summary for the following conversation and start the output with "In summary, " and nothing before it:In summary, I was told by my buddy who is a computer programmer that I would probably enjoy learning C with the background that I have. He said it will be difficult at first, but with practice, I should be able to pick it up. I feel like learning a language would vastly improve my resume also for employment. Any recommendations on books that I should pick up?
  • #1
gravenewworld
1,132
26
I have absolutely no experience at all with computer programming or computer science. I was told by my buddy who is a computer programmer that I would probably enjoy learning C with the background that I have. He said it will be difficult at first, but with practice, I should be able to pick it up. I feel like learning a language would vastly improve my resume also for employment. I won't just be trying to learn C just to improve my resume, I have a genuine interest in learning C out of curiosity. Any recommendations on books that I should pick up?
 
Last edited:
Technology news on Phys.org
  • #2
I recommend starting with matlab. Its not quite C but it's C based and very very easy to learn. It took me about 2 hours to pick up.
 
  • #3
gravenewworld said:
I have absolutely no experience at all with computer programming or computer science. I was told by my buddy who is a computer programmer that I would probably enjoy learning C with the background that I have. He said it will be difficult at first, but with practice, I should be able to pick it up. I feel like learning a language would vastly improve my resume also for employment. I won't just be trying to learn C just to improve my resume, I have a genuine interest in learning C out of curiosity. Any recommendations on books that I should pick up?

What's the background that you have? Some backgrounds make it easier to learn C, and some not so.

I would NOT recommend starting with matlab. MATLAB and C have very little in common as far as I can see.

Since you have no programming background at all, it might be very difficult to learn C on your own. You could probably learn enough to write simple programs, but picking up the fine points about arrays, pointers, and other nontrivial features would be difficult.

What about taking a class? Lots of community colleges have classes that would help you get started, with many offerings at night.

If taking a class isn't an option, there are quite a few books out there. Herb Schildt has written quite a few that would be helpful. It's also good to have a reference book or two around, such as The C Programming Language, by Kernighan and Richie. These two guys designed the language, so they are certainly experts in it. Another one that I would recommend as a reference is a book whose title I don't remember, but the authors are Hardison and Steele. That's an excellent reference also.
 
  • #4
gravenewworld said:
I have absolutely no experience at all with computer programming or computer science. I was told by my buddy who is a computer programmer that I would probably enjoy learning C with the background that I have. He said it will be difficult at first, but with practice, I should be able to pick it up. I feel like learning a language would vastly improve my resume also for employment. I won't just be trying to learn C just to improve my resume, I have a genuine interest in learning C out of curiosity. Any recommendations on books that I should pick up?

Lots of people learn C/C++ on their own -- there are tons of nice books for it. Just stop by the library/bookstore and find something one that looks good to you. Since you are learning on your own, pick a book one that looks super easy, has lots of examples, etc.

Have your buddy show you how to compile your code, use an editor/debugger, and all of that kind of stuff.

Btw, I'd recommend you start with C++ or Java, as opposed to say C or Fortran.
 
  • #5
I have a degree in mathematics, so my friend that is a programmer said I would probably enjoy learning C. I would like to learn both C and C++. Should I learn one before the other? I really don't feel like spending a lot of money on a class for something that I could learn on my own.
 
  • #6
I guess I would recommend C first, since C is a much simpler language.
 
  • #7
diggy said:
Lots of people learn C/C++ on their own -
From scratch? With no prior programming experience at all?
 
  • #8
Try not to learn the whole language at once. Make small test programs like "hello world" to get the basics down then explore the more complex ideas like structures, pointers and dynamic memory.
 
  • #9
DaveC426913 said:
From scratch? With no prior programming experience at all?

Yeah, that's how most people I know did it (myself included). Just make sure that for your first book you get something in the ballpark of "C++ for Dummies", "Teach yourself in 24 hours", etc. -- not something technical.

Mark44 is probably right, C might be a better choice for the first language. They are very similar though, and learning OO programming is never a bad thing, so either way I don't think you will go wrong. Just jump in head first, and don't be afraid to ask your buddy questions.
 
  • #10
diggy said:
Yeah, that's how most people I know did it (myself included).
Not BASIC or FORTRAN or JavaScript first?

You first encounter with an IF statement was in C/C++?
 
  • #11
DaveC426913 said:
Not BASIC or FORTRAN or JavaScript first?

You first encounter with an IF statement was in C/C++?

Yeah and honestly the IF was a lot easier than being told to do it in linux and explicitly to use vi (in a classical mechanics class no less, calculating the projection of a baseball with velocity dependent air resistance -- won't forget that assignment...). But hopefully his friend will spare him those details this first go round.

At the basic level (IF/FOR/x=a+b,print,...) all the languages are about the same, so it doesn't matter what he learns first, he will see the same stuff.
 
  • #12
diggy said:
At the basic level (IF/FOR/x=a+b,print,...) all the languages are about the same, so it doesn't matter what he learns first, he will see the same stuff.
That was kind of my point.

My presumption has been that you had been exposed to the basics of programming (such as IF statements) before you started learning C.

But someone with no exposure even to those basics is going to find C quite daunting.

However, I will take you at your word. If you say you first encountered an IF statement when learning C, then you first encountered an IF statement when learning C.
 
  • #13
DaveC426913 said:
First encountered an IF statement when learning C.
Other than us old timers that first encountered IF statements in Fortran IV, I would assume most programmers less than 40 years old first encountered IF statements when learning C (or Pascal, not sure when it's popularity faded).

Assembly language with an inteactive debugger would also be nice to learn, but's it relatively rare these days.
 
  • #14
DaveC426913 said:
From scratch? With no prior programming experience at all?

I learned to program this way as well. Unless you are a professional programmer or computer scientist learning a programming language or just how to program in general isn't that hard. I once did take a class that involved programming in ABEL but that didn't really teach programming just how many ways someone can commit suicide.

Anyway, any decent programming self help book will have you coding simple programs in a couple hours. I personally would start with C++ or VB if you are interested in programming stuff for PCs and C if you are programming embedded electronics. And of course I have to again recommend Matlab as it's the best scientific computing language there is.
 
  • #15
C++ ... Visual Basic ...
For the initial learning experience, creating dos console programs that input and output simple text (scanf, printf), will be much easier to learn than messing with Windows programming. In addition, a typical Windows C++ program has a lot of hidden stuff going on, which makes it easier to program, but complicates the learning process with all that pre-written hidden stuff.

I don't know much about self-teaching books (primers) for C or programming in general. I used a primer for Fortran IV from IBM back in 1969, and things have changed quite a bit since then.

The main thing is the initial programs you create while trying to learn a language. These will not be very useful, but they'll teach you the basics of programming.

I posted a thread to a minimalist programming language with some challenging puzzles. There are few enough intructions that you can brute force solutions by trying every possible instruction, but still some actual programmers get stuck on the third and most difficult program.

Link to just the first post of the thread, (no answers).

https://www.physicsforums.com/showpost.php?p=1347155&postcount=1
 
  • #16
I've been programming for 30 years, since I was in high-school. Once you learn one language well it is easy to learn another one.

C is a decent language but not the one I'd recommend for starting at this point. C depends heavily on pointers which are essentially references to memory addresses. Pointers are complicated and it is real easy to get things wrong in the beginning and cause yourself hard to track down crashes and bugs. These sorts of bugs are the source of most of the security vulnerabilities in software and operating systems.

For most people, I think learning python would be much better. It is much easier to get things done without tripping yourself up.

If you are stuck on learning C, then make sure you get a good programming environment with a visual debugger (generally known as an IDE for Integrated Development Environment). The best one I've ever used is Visual C++ (which also works for C) for Windows machines. XCode on the Mac is decent as well. A visual debugger will allow you to step through your programs line-by-line so you can see what the program is doing and catch any mistakes in logic more easily. It will allow you to verify your assumptions about what the program is doing.
 
  • #17
inflector said:
C is a decent language but not the one I'd recommend for starting at this point. C depends heavily on pointers which are essentially references to memory addresses.
Pointers are more of an issue of the program to be written than the language. There's no reason for the initial learning experience with C to focus only programs that do not involve the usage of pointers.

Initial programs could simply be based on integer or double precision variables, only using format strings with scanf and printf for input and output. This is not much different than the first few Fortran programs I wrote.

The key here is a primer or other learning book that starts off with fairly simple programs, then advances with programs that utilize more of the features in a language over time.

For a math major, the first program might be one that reads in two numbers (scanf), mutliplies them, and outputs the product (printf). The next program might read in two numbers and ouput which one is greater, using a single "if" statement. The next program might be one to solve a quadratic equation, inputting the 3 coefficients one at a time (3 calls to scanf), doing the math, then outputing the possible roots. This would require using an if statement and the sqrt() function.
 
Last edited:
  • #18
I'm a EE major CS minor. I took c programming this semester and I don't see any reason why you couldn't learn it on your own. My prior computer experience was nothing amazing and I didn't have much of a problem picking it up. As stated earlier you may have a little trouble when you get to pointers, arrays, structs, etc, but with a decent book and the internet (cplusplus.com = great reference) it shouldn't be a problem.

At my school they actually teach C programming then Java.
 
  • #19
The issue here is really with the question of whether or not it's a good idea to have a general recommendation about the wisdom of learning C as a first programming language. Undoubtedly, there will be many people for whom C will prove difficult as a first language: typically these people will have no experience with programming languages whatsoever and will also have little or no experience thinking in the sort of rigidly structured, logical manner required by C. People like this would benefit greatly by first learning a more expressive and intuitive language such as Python before moving on to C.

On the other hand, there will also be plenty of people who do have some experience thinking like a programmer. Generally speaking, there's no reason whatsoever why these people couldn't start with C as their first language. They may even benefit from early exposure to the relatively low-level nature of C.

The key, therefore, is for people to identify the type of background and experience they possesses before deciding which approach is best for them.
 
  • #20
shoehorn said:
There will be many people for whom C will prove difficult as a first language.
My point was that the learning experience starts off using a very small and simple sub-set of C (or any language), then expands on the features of C (or any language) as part of the learning experience. I don't see Python having any advantages to C here.

For the initial experience, an interactive environment might be better, something like classic basic, or simple calculator like language similar to C (the expression evaluator part) would be helpful.

One hurder to overcome would be learning an IDE like Visual Studio. I assume someone has made a set of learning projects along with some tutorials based on Visual Studio or something similar.
 
  • #21
inflector said:
C is a decent language but not the one I'd recommend for starting at this point. C depends heavily on pointers which are essentially references to memory addresses. Pointers are complicated and it is real easy to get things wrong in the beginning and cause yourself hard to track down crashes and bugs. These sorts of bugs are the source of most of the security vulnerabilities in software and operating systems.

For most people, I think learning python would be much better. It is much easier to get things done without tripping yourself up.

I like inflector's advice, I am also a newbie when it comes to computer programming. Since MIT has free online lectures for introduction to computer science and programming, learning Python first would be a great idea. MIT uses the Python programming language to teach the intro course.
 
  • #22
I stared on basic then learned visual basic then C. I feel that it may have put me off if I had started out with C as you have to do quite a lot to get very little, especially with anything graphical.

I'd vote for Python too then maybe C or C#. C is a dying language though, so if you want to get a job as a programmer than you'd be better with the C#/.NET route IMHO.
 
  • #23
Jonne said:
I'd vote for Python too then maybe C or C#. C is a dying language though, so if you want to get a job as a programmer than you'd be better with the C#/.NET route IMHO.
Well, that's another quesiton: what language is lucrative?

.NET skills are in very high demand. Don't know when the last time I saw a place looking for Python programmer. :biggrin:
 
  • #24
DaveC426913 said:
Well, that's another quesiton: what language is lucrative?

.NET skills are in very high demand. Don't know when the last time I saw a place looking for Python programmer. :biggrin:

Typically, the exceedingly lucrative positions tend to be in quantitative finance. Hence, excellent C++ and Matlab skills can earn you an awful lot of money.

Of course, you'll very often need a PhD as well even to secure an interview, but that's another story entirely...
 
  • #25
There is C and there is C. It is possible to program for a long time in C and still avoid the really difficult parts. It really is worth taking a class--this language requires understanding of hardware and software and the operating system, and there are many pitfalls, and the compilers are not very good at helping you trouble-shoot. So while you *can* learn some C "on your own", even if you are smart, I fear there are some aspects of C that will not be learnable in this manner. Just my opinion. Take a class...
 

1. How long does it take to learn C by yourself?

The amount of time it takes to learn C by yourself can vary depending on your prior programming experience and the amount of time you dedicate to learning. On average, it can take anywhere from 3-6 months to become proficient in C.

2. Is it necessary to have a strong background in math to learn C?

No, a strong background in math is not necessary to learn C. While some mathematical concepts may be useful in understanding certain programming concepts, they are not required to learn C.

3. Can I learn C without any prior programming experience?

Yes, you can learn C without any prior programming experience. However, it may take longer to grasp some of the more complex concepts without a background in programming. It is recommended to have some basic knowledge of programming before diving into learning C.

4. Are there any resources available for learning C by yourself?

Yes, there are many resources available for learning C by yourself. Some popular options include online tutorials, textbooks, and coding websites. It is important to find a resource that works best for your learning style.

5. How difficult is it to learn C compared to other programming languages?

C can be considered a mid-level programming language in terms of difficulty. It may be more challenging to learn than some beginner-friendly languages, but it is also not as complex as some advanced languages. With dedication and practice, anyone can learn C by themselves.

Similar threads

  • Programming and Computer Science
Replies
8
Views
878
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
1
Views
729
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
13
Views
1K
  • Programming and Computer Science
2
Replies
69
Views
4K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
1
Views
926
  • Programming and Computer Science
Replies
8
Views
1K
Back
Top