Proper methodology for learning a programming language - /g/ (#105647065) [Archived: 1028 hours ago]

Anonymous
6/20/2025, 4:33:10 AM No.105647065
C programming
C programming
md5: 60d90d05fff900905667759d5e4fccd1🔍
>You just learn a language by doing stuff with it brooo
Ok, I wish to learn C. As someone who is new to programming, how do I even know what to do with a language that's literally designed for low level programming?
>just learn concepts of OS, computer architecture, and shiett bro
Is there any other way to bypass this as I wish to master C, including concepts that involve low level programming, while I simultaneously complete other important topics. Also, recommend really good, exercise based resources-books, courses, etc., for learning C that is both self contained, properly paced in terms of diffuculty and has the solutions for it's exercise problems.
t.someone who already knows the basics of the basic data structures like list, stack and queue and someone who's implemented them using pointers in C.
Replies: >>105647087 >>105647149 >>105647338 >>105647365 >>105648177 >>105648201 >>105648207 >>105648526 >>105648854 >>105648965 >>105649164 >>105650631 >>105650733 >>105652562 >>105653404
Anonymous
6/20/2025, 4:36:32 AM No.105647087
>>105647065 (OP)
I wish to have the feeling that even I could've built that x,y,z thing in C, and I do wish to build that x,y,z thing on my own
Anonymous
6/20/2025, 4:43:38 AM No.105647149
>>105647065 (OP)
You can just do the K N King’s exercises, skipping the text. Only referring back to the text and references when you’re stuck. Not a bad way to learn other subjects like math etc. too.
SIAM has a C programing projects book. Dan Gookin too. Random assholes on the internet also wrote project-based tutorials like Build Your Own Lisp. I don’t recommend them.
Anonymous
6/20/2025, 4:53:24 AM No.105647228
file
file
md5: 582ba2de94cc5a90f481e3cc0f2f831b🔍
Learn to program microcontrollers in C and assembly, modern OSes abstract too much for beginners. Then read pic related and an OS book.
Anonymous
6/20/2025, 5:09:44 AM No.105647338
>>105647065 (OP)
I second starting with microcontrollers. Get an stm or a pic development board and play with the peripherals.

Don't use a premade library. Read the manuals and edit the register directly. You'll get comfortable manipulating memory and you'll think of tricks and stuff to try as you go.
Replies: >>105648290
Anonymous
6/20/2025, 5:12:26 AM No.105647358
I've been programming for over a decade.
- Start with Go. Stick with Go for a solid year, and do not even look at other languages. Go will force you to acknowledge types. Go will force you to acknowledge the basics of looping. Go will force you to understand interfaces, which are one of the cleanest ways to represent heterogenous dispatch. Go has a solid standard library that will allow you to easily develop actual software.
- As soon as you need to start saving data to disk (beyond config files that are only interacted with at application start), use a database. More specifically, PostgreSQL. Failure to get comfortable with relational databases will stall the fuck out of your progress. Relational databases will force you to use transactions (eliminating like 95% of concurrency issues when used with the appropriate isolation levels), queries, and migrations (which allow for the evolution of an application across versions where live data must be maintained). Seriously, get comfortable with Postgres. Use constraints as much as you can.
- Need a user interface? Use Go's `net/http` and deploy a webserver. This can run locally, and be accessed at `localhost:<YOUR PORT>` in any web browser. You can throw it onto a server and access it from a phone or tablet.
- AFTER programming for a year, and actually building real things, you might feel like you understand a lot. You do not. This is when you should spend 3 months with C, then 3 months with Elixir, then 3 months with Racket, then 3 months with Rust.

At this point, it is a choose your own adventure game.
Anonymous
6/20/2025, 5:12:35 AM No.105647359
I was in a competitive programming bootcamp for beginners. They taught C interleaving with data structures and algorithms.
Anonymous
6/20/2025, 5:12:59 AM No.105647365
>>105647065 (OP)
>how do I even know what to do with a language that's literally designed for low level programming?
How is struggling to find a project real hahaha just like stratch an itch nigga, like just solve a fucking problem you have hahah
Anonymous
6/20/2025, 7:13:02 AM No.105648177
>>105647065 (OP)
You're probably ngmi. I rarely see this mindset succeed long term in the low level domain.
Replies: >>105648194
Anonymous
6/20/2025, 7:16:25 AM No.105648194
>>105648177
i have a month b4 my classes start m8 and i wish to ensure that i can start building stuff as soon as my classes on OS begins.
Replies: >>105648232
Anonymous
6/20/2025, 7:17:47 AM No.105648201
>>105647065 (OP)
#!/usr/local/bin/tcc -b -run
// elite languages
Replies: >>105650844
Anonymous
6/20/2025, 7:19:34 AM No.105648207
>>105647065 (OP)
>t.someone who already knows the basics of the basic data structures like list, stack and queue and someone who's implemented them using pointers in C.
You already have it all. Create stuff and keep learning along the way. Most of your headaches won't be with the language itself but fighting the tooling.
Anonymous
6/20/2025, 7:24:13 AM No.105648232
>>105648194
Oh, I see, nevermind, it really doesn't matter then. Just do any of the exercises listed by any anons here. Pay attention to your OS classes, you have every single thing at your fingertips in section 2 (system calls) and 3 (C library) of the man pages on Linux, and pay extra attention to your computer architecture classes, particularly how caching and memory and TLBs really work. Then when done with your degree, digest the C11 and C23 specs before writing a few Linux drivers of your own. Also pay attention to efficient threading.
Anonymous
6/20/2025, 7:34:48 AM No.105648290
>>105647338
Can't you do it with Qemu? Or this shit it's like Arduino?
t. other no-coder JS shitter.
Replies: >>105648322
Anonymous
6/20/2025, 7:39:48 AM No.105648322
>>105648290
You can emulate almost every chip these days, but I think the other anon is saying
>if you want to learn bare metal shit
>actually do bare metal shit
I agree with him.
Replies: >>105648378
Anonymous
6/20/2025, 7:41:32 AM No.105648341
going from 0 programming knowledge to writing a nontrivial, and actually useful, C program took me 6 to 8 years of part-time autodidaction
Replies: >>105649098
Anonymous
6/20/2025, 7:45:53 AM No.105648378
>>105648322
In my case it's for study, practicing. Emulate will help the learning process applying the concepts. Not really baremetal than I can't find any real usage.
These Python is more useful.
Anonymous
6/20/2025, 8:04:42 AM No.105648526
>>105647065 (OP)
>literally designed for low level programming?
C was designed for general purpose programming and was always considered a "high level language" before the semantic drift of that term came to mean gc and interpreted languages

Youre doing the thing that losers who never get anything done do where you give yourself a panic attack thinking you have to become an expert so you accumulate infinite prerequisites and do this infinite regress of preparing to prepare to prepare to start doing X

Just fucking skim the articles on this website: https://www.cprogramming.com/
Think of something you want to make, find the relevant libraries, and make it, while referring to docs/tutorials/gpt when you get stuck
Its not fucking hard
Replies: >>105648622 >>105653404
Anonymous
6/20/2025, 8:21:17 AM No.105648622
>>105648526
>Youre doing the thing that losers who never get anything done do where you give yourself a panic attack thinking you have to become an expert so you accumulate infinite prerequisites and do this infinite regress of preparing to prepare to prepare to start doing X
Used to be this poor guy.
>Think of something you want to make, find the relevant libraries, and make it
And don't be discouraged if it's been made before. Reinventing the wheel teaches a lot about wheels. Not just on some theoretical level but on what it takes to actually fucking make them. Persistence.
Anonymous
6/20/2025, 8:59:58 AM No.105648843
some people only can teach/learn but cant program
Anonymous
6/20/2025, 9:01:07 AM No.105648854
>>105647065 (OP)
If you want to "master" something you need to spend 10 years doing it
Anonymous
6/20/2025, 9:19:50 AM No.105648965
>>105647065 (OP)
You could try to make a project, anything you want really but it could use multithreading and support dynamically loading extensions.
That way you learn something about linking and if you make your own thread pool you learn a lot from that.
Say for example a just empty GUI application that loads library that handles the drawing.

I made such program for testing different filter algorithms and plot the results.
Replies: >>105648989
Anonymous
6/20/2025, 9:23:41 AM No.105648989
>>105648965
To add to that, any plugin system in C forces you to think who is responsible of the memory.

Use clangd for lsp-server, it's really nice.
Anonymous
6/20/2025, 9:38:43 AM No.105649098
>>105648341
You must be retarded
Anonymous
6/20/2025, 9:47:33 AM No.105649164
>>105647065 (OP)
>Proper methodology for learning a programming language
Open up the API, read the part you need, code it in. Oh right you don't actually know how to program you just want to know a language. Well learn French then, I hear it's really fun.
Anonymous
6/20/2025, 1:53:31 PM No.105650559
boomp
Anonymous
6/20/2025, 2:05:56 PM No.105650631
>>105647065 (OP)
Just do this.

Write a command line program, in C, that copies a file. It will take two parameters from the command line, the source file name and the destination file name.

To get this working will give you knowledge of memory allocation, file I/O and parsing of command line parameters.

Having written this will give you the basics, a starting point, a small circle of knowledge that you can build on and expand to write more powerful and useful programs.

Bonus: have the destination file have the same attributes, including protection bits and file time stamp, as the source file.
Anonymous
6/20/2025, 2:19:25 PM No.105650733
durante
durante
md5: b34bd5aebc12b973e88dee54e828447e🔍
>>105647065 (OP)
Picrel is advice from the greatest programmer alive. You won't follow it. And that's fine.
Anonymous
6/20/2025, 2:34:02 PM No.105650844
>>105648201
>#!/usr/local/bin/tcc -b -run
Or do that instead so you can shove your version of tcc anywhere
#!/usr/bin/env -S tcc -b -run
Anonymous
6/20/2025, 6:12:38 PM No.105652562
>>105647065 (OP)
Ask ChatGPT to come up with a crash courtse in C for you
Anonymous
6/20/2025, 7:54:03 PM No.105653404
>>105647065 (OP)
>Ok, I wish to learn C. As someone who is new to programming, how do I even know what to do with a language that's literally designed for low level programming?
C was designed as a high level language by people with skill issues at compiler writing. The "low level" meme was a later cope when people asked why C should still be used when there are more powerful languages widely available.

>>105648526
>C was designed for general purpose programming and was always considered a "high level language" before the semantic drift of that term came to mean gc and interpreted languages
This is almost right but GC and interpreted languages like Lisp, BASIC, and APL already existed before C. It was actually C programmers themselves who created the meme that C was a "low level language" because there were Lisp machines and operating systems written in languages with GC before C became popular. C used to be a high level language that could be used as a systems language like Lisp, Smalltalk, PL/I, Pascal, Algol, Ada, etc. But C programmers did not like that Smalltalk and Prolog were the same "level" as C and equally suitable for OS development, so C programmers invented the "portable assembly" meme.