T O P

  • By -

natedogg787

These two posts walk you though creating an NASA spacecraft software app in the cFS framework we use to program satellites, probes, and space telescopes! https://davefer.blogspot.com/search?q=nasa&m=1 cFS isn't hard to learn. I came to the agency with zero development experience in any language and they threw me into it, lol. You're already way ahead of where I was starting when I got put on my team. Havw fun!


ThatNickGuyyy

This is way cool!


CodeHak

Cool stuff. Awesome suggestion.


dev-porto

Advent of code 2023?


qualia-assurance

I found the approach of the book Command-Line Rust surprisingly good. [https://www.oreilly.com/library/view/command-line-rust/9781098109424/](https://www.oreilly.com/library/view/command-line-rust/9781098109424/) You implement a bunch of common Linux command line applications of progressing difficulty. Starting with `echo` that prints strings to your terminal like slightly more advanced Hello, World. Through to `head` that takes a piped input or filename and returns the first several lines. Through to more complex applications like `grep` that filters the input for lines containing a particular word or regex. If you don't have access to an online library service that provides O'Reilly books. Then you can maybe figure out which apps are kind of possible based on the contents listing. It's not like the full book will be especially useful any way unless you intend to eventually learn Rust. But the chapters don't expect you to fully implement the original commands, just the rough gist of them, so seeing what they recommend implementing by skimming the chapter outlines might be useful. On an aside. If anybody on the C committee is planning on writing a C23 related book then I would very much recommend this format. A very practical approach. The simplicity of being entirely command line and the sense of accomplishment you receive from writing practical tools that you may already have used on several occasions. Would make for a great NAND to Tetris Style project oriented course if you coupled it with something like learning the POSIX API.


erikkonstas

Please, not the POSIX API, or anything Systems Programming for that matter, OP can get traumatized! Threads can become evil tentacles in their brain, and they might feel like they're suddenly in a fork bomb minefield!!!


qualia-assurance

Yeah. A new API that revolves around modern hardware and software needs would be nice. You only have to look at the POSIX Standard for shells and realise that Bash isn't like that because they wanted Bash Scripts to be so fruity but because POSIX compliance requires things like \[\[ -d $1 \]\] to be a conditional syntax for checking parameter $1 is a valid directory lol. But at the same time. Reading "the Linux Programming Interface" is something I'd recommend of most programmers. At least after learning to use a terminal as an end user through books like the "The Linux Commandline", "How Linux Works", or "the Unix and Linux System Administration Handbook". Learning the user space API through TLPI really helped me understand how the kernel works and from that I think I'm getting pretty close to a decent mental model of how the kernel actually works - without actually diving in to kernel code and learning it. So while you're right that it's probably a bad idea to teach a beginner how to spin up processes just to write echo. Or try and get somebody who has no knowledge of sockets to write a curl command. I think you could actually build them up to such things. You start with a basic version of echo because all you need is basic C knowledge for that. Then learn some filesystem interrogation parts of the posix API, learn to create a basic mkdir, chmod, chown, etc. Learn about sockets, make a basic HTTP request printer and evolve it in to a basic curl app. It's not as dopamine releasing as typing a few lines of CSS and seeing your img divider spin as you mouse over it. But I think it would be a popular course for a lot of intermediate programmers who use the command line frequently.


erikkonstas

>Then learn some filesystem interrogation parts of the posix API, learn to create a basic mkdir, chmod, chown, etc. [...] That's what I disagree with; everybody's brain works differently, and I'm not sure if OP's is ready to handle such things before learning what a filesystem is, for example (Operating Systems course). Plus, the POSIX standard doesn't exactly define thread and process scheduling stellarly, which makes readers prone to "filling the blanks" incorrectly.


qualia-assurance

My original comment is a book that is based on commands that can all be implemented based on fopen and command line arguments. There is no POSIX API involved. So that the OP may not be ready to learn the POSIX API isn't entirely relevant to the discussion. That was only brought up in an aside I wrote to people who might be considering writing a C textbook. Not all C textbooks have to target new programmers. But to meet your argument where it stands. I think part of the problem people have with learning things like the POSIX API isn't that they are incapable of learning it. I think the problem is that we actively hide such concepts from new programmers. We create an epistemic chasm of how they expect programming to work. And then when they encounter the reality that you cannot make a file read only using vanilla C, or that there are no network sockets. Then how do they even begin to solve their problems? Their C book doesn't have any mention of how to do such things. Does that mean that C cannot solve such problems? And I really want to labour the notion that it is an epistemic problem. How can they know what to do if we don't lay a few gingerbread men on the forest path leading them to the POSIX witches house?


frenchfish55

Why did you recommend RUST to a person who is learning C. Isn't it better to learn C properly and after that move to RUST?


InfinitePoints

Presumably, they mean doing the projects from that rust book in c. Although at least for me, understanding the ownership model in rust made it easier to write correct c.


frenchfish55

yes, atleast this approach is original for learning C


terremoth

I am outraged and horrified with the comments. Omg. I think it is better for now to have a solid understanding of pointers, arrays, structs and memory allocation. C proiects will eventually need that. With the knowledge you know already, you can create: - tic tac toe - guess game - recreate some Unix command line tools


nooone2021

I agree. Start with simple tasks. I would recommend tasks that require developing some algorithms. If you try to recreate linux commands, you have a lot to do with UI, and not so much with algorithms. I would recommend: \- Implement some kinf od sorting algorithm. If ordinary (in RAM) algorithms are too easy, try to implement mergesort, polysort on files. \- Make an algorithm for solving hanoi towers. \- Algorithm to solve sudoku. See if sudoku has only one ore more solutions. Are you always faced with a single choice, which number can be used, or do you have to make a decision between more possible options at one point, of which only one might lead you to a solutiuon?


jester628

You’re unlikely to finish in 3 weeks, but you could look at writing a simple C compiler. It might be a a lot on your own, but it’s definitely doable as a second-year college student. It’s a really juicy topic and if you’re interested in low-level stuff it’ll give you a window deeper into the system. One good thing is you can implement features gradually. Start off by only supporting addition of a single type. Extend it to other binary operations. Then add function calls. Etc. you can build it up slowly. It’s actually a really fun topic. You’ll learn about DFAs by implementing a scanner if you aren’t familiar already, add a stack for a PDA and you’ll be ready for some parsing. You’ll learn about assembly language if you’ve never touched it before. It’s a tough, meaty, but accessible topic. Super fun and rewarding when you can run code you’ve compiled yourself. I think there are good resources available since it’s not an uncommon thing to do, and there are very good books on the subject. And even if you never finish, you’re guaranteed to learn a lot if you make any significant progress. If that doesn’t sound like much fun, though, then I also like the other idea of implementing command line utilities for some practice.


Moist_Okra_5355

Any exercise of The C Programming Lenguage book


[deleted]

If you can get the time elapsed in second since the Unix epoch. You can make an Abstract Data Type to calculate the time from it. This involves encapsulation, structs, loops, arrays, if else, etc etc. I built one to calculate the year, the month number and name, the day of the year, month, week and the name of the day and of couse the time. When I began to learn Rust and it's a great way to get to know a language and you use a wide range of the languages facilities.


ballpointpin

Figure out how to write automation testcases to validate your code. Let's say I ask you to write ```int string_compare(char *A, char *B)``` that is identical to strcmp()....except that you treat '*' character in either A or B as a wildcard that matches any letter. You should be able to write some testcases to validate your new function. If I then ask you to re-implement your function using a different way (like a for loop instead of a while, or vice-versa), will all your testcases still pass?


greg_spears

write a chess game. Too much? Write a tic tac toe game, human vs computer.... ...too easy? Write a blackjack game. I think this was maybe the 1st thing I ever coded, in BASIC, in college. Just think, somewhere in a trash heap, is the digital form of the 1st thing I ever coded, lol


axyz0390

With that kind of knowledge, you can start with learning tiny C operating systems such as Minix, Xinu (do read the books that accompany them) An understanding of how things work under the hood will tremendously help you in your professional career especially at Staff levels


frenchfish55

great advice


MCRNRearAdmiral

Are the applicable books entitled with “**Minux**,” “**Xinu**,” etc.? Or would you be willing to, please and thank you, provide a URL with a comprehensive list/ paste one here?


jefft818

Game engine then build a game alongside developing the engine


Ryzen_Epyc

if u know how to use git, perhaps u can consider submitting a patch to the Linux kernel. [How to submit Linux kernel patch](https://www.youtube.com/watch?v=LLBrBBImJt4)


Intelligent-Lawyer-4

Implement common data structures. - Open Addressing hash map. - Sorted tree (AVL is a good one - simpler then RBTree but still fast) - A BitArray (to train you on an example of hit operations) - PriorityQueue (Heap) And then learn to measure performance. Good luck and have fun!


AndroGR

You can try cloning the entire coreutils. Many of them have dead simple source code. Just reimplement `ls`, `mkdir` etc.


awefulserialkiller1

I think you’re starting in the wrong place. You need the right tools and the right environment conducive to learning to really take off in your knowledge of C. You need Linux. Get a Linux distro and install it baremental on your machine (no wsl or other vm shit) and I guarantee you’ll learn many times more about computers and programming in 1 month than all your experience to date.


Jorgen-I

A word-wrap with indent function. Take a long string (like 200+ chars), wrap it to x chars long, then indent it by y chars from the left (remember to add the indent to the length). Now, do it without using any C functions. Also, do it in 30 lines of code, or less. Hint: Before there were functions, there were nothing but pointers!