r/C_Programming • • Sep 05 '26

How to get Code Review?

Hello yall,

just wondering if there was a community where I can share my code to get advice and such, so like a Code Review.

This might also be another excuse to look at other peoples code and such, but I mainly want to get advice for my code.

Im not really familiar with the coding community, I just code and make projects by myself as a hobby.

cheers, and have a good day.

5 Upvotes

26 comments sorted by

1

u/dyingpie1 Sep 05 '26

I'd also take a look at

1

u/TheAmazingFreddyAdam Sep 05 '26

I would love that, this is my current project at the moment: https://github.com/FredNeedsHelp/Ternary-Emulator ; if you also could look at the division function in the math source file, that would be lovely. I cant figure it out. Thanks in advance too.

1

u/pjl1967 Sep 06 '26

1

u/TheAmazingFreddyAdam Sep 06 '26

this looks cool, ill guess Ill make a post on it next time. ty.

1

u/Fun_Swim7831 Sep 10 '26

Can't speak con the math itself, but take a look at https://cs50.readthedocs.io/style/c/. Some parts of the code are hard to read

1

u/TheAmazingFreddyAdam Sep 12 '26

reading the style guide did make me question my style a little bit, but just wondering, what were the "some parts" that were hard to read? if its hard for other people to read it, then its probably a weak point for me.

1

u/Fun_Swim7831 Sep 13 '26

I guess it's just spacing mostly. Style after all is pretty subjective. The lines where both condition and outcome are next to each other for example, while perfectly valid C code, and I can figure out what they intend to do, seem a bit cluttered.

Variable name casing is another minor example, they way you define variable names, ie helloWorld vs hello_world vs HelloWorld is inconsistent in some parts of the code

There's software that helps you format your code automatically, look at clang-format.

While a bit nitpickynor pedantic, having consistent style rules makes it easier for other devs to review and collaborate. If you are programming by yourself, for yourself, then don't worry at all and do whatever your heart tells you

Also, maybe not needed for this particular project, but larger projects benefit from a build system like glue Make

1

u/AliceCode Sep 05 '26

What language? I don't mind taking a look if it's a language I'm familiar with.

1

u/TheAmazingFreddyAdam Sep 05 '26

I wrote it in C (I posted it in the C subreddit because of that reason lol) this is my current project at the moment: https://github.com/FredNeedsHelp/Ternary-Emulator ; if you also could look at the division function in the math source file, that would be lovely. I cant figure it out. Thanks in advance too.

0

u/AliceCode Sep 05 '26

I'm familiar enough with C to review code! I'll take a look. No guarantees, though, because I'm only on my phone, but I can open it up on my PC if need be.

1

u/TheAmazingFreddyAdam Sep 05 '26

Any advice is appreciated, sorry in advance if my code is a mess.

0

u/AliceCode Sep 05 '26

Well, I can already tell I'm gonna need to get on my computer. First file I opened and I already saw something that can be improved with relative ease.

https://github.com/FredNeedsHelp/Ternary-Emulator/blob/main/SS_PLoader.c#L6

You could instead use an array of key/value pairs here, and if they are sorted, you can even do binary search on them.

I'll get on my PC and check it out here in a bit.

1

u/TheAmazingFreddyAdam Sep 05 '26

I think I've been planning that, i think I even left a comment on it too. thank you for the reminder / telling me in all cases.

Also, you getting on your computer isn't a bad sign right? just feels like getting a bigger screen to look at code means something is up. Which does worry me, because SSPL is the worst of my code (In my opinion. im not very familiar with parsing so thats why)

1

u/AliceCode Sep 05 '26

Well, considering how fast I found room for improvement, I'm just assuming that I'll find quite a few other things. I don't want to go back and forth between the code and reddit on my phone to type out my review.

1

u/TheAmazingFreddyAdam Sep 05 '26

Honestly, im kinda happy that you found room for improvement. I cant wait when your fully done, take your time tho.

1

u/AliceCode Sep 05 '26

Send me a reminder if you don't hear from me for awhile. I'm easily distracted. I gotta make some dinner first.

1

u/TheAmazingFreddyAdam Sep 05 '26

I guess this is your reminder, ima head to sleep, gn.

→ More replies

1

u/[deleted] Sep 06 '26

[removed] — view removed comment

1

u/TheAmazingFreddyAdam Sep 06 '26

mhm I see, might I ask whats the difference between a small project and a codebase? wouldn't all small projects be comprised of a codebase? but I think I understand what you're saying, I only should post the stuff that I need help on because reviewing a 1000 sum lines of code is more of a chore than reviewing <20 lines of code.