C Programmer Serializes a Struct
void serialize_struct(struct my_struct *ms) { struct json_object *obj = json_object_new_object(); struct json_object *arr = json_object_new_array(); for (int i=0; i<ms.entries_num; i++) { struct json_object *json_object_new_object(); struct json_object *json_object_new_string(ms.entries[i].name); struct json_object *json_object_new_int(ms.entries[i].age); struct json_object *json_object_new_string(ms.entries[i].marital-status); struct json_object *json_object_new_string(ms.entries[i].data.toJson()); } json_object_object_add(obj, "people", arr); } json.Marshal(ms)
A programmer manually serializes a C struct into a JSON object, while a bearded “Go” figure simply calls json.Marshal(ms). The joke contrasts verbose, laborious C code with Go’s concise built-in serialization, making it a reaction to overcomplicated programming solutions. EN: A programmer manually serializes a C struct into a JSON object, while a bearded “Go” figure simply calls json.Marshal(ms). The joke contrasts verbose, laborious C code with Go’s concise built-in serialization, making it a reaction to overcomplicated programming solutions.
C programming code / код на CGo programming logo / логотип Gobearded programmer illustration / иллюстрация бородатого программистаJSON object / JSON-объектsource code / исходный кодcomputer programming / программированиеstruct / структураarray / массивtext editor screenshot / скриншот редактора кодаblack text / чёрный текст
- @gentoomemes / 16405 2025-03-13
- Type
- image
- Size
- 800×251 · 53.5 KiB
- Mood
- sarcastic
- Language
- en
- Added