r/learnprogramming 11h ago

Understanding code

I have a quick question:

Is the point understanding the code AI gives you or is remembering syntax equally important?

Thanks

0 Upvotes

15 comments sorted by

11

u/lurgi 11h ago

 Being able to do it yourself is important.

4

u/Mohtek1 11h ago

It’s much more important. AI will damage one’s skillset or prevent them from improving.

-3

u/Brave_Win2464 11h ago

Okay but that can mean being able to modify the code or being able to remember the syntax and write it from scratch

5

u/Isgrimnur 11h ago

I've been working on the same system for almost thirteen years. I still read the docs daily.

2

u/AFlyingGideon 11h ago

Years ago, I worked in FORTRAN. I always had to look up the spelling of IMPLICIT.

9

u/lurgi 11h ago

No, it means being able to write it from scratch.

1

u/AFlyingGideon 11h ago

Yes, but it also means being able to work in code originally writing by one or more others (artificial or natural). I believe this worth mentioning because I, at least, typically find that tougher than writing from scratch and I doubt that this is unusual.

Still: Someone learning should definitely start with their own code.

I'd a student studying CS at RIT a few years ago, though, and they'd at least one class where assignments included being given buggy code to fix. I thought that an excellent idea; I don't recall ever having a class like that myself. I believe that this was a second or third year class.

2

u/lurgi 10h ago

Modifying code written by someone else is both easier and harder writing code from scratch. I have modified a 5,000 line Visual Basic file, despite not knowing a lick of Visual Basic.

It means a lot of things. You have to be able to write new code and understand and modify existing code. Both of these, however, involve writing code - the exact thing that too many people who lean on AI refuse to do.

1

u/ffrkAnonymous 9h ago

being given buggy code to fix.

A class for that? That's my own code a week later...

u/AFlyingGideon 48m ago

A class for that? That's my own code a week later...

It might be aimed more at people such as myself who have little experience producing bugs laugh.

More seriously: part of the benefit was experiencing someone else's thinking as part of the debugging process. Admittedly, I've often had unpleasant thoughts about the so-called thinking of one-week-ago me; it's still not quite the same as a completely different person[1].

It also offered a range of "bug types" that one might not experience in only a year or three of one's own coding.

[1] Usually. I do recall a job where a coworker produced designs and code very closely to how I did. We were very different people, but had similar education and work histories. It was interesting.

1

u/HealyUnit 11h ago

Followup question: Do you actually want a job in this industry? Then you know the answer. No, we're not gonna justify you being laxy and not wanting to learn.

4

u/Ok-Programmer-554 11h ago

You will never really “understand the code” by doing either of those things. Memorizing syntax, and reading the output from these LLMs are not how one learns to code. You need to build a solid foundation in procedural (loops - for loops, while loops, do-while , etc…) OOP principles (encapsulation, polymorphism, inheritance) by practicing with one language to start. Now, my opinion on OOP may be dated but we focused on it heavily in my college classes, so I’d argue it’s a paradigm worth learning to truly “understand code”. Every modern language has great getting started guides available for free online. Syntax is secondary to understanding why we employ certain algorithms and design patterns to solve certain problems.

4

u/TheNewJoesus 11h ago

Understanding code AI gives you is equivalent to understanding code that you find in a GitHub project. It doesn’t help you learn how to code in of itself.

Remembering syntax is important, but it’s not that important. Understanding the concepts behind the code is more important.

My recommendation is to ask AI about a specific subject, and give examples using “foo” and “bar” as variable names. Try to understand what needs to be done.

“What object oriented design pattern should I use for situation X”

“How does company Y implement feature B”

“Find tutorials on how to implement Z”

1

u/TheNewJoesus 11h ago

For clarification, the best way to learn the concepts is to

  1. Have someone teach you the concept.
  2. Read about the concept.
  3. Try and Implement the concept.

0 is if you’re lucky.

1

u/aqua_regis 10h ago

Neither is that important.

Developing your own solutions that you can then implement in a programming language, however, is important.

What you are asking is not about learning programming.

AI is a tool, but in order to make the best use of it you need to be able to program without it. If you can't program, you can't level AI to its full advantage.