Conversation
if i just wanna get into C, what do you think? (i already programmed with C++ and rust before)
2
0
1
@themilkman As someone who switched from C++ to C recently, if you can understand the former, you can understand the latter. The language is much simpler to pick up but mostly because it does less for you. That can be a blessing and a curse.

There's fewer footguns than C++ and there's typically only one way to do X rather than the 50 that C++ gives you. Helps keep the cognitive load down and your attention closer to the problem, but you're also expected to solve that problem yourself. No niceties like the algorithm or vector header. You're writing that shit yourself.

Templates are also gone (good riddance), you're expected to do much more preprocessor fuckery. Variadic functions are beautifully cursed and I highly recommmend you try implementing one.

As for the book, cppref has a sub-site dedicated exclusively to C with some good examples and you can learn the whole standard library in a weekend.
2
0
2
@VD15 @themilkman mainnadvantage of C++ is that it's standard library is actually alright and doesn't have to fuck around with C's utter lack of types and shittiest most awful design by committee standard.

C standard library is such a cursed piece of shit that even when I knew little of programming I always thought it bad.

(v[a]_ functions do exist ig making stuff slightly less cursed)
1
0
0
@meeper @themilkman
> C++'s standard library is actually alright

< Eight map implementations, only one is useful
< Random number generation requiring three different classes
< std::move doesn't move anything
< Four different ways to cast, one of which is always considered bad practice
< At least seven secret ways to cast
< Iterator syntax in general
< No format function until C++20
< Math functions not being constexpr until C++26
< Industry still catching up to C++17
< Still no type reflection

With all due respect, bruv, are you high?
1
0
2
@VD15 i wanted something also partially because it's been a good while since i used c++ as well.
but maybe cppref is better for starting out. i usually like learning with a book since i can do it without distractions
1
0
1

@themilkman I mean, if books work better for you, then yea, go for it. Though I think the ANSI C book in question is specifically for C89, which is like the oldest standard version. It'll teach you the fundamentals, but more up-to-date standard revisions have some extra niceties like static_assert, stdint and multithreading. Though unlike C++, 'modern' C isn't that different to old C so it's nbd if you start with C89.

0
0
1
@VD15 @themilkman

i mean like in comparision to C's ig it's at least possible to get by without reimplementing a lot of it . C has stuff like strtok affecting global state

https://nullprogram.com/blog/2023/02/11/ also has a bunch of stuff I agree with.

Part of it is kinda by nature ig, without having the whole mess with templates C is kinda a do most of it yourself kind of lang and why ig glib2 and stuff are so popular
0
0
0
@themilkman it's a great book, and you can probably find it for cheaper if you buy a used copy
0
0
0