r/C_Programming • • May 30 '26

Discussion Rebuilding my programming knowledge with C

Recently, I started rebuilding my knowledge of programming through using C. JavaScript was what I had access to for a decent amount of time, I would poke around in browser consoles and whatnot, and it's been my language of choice for a while. But, I need a shift and proper knowledge and foundations. All of my current knowledge is self taught, and it will basically continue to be (college python course notwithstanding), but I'm going through with learning C and basing my learning off of it. As well, C ties into what I've been wanting to dive into, native programs and maybe even some systems stuff. I've even been itching to do some microcontroller stuff but that'll come eventually. C gives me a base of a typed language from the getgo that JS doesn't. I'm using the 2nd edition Kernighan and Ritchie book, knowing that it's C89 but I'm working with more modern syntax, and so far it's going good, I think. Projects like Nic Barker's Clay and Ramon Santamaria's/raysan5's raylib and related libraries are quite inspirational in a way. I don't mean to be pretentious or whatever but these easy to use wholly C libraries are helping me keep my drive in learning and using C.

Will C be my go to going forward? Maybe not for everything, but I'll try to focus on using it when I can. I've already got a simple enough yet useful project idea I'd like to try my hand at, a simple static site generator. Hopefully that'll come soon, but in the meantime I've still got my learning cut out for me.

31 Upvotes

8 comments sorted by

11

u/Eidolon_2003 May 30 '26

I think it's good that you're wanting to focus on proper knowledge and foundations. In my opinion it's easier to write good code once you've gained an understanding of what the machine is actually doing with the code you give it.

You should pay attention to how the code is structured in some of the libraries or other code examples you're looking at. In my experience it can be hard for people who are fully bought in to OOP to imagine what programming without OOP might look like, and how you would structure the code without it. I don't know if that describes you, but I thought I should mention it. You don't need classes to design a well architected program.

3

u/junipyr-lilak May 30 '26

You've read me like an open book, though I myself am unsure quite how fixed on OOP I am I do know that it is what I default to. I'll try to avoid C++ as long as I can to keep my focus on non-OOP code and really get into it before bringing myself back to OOP if possible

4

u/Eidolon_2003 May 30 '26

You don't have to avoid C++ to focus on the procedural style. C++ doesn't force OOP on you. I do think it's a good idea to focus on C at first though. If you do plan to move on to C++ in the future, I think C is a very good foundation to have. Same thing you were talking about with wanting a good foundation.

I myself write more C++ than I do C right now, but I don't write "modern" C++ generally speaking. I write C++ like C but with C++'s extra features sprinkled in when I find them useful. C++ is a lot more than just C with OOP.

1

u/enoch_twumasi Oct 30 '26

If you want a more modern C (C23) book that’s trustworthy, I’d suggest Effective C 2nd Edition, by Robert C. Seacord.

If you wanna know more about Robert C. Seacord and Effective C, Read the Overview from The book on Oreilly media I’m posting below.

——

Overview
The latest release of the C programming language, C23, enhances the safety, security, and usability of the language. This second edition of Effective C has been thoroughly updated to cover C23, offering a modern introduction to C that will teach you best practices for writing professional, effective, and secure programs that solve real-world problems.

Effective C is a true product of the C community. Robert C. Seacord, a long-standing member of the C standards committee with over 40 years of programming experience, developed the book in collaboration with other C experts, such as Clangâ??s lead maintainer Aaron Ballman and C project editor JeanHeyd Meneide. Thanks to the efforts of this expert group, youâ??ll learn how to:

Develop professional C code that is fast, robust, and secure,

Use objects, functions, and types effectively,

Safely and correctly use integers and floating-point types,

Manage dynamic memory allocation,

Use strings and character types efficiently,

Perform I/O operations using C standard streams and POSIX file descriptors,

Make effective use of C’s preprocessor

Debug, test, and analyze C programs.

The world runs on code written in C. Effective C will show you how to get the most out of the language and build robust programs that stand the test of time.

New to this edition: This edition has been extensively rewritten to align with modern C23 programming practices and leverage the latest C23 features.

Updated to cover C23

1

u/Happy-Purple2979 May 31 '26

Your story sounds similar to mine. I was not using C for almost 35 years and just like you, Javascript has been my go to language of choice. In my case, I have mostly been using it in a NodeJS environment. What C I was doing, was strictly in the Arduino IDE as I have been playing with microcontrollers a fair bit.

At the beginning of this month, May, I suddenly got motivated to do a more serious C type project. At first, I started out writing it in typical Arduino style, but I became concerned with memory management as my project used up a fair bit of the available ram. This got me thinking that I should maybe try and stick as much as possible to standard C. It was at this point I realized how spoiled I was by both using OOP and the extra hand holding that Arduino does. But I am getting the hang of it.

Having a good project in mind helps a lot, in my case I wrote an emulator. Using standard C was a slow start, but after a few thousand lines of coding in it, I am starting to get the hang of it. Not totally, though, as I still using only a subset of standard C.

As far as struggles, I now remember much more work it is to use strings, but I mostly have that part down. Hope you find a good project to get you started on the road to learning.

By the way, I also started writing my code to run on linux using gcc, to ensure I don't use any C++.

0

u/[deleted] May 30 '26

[deleted] — view deleted comment

1

u/dronmore May 31 '26

ontologically light travels at c speed

By definition. Yes.

it ALWAYS does so

Yes, BY DEFINITION nothing travels faster than C; neither Zig nor Rust nor C++.

light is not privileged but it kind of is

Full spectrum light is white. There's also more light in the suburbs than in slums. So yes, one could argue that light is privileged.

nothing else is?

Gnomes are too. They have direct access to my PC, and they spam my reddit account when I'm not around.

1

u/C_Programming-ModTeam May 31 '26

Your post breaks rule 2 of the subreddit, "Only C is on topic". Your post appears to be primarily about something that isn't the C programming language.

Please note that C, C# and C++ are three different languages. Only C is on-topic in this sub.

This removal reason also covers posts that aren't about C or any other programming language.

Only C is on topic - This subreddit is about programming in the C programming language. Content about other languages such as C++, C#, or assembly or programming in general is only on-topic as long as it relates to the C programming language. Merely trying to reach an audience of C programmers is not enough to make your post be on topic. See https://www.reddit.com/r/C_Programming/wiki/index/getting-help/not-c/ to find out where to go for help with other languages.