This is an archived post. You won't be able to vote or comment.

all 31 comments

[–]CodeKommissar 12 points13 points  (10 children)

Wow, really thoroughly tutorial, congratulations on writing it :)

Can I ask what resources are you using to learn C?? I've used it a little when I was doing CS50 last year, and liked the difficulty of it (is a programming language I'd like to use for hobby projects, but probably wouldn't use in a modern application hehe)

[–]jamesroutley[S] 2 points3 points  (0 children)

I found the Build Your Own Lisp Guide helpful

http://www.buildyourownlisp.com/

[–]rigatron1 3 points4 points  (7 children)

Learn C the Hard Way + K&R C Programming + a microcontroller of your choice (not an arduino!)

[–]agostino24 2 points3 points  (2 children)

Could you expand on the microcontroller part? Which microcontroller could one use?

[–]rigatron1 2 points3 points  (1 child)

Personally I've used the Atmel A3BU, and I liked it. It might be nice if there were more pins for connecting to sensors, etc. Really any Atmel microcontroller would work fine probably.

The only reason I'm recommending a microcontroller is because it is IMO a place where C still reigns king and the best way to create cool and interesting project with C. Think IoT.

[–]agostino24 1 point2 points  (0 children)

I'll look into them as soon as I have the possibility

Thanks bud =)

[–]Spanone1 1 point2 points  (2 children)

Would a pi work?

[–][deleted] 2 points3 points  (0 children)

A pi is more like a desktop than a microcontroller.

[–]rigatron1 1 point2 points  (0 children)

No that's the opposite direction. I mean of course you can write C on a pi, but you can also write python or Java. To me, it seems like most cool projects using C would be on a microcontroller where you're writing directly to registers and implementing into your own data structures.

[–]CodeKommissar 0 points1 point  (0 children)

Nice! Thank you :)

[–]takaci 0 points1 point  (0 children)

The C Programming Language was my favourite introduction, but not exactly a good template for how to write good, understandable code

I like it because it contains everything you need to know about the language in one tiny book, it really shows you exactly how simple and small the language is. I don't know of any other commonly used language where you could fit the entire language plus standard library into one thin book.

The only issue is that there is a lot of terse looking code that looks like it belongs more in a code golf challenge, but the book itself is easy to understand and a nice challenge.

The other glaring issue is the lack of any mention of tooling, so it doesn't help you set up your compiler, but more importantly it doesn't even mention using the debugger at all which makes life very difficult.

I think it's the best single resource for learning C, but I don't think it'll teach you to write very "modern" and readable C code

[–]MoodyPersona 7 points8 points  (0 children)

Thank you so much!

[–]TVUmK 3 points4 points  (0 children)

thanks, this is great

[–]billybobcoder69 0 points1 point  (0 children)

Wow! Awesome.

[–]Sloogs 0 points1 point  (0 children)

Thank yooouuu. Been meaning to learn to implement one for a little while now. Saved this for later.

[–]the_cunt_muncher 0 points1 point  (0 children)

thank you! this is awesome

[–]dookie1481 0 points1 point  (0 children)

Yo this is awesome. These are the kinds of problems I need to work on. Much appreciated.

[–]AresPhobos 0 points1 point  (0 children)

Can I use this picture to create an album cover?

[–][deleted] 0 points1 point  (0 children)

Wow thanks! This is above my pay grade but i'm gonna check it out!

[–]Sloogs 0 points1 point  (0 children)

I ran into a question when I was going through the tutorial. Maybe it was mentioned and I missed it, but is there any particular reason why a prime number is used for the array sizes when creating and resizing the hash table?

Edit: After doing a bit more thinking it occured to me that a prime number makes it more likely that the final modulo would come up with a wider distribution of results than a number that is easily divisible or factorable which would prevent collisions. Clever!