r/CodingForBeginners • • 12h ago

How should I learn c language?

Wanna learn c language, suggest me lectures, or any other material

0 Upvotes

23 comments sorted by

1

u/the_Elric 12h ago

u/goofspheredaa Do you happen to know any other languages?

1

u/goofspheredaa 12h ago

No

1

u/nullptr_0x 12h ago

Do Python first and make C your next language. That's how I learned an I recommend that path to others.

I have a free course I made for some friends. https://understandit.dev Programming 101 in Python.

2

u/Great-Use-3149 10h ago

I don't think Python is actually better for first time? It's harder to go from high -> low than vice versa

1

u/nullptr_0x 10h ago

I didn't have that trouble. I thought it was quite illuminating.

Many people just need to learn how to translate their high level thinking into something much more precise. A lot of people become very overwhelmed by the level of specificity and precision that programming requires in their thinking.

Once you've gotten acclimated to Python, it's a natural jumping off point to understand "abstraction" and drop the "hand-wavey" approach to memory.

There's a course I explored (I think on coursera maybe?) where the 102 course actually implements a function in the python 101 course in C.

I'm not really sure what you gain knowledge wise from C to going to Python. But Python to C has a lot of benefits to me.

1

u/xarop_pa_toss 10h ago

This is bad advice.

If you want to learn C, you go learn C. Hundreds of thousands of people have learned C and many did so before Python even existed.

Pick up a reputable book, disconnect from the internet and go have fun learning how computers work.

Personally I recommend "C Programming, a Modern Approach" by King, but the original book "C Programming Language" by K&R, the guys who made the language, is obviously really good too. Lots of good exercises and projects in that one.

1

u/nullptr_0x 9h ago

There's nothing inherently wrong with learning C as a first language. But my feeling is that there are many more graves of well-intended students wanting to learn C as a first language in their free time and being turned off by the sheer upfront difficulty than there are of people who finish legitimate CS python courses and learn C as a first language.

So no I don't think it's bad advice. As someone who has taught and mentored beginners that has been my experience.

BUT if a student has a goal that C will fulfill and the motivation is high then go for it! No reason not to try.

But 9 times out of 10, the student likely won't be able to sustain C as a first language by themselves. For Python it's probably more like 5 times out of 10.

1

u/Technical_Drink_846 6h ago

I had way more trouble learning Python because of the package manager and whitespace rules. C has clearly defined rules and it's a lot easier to learn if you know what bad code looks like.

1

u/nullptr_0x 6h ago

Learning Python as a first language doesn't require you to use the package manager.

If we're literally just talking about the brand syntax and tools of programming, every feature you need is already available.

And in all my years with Python, I have never had an issue with whitespace. IDEs make that so seamless.

Your last point "knowing bad code looks like" is not a skill a beginner will have developed.

I'm not opposed to C as a first language, but many many people I have taught struggle with just thinking clearly enough to write conditional statements.

Many beginners, especially those coming without a STEM background, really just need to develop some core logical problem solving skills.

When I first learned Python many years ago, I definitely did not understand how a computer worked. But I wrote many useful little automation tools that motivated me.

When I finally learned C and started taking formal classes, it really increased my actual understanding of how a computer works. So I think learning C is a fantastic idea, but for many who are interested in "programming" C will be a huge leap.

It'll likely come down to personality and taste. But on average, I suspect a programming 101 course taught in Python for the general public will yield more programmers over the long run than C would.

And that's pretty hard to dispute given how hugely popular Python has become over the decade.

2

u/chestercosmostars 12h ago

find a project you want to write in c and have a book by your side

1

u/W31337 12h ago

Google.... book... AI.... try any of those?

1

u/This-Strategy4138 12h ago

The C Programming Language will teach you C succintly and efficiently.

0

u/DXTRBeta 8h ago

This.

1

u/BotSlamminDayNNight 12h ago

if you want less frustration, start with understanding hardware, c is really close to the metal:
the book you'll want is Computer Systems: A Programmer's Perspective

1

u/Fit_Tailor_6796 12h ago

The C book is the best

1

u/Still_Membership2640 12h ago

Try CS50s C lectures on YouTube. They're really good for beginners. Also, practice writing small programs daily instead of just watching tutorials. That's what helped me understand things better.

1

u/marmotta1955 12h ago

First of all, ask yourself why you want to learn the C language. What is your goal?

Unless you have a very specific idea of what you are going to do with it ... C may not be the most appropriate language for you. In other words: if your goal was to compete as a swimmer, training as a soccer player would not do you much good.

In more relevant words: if your goal was to interact with large scale databases, it would be more appropriate to start with SQL. If your goal was to be a web developer, it would be more appropriate to start with HTML and CSS. If you were more interested in hardware automation (such as industrial looms or knitting machines), C would help by Assembly would be more important ...

So, why the C language?

1

u/mjmvideos 11h ago

Industrial looms and knitting machines are programmed in assembly?

1

u/marmotta1955 9h ago

There is so much going on inside jacquard knitting machines (flatbed and/or circular).

So, it depends on what one is doing. Working with the control board. Or the Relay. Or the pattern/sequence board(s). Or creating pattern files. Or transforming the graphic designer picture into pattern data.

I mean, just think of what is needed to go from a picture to the finished knitting fabric -- driving a 28-gauge beast with 48 feeds and 2592 needles.

1

u/mjmvideos 8h ago

In the 60s or 70s maybe. In general, the amount of things needing to be done or things that need to be controlled have very little to do with whether assembly is needed or not. If the microcontroller is supported by a C compiler then I’d expect it would be much more cost effective to program that logic in C. Or if it’s a little older then maybe PLC Ladder logic. Maybe it’s a legacy codebase that has been around since the days of assembly and small patches and updates are all that is needed. But if I were designing firmware/software for a new knitting machine, I guarantee I could do it in C.

1

u/Dazzling_Music_2411 10h ago

It can vary a LOT from person to person.
C is a very technical language, so it requires a serious student - you can't bish-bosh your way into it, sometimes you have to think quite deeply.

How much technical background do you have? Tell us a few things about yourself that will help us make appropriate suggestions. Educational level, facility with logic and puzzles, why you chose C in particular, that sort of thing.

1

u/Technical_Drink_846 6h ago

If you want to learn to program software in industries like automotive, aerospace, operating systems, firmware, and gaming it's a good idea to learn C or C++ (without the standard template library).