Conversation
Notices
-
Embed this notice
Watching a dude give "Tips for C programming" and he spends 90% of his time telling you to not be afraid of memory bugs and to implement concepts like referring to objects by it's array index, not the raw pointer.
This makes it safer of course but by that point I might just as well use Go or Zig or whatever because they've done all that for me and I don't feel like reinventing the wheel badly.
>I have written a struct type generator in javascript that basically does what generics do
>You can just do a unity build to avoid dealing with headers (outdated concept)
Why am I using C?
I have question marks in my pupils.
-
Embed this notice
@WandererUber @tyler and don't forget that it's possible to write C in every language
-
Embed this notice
@tyler I feel like that too in general, but this video left me with the opposite impression and more confused than before.
Thinking back on it, I've basically always just finagled the language and all the "dumb computer shit" they do out of my goddamn way and spent 99% of my time on the code I wanted to work on in the first place. I wrote an entire C simulation but just didn't allocate memory or deal with pointers, and when I used Go I just used it for what it was supposed to do so never ran into any issues.
I think I would really love Zig if I did a big project in it.
in the end, I really don't feel like writing a memory allocator or doing a "unity build" to work around an antique header system. I think it must be possible to have my cake and eat it too in this case
-
Embed this notice
I saw that video and i liked it.
For me, I prefer the C syntax much more than zig and go, and there are less gotchas in my opinion, because less is hidden from you.
-
Embed this notice
@WandererUber @tyler i'm talking about modifying state in 20 places, calling every variable i, j or k, writing zero tests and being a pro at memory handling (only some small leaks that barely crash at all)
-
Embed this notice
@lain @tyler just writing procedural programming style and ignore all the other nonsense or are you talking about something else?
-
Embed this notice
@lain @tyler pill me on hating C?
-
Embed this notice
@WandererUber @tyler https://web.mit.edu/~simsong/www/ugh.pdf chapter 9
-
Embed this notice
@lain @tyler That chapter spends quite a bit of time on UNIX (obviously) and some strange historical artifacts about the time period (pack it up, gramps. No one wants to hear it!) but when they finally get to why C is bad, they immediately propose
>adding hardware support for garbage collection into the last, current and next generation of microprocessors
which sounds completely fucking bonkers to me.
The next point is lack of error checking which sounds reasonable, but the code examples seem extremely dated. I doubt any C programmer is
>allocating a char array that is 80 bytes long because the terminal is 80 characters wide
these days. I get the point though.
you like the "Elixir", huh? Given you wrote an entire fediverse server in it...
I will learn the basics now.