CodeGraphy Planning Stage

Information before action.

  • July, 25 2023

What is CodeGraphy

All developers have gone through the headache of understanding a block of code. Even their own code. Personally to counteract this I use graphs to document what I wrote to make it easier for myself. But as the lazy bum I am I stopped doing it while ago because its tedious and I only use it like once or twice so the hassle of creating one for every code.

I have seen CodeSee but it is not the functionality I am looking for. It gives a map of the codebase but it's just that. The graph I usually make is more like a machination graph that outlines what the code actually does. After thinking a while I decided to create CodeGraphy a tool to convert code to interactive graphs.

Plan

I'm currently learning c++ and I figured that it is gonna be a great first project in the language. But I don't really know where to start to create this project so I did some research. What I want closely resembled creating a programming language from scratch. Thankfully there is a lot of resources on creating a programming language I specifically watched this tutorial from freecodecamp.com. It introduces the concept with python a language I'm familliar so the learning process was quite easy.

After I breezed through the tutorial I learned a few things. Lexical analysis or tokenization is the process of chunking the code to tokens. With the code tokenize we can process it much easier. This is exactly what I need for the project. The tutorial also mentioned things like parsing the tokens to a tree for execution but I don't need that so I just skipped most of the tutorial.

To the paper

I actually like putting my ideas in paper instead of storing them in the computer. Reason is I don't have a second monitor to look at the ideas while writing code, and if I wrote it on the computer I just often forgot about them and never read them. Writing in paper just suits me. I drew a sample graph of a sample function in the paper and wrote what are the elements that I need to convert code to the graph. The first programming language I will convert is python because it is the main programming language I use but I will add more in the future.

Go to the next article hehe

I wrote sample tokens for this but I will show it in the next blog post where I actually start development. In the next article I will actually start development and hopefully create the program without the ui. I plan to add the UI after I fleshed out the actual conversion so I could focus on the UI and not fix every little conversion bug.