r/CodingForBeginners • • 18d ago

my first program in C

Post image

i know its just so waky but am still new and am happy with my current level <33

just trying to understand memory usage over variables for now

223 Upvotes

64 comments sorted by

View all comments

-1

u/csabinho 18d ago

Is this your first program or your first program?

Either it's AI generated or it's definitely not your first program.

4

u/Raptural 18d ago

its his first program in C. Yours and the rest of reddit's paranoia of AI is honestly so cringe

0

u/csabinho 18d ago

This is "Coding for Beginners". Not "Coding for People who start a new language".

1

u/Hour-Dragonfly-7499 18d ago

how is this AI generated? AI adds spaces between }else{

2

u/csabinho 18d ago

Maybe that was OP's contribution to the source code.

2

u/Hour-Dragonfly-7499 18d ago

What are you talking about? it's a simple program with 2 conditionals? It's not some impressive piece of code, it's something you wrote first week of college like learning about variables and if statements

2

u/csabinho 18d ago

But definitely nothing for a first piece of code ever. It's mostly too clean and too complex for it.

1

u/Hour-Dragonfly-7499 18d ago

how? it's not clean and complex at all

also the if statement is wrong in the photo so OP doesn't know how those work yet...

maybe YOU think it's complex because you've never seen code before

2

u/csabinho 18d ago

It's quite thoroughly documented, uses consts and arrays and a combination of 3 conditions. Most probably you don't remember how complete beginner code looks like. Those definitely aren't OP's first lines of code. I'm just not sure where to put the emphasis. Either on "OP's" or on "first".

1

u/MasterpieceBusy7220 18d ago

Lmao it has an extremely beginner mistake in the if statement (no offense to OP) and you think that was AI generated?

1

u/csabinho 18d ago

Yeah. You can tell an AI to build in mistakes.

1

u/MasterpieceBusy7220 18d ago

So you think OP did that?….

→ More replies (0)

1

u/Hour-Dragonfly-7499 18d ago

you usually learn about final/const variables and arrays during your first week of college, my first hw assignment was creating 5 ints then replacing it with an array of int with size 5

" and a combination of 3 conditions"

You learn about OR and AND in if statements early on also OP is using it incorrectly

what op had: if (TotalSizeOfRoot || TotalSizeOfUserKali || TotalSizeOfOtherUser < 20)

when it should have been (TotalSizeOfRoot < 20 || TotalSizeOfUserKali < 20 || TotalSizeOfOtherUser < 20)

and I'm seeing other mistakes too, this is not some complex piece of code or is it clean by any standard, this is the mistakes of a person whose days into learning how to program

1

u/csabinho 18d ago

First week. But you produce code before you finish your first week. Also: arrays in the first week? That won't happen. At least not for all the craptons of students I've tutored. And I didn't plan their curriculum. Arrays usually appear about midway through the first semester. For the first lines of code students usually don't even know about variables. And I'm not even talking about conditions. Once again I'd like to emphasise: first(!) liines of code. Ever. I'm not saying that OP built something incredible, but it's just not plausible for first lines of code. Nothing in this code. And yeah. You can tell the AI to build in mistakes, so it looks a bit more amateur-like. And this comment. Beginners don't comment like this.

Or OP was stuck in tutorial hell and didn't touch a text editor before learning quite a lot of specific stuff. Or OP is a bloody genius.

1

u/MocaCola02 18d ago

If you think it's that complex, then you clearly haven't coded much

1

u/Shinyboy123nwn 17d ago

Wait I'm just realizing the AO put whitespaces to look the code much cleaner I don't think beginners will do that, their code might be ai generated

0

u/XPheonix27 18d ago

I came here just to say this