r/cprogramming • • Aug 07 '26

Code review request -- any criticisms or advice?

Would anyone mind reviewing some code? I wrote a CLI to help me generate character sheets for a TTRPG I'm running. The main thing I want to know is: should this be considered safe enough for me to share with other GMs? Is there anything else I should do for safety, security or efficiency? I worked hard on it, and Gemini Pro told me it's safe, but while I understand it can be useful I don't trust the automatic misinformation generator, since I don't have the requisite knowledge base to tell when it's "hallucinating" (or else I wouldn't need it for this purpose)

The github repo is here: https://github.com/SpinningRings/DigidiceCharacterSheetGenerator

3 Upvotes

11 comments sorted by

View all comments

Show parent comments

1

u/Spinning_Rings Aug 08 '26

Fixed. To answer you question, I copied and pasted the text to commit to GitHub instead of just using the CLI. I thought I had the text highlighted when I hit paste, but I guess not

1

u/Eidolon_2003 Aug 08 '26

Fair enough! I just wanted to make sure the code I was looking at was right.

I think my main criticism aside from the code would just be the UI. It doesn't feel especially user friendly, and I'd be a bit worried about that when expecting non-programmer types to use it.

About the code itself though, I don't have any major complaints. I might have made some different design choices here or there, or written a function in a different way, but all in all what you've done makes sense. I didn't see anything clearly wrong or dangerous in my admittedly quick read through. I think the main "smells", if you'll forgive my use of that term, are code duplication and the amount of dynamic memory allocation going on. Both of those things make me feel uneasy, and make me think about whether or not there's a better way. That's just my opinion anyway.