{"slug": "journey-towards-mastering-computers", "title": "Journey towards Mastering (Computers)", "summary": "A developer began a 3-month plan to relearn computer science fundamentals, starting with linked lists in C. The first day's progress involved implementing a singly linked list, exploring self-referencing structs and manual memory management. The developer plans to document significant learning milestones rather than daily updates.", "body_md": "Being persistent is hard when you have responsibilities, when you need to work to earn money, when you don't have time to do what you want. This is what I was telling myself every day, when I missed a daily coding challenge, when I couldn't finish a project on time, when I lay in bed tired.\n\nMotivation is not necessary. Just do it. Love your fate. This post is my special way of showing myself how much I want this. I have been learning computer science and doing things that I keep forgetting due to a lack of reinforcement. Hence, I have made a 3-month plan to learn and relearn all the basics to make myself a better programmer. This is my progress for Day 1.\n\nAlso, I will not post Day 1, 2, 3, etc. for 90 days straight. I will only post when I have time, or when I have learned something significant that makes me smile or let out a small giggle that makes me look like a psycho hehe.\n\nI started the task having an idea of what a linked list was, but I had no idea about the different varieties of linked lists:\n\nSingly Linked List\n\nDoubly Linked List\n\nCircular Linked List\n\nDouble Circular Linked List\n\nI started Day 1 by writing a few lines of code to make a singly linked list. I will just paste the program code right now, and then I will write about what was interesting to me.\n\n```\n#include <stdio.h>\n#include <stdlib.h>\n\nstruct node {\n    int x;\n    struct node *ptr;\n};\n\nint main (){\n    int value[] = {10, 20, 30};\n\n    struct node *head = NULL;\n\n    for (int x = 0; x < 3; x++){\n\n        struct node *new_node = malloc(sizeof(struct node));\n\n        new_node->x = value[x];\n        new_node->ptr = head;\n\n        head = new_node;    \n\n        }\n\n    struct node *current = head;\n    while (current != NULL){\n        struct node *next_node = current->ptr;\n\n        free(current);\n        current = next_node;\n    }\n\n    head = NULL;\n    return 0;\n\n}\n```\n\nFirst thing was, I have used C++ before. Then, while trying to understand objects, I read a line from Gemini that said objects are just a cooler version of structs. Well, custom data structures are kinda like objects, I guess, it's just that you cannot put functions inside of structs. Also, the idea of custom data types is fun, and I have come to appreciate memory management with the help of C.\n\nThe code is simple. It creates a singly linked list, where we create nodes using the struct data type. It uses pointers to new heap addresses, which are the size of the struct that we created. Later, we will destroy the memory one after another using free().\n\n```\nstruct node {\n    int x;\n    struct node *ptr;\n};\n```\n\nHere, in the code above, you can see we referenced a pointer of the data type node that we haven't even finished creating. Do you see it? It is called a self-referencing struct, and the magic happens due to pointers. Yup, pointers are the MVP; the magical, fantastic idea of pointers. The compiler just knows and says, \"Here I am gonna allocate 8 bytes for a 64-bit system, 'cause it is a pointer'.\n\nThe core idea of a linked list is to have a starting point to reference the first node, and then we can start going to the next struct one by one.\n\n```\nstruct node *head = NULL;\n```\n\nAlways remember to delete/free the memory after use. Here, I have assigned a new struct to hold the pointer value to the next struct.\n\n'Cause the heap still has the nodes, I just copied the location of head and backtracked it, Last In First Out (LIFO) style. Fun fact:\n\n``` php\ncurrent->ptr\n//same as\n(*current).ptr\n```\n\nWe are just accessing the member ptr of the struct after dereferencing to follow the pointer to its actual memory address.\n\nIn the end, it is a good practice to reset the pointer so that it does not cause any errors like a dangling pointer. Even though we deleted the memory address that head was pointing to, head will still point to that deleted address unless we reset it.\n\nFinally, I wanna say it was fun writing this blog/article, I don't know. I will keep posting my progress as I continue to peer deep into the colourful and blinding grandness of programming. Thank you for reading this, have a wonderful day.", "url": "https://wpnews.pro/news/journey-towards-mastering-computers", "canonical_source": "https://dev.to/gazel-create/journey-towards-mastering-computers-329h", "published_at": "2026-08-30 12:31:30+00:00", "updated_at": "2026-08-30 12:52:45.689874+00:00", "lang": "en", "topics": ["developer-tools"], "entities": [], "alternates": {"html": "https://wpnews.pro/news/journey-towards-mastering-computers", "markdown": "https://wpnews.pro/news/journey-towards-mastering-computers.md", "text": "https://wpnews.pro/news/journey-towards-mastering-computers.txt", "jsonld": "https://wpnews.pro/news/journey-towards-mastering-computers.jsonld"}}