Why C is a simple language?

when I put the exact same question on google I only get things like "Is C worth in 202n?" or "Why you should learn C?".

C is simple compared with other languages such as Python, JS, Ruby etc. because of it's library variety? I mean, C doesn't have a 'pip' or 'npm'.

It's a really elementary question (maybe). Thank you C wizards!

reddit.com
u/rias_dx — 1 day ago

getting blind.

Recently I noticed that my vision is getting worse, and this shit is the most uncomfortable feeling of my entire life. I guess I have enough money to buy glasses, but is literally ALL I have and only for the glasses.

I spend 12 hours or more on computer. All I need is here. I read, code, watch, ALL I NEED IS HERE, FUCK. About 3 months ago I started jumping rope and getting some sunlight, but it's too late.

I read that the eyes can recover themselves after some months, so I think I'll need a break or slow it down.

I know we all have our mental issues and "fuck tha shi", but take care bros. I'd prefer 10000x get deaf than blind, fuck.

reddit.com
u/rias_dx — 8 days ago

How do I store and retrieve data for items from a file during runtime?

When I see people implementing (really) simple RPG games in C they store the item data on the stack. But, since the stack is small in order to store the Terraria's item database, for example, how to store it properly and restore later?

I could use the a JSON file and then use the cjson lib to restore it, but I want to void external dependencies. I'm only using standard lib.

My first thought was store the item data using a specific format in a .txt file and then retrieve it, but it will get bigger and become slower (I guess it's o(n)). And, also, I'd need to implement a parser (I don't know how to implement it).

It's not about storing the player save, but the items properties in order to retrieve it later.

I don't even know to google it (I tried google it). Need help.

reddit.com
u/rias_dx — 13 days ago

When do you create your own data types for your libraries?

TLDR: What is the main purpose(s) of create your own data types for your libraries? Just typing convenience? like, instead of unsigned int * just type ui *?

non-TLDR: I was watching this video and, in minute 2:44, I was thinking about this post title. After reading the comments, I read the following question: "why did you define macros for malloc() and free()?"

The answer was: > I stopped there because this type of coding is code smell. It is a nightmare to maintain. Same issue with the macro to redefine true and false. The code smell is using macros to redefine the semantic of library functions and the semantic of the language itself. A saner approach would have been to not redefine true and false but have the variable name carry the semantic and call the malloc and free. Using macros to change these names is entirely wrong.

I didn't understood exactly what it means, so if you're interested to explain it, I'll appreciate.

edit: thanks a lot for all answers. My account is really new, so I can't comment without needing mods approval, so... thanks.

u/rias_dx — 21 days ago