r/learnpython • • Dec 24 '23

Memorizing syntax

Hello, I am new to Python and programming in general. I am learning Python on EdX, and was wondering how important it is to memorize syntax for different functions like find, replace, convert to upper/lower case, etc. Wouldn't memorizing them be redundant since they can be Chatgpted?

0 Upvotes

48 comments sorted by

View all comments

2

u/Buttleston Dec 24 '23

You need to know what is available/possible, and you need to know where/how to find more information. There are some things you'll use so often that you won't ever even need to think about the syntax and some things you use so infrequently that you'll need to look it up every time.

I have also found that working with other people/having other people review my code means that I both get to show people things they weren't aware of and learn things I wasn't aware of.

The core language of python is not very large, it's feasible to know everything in it (by core here I mean, what you get from python without importing anything - strings, lists, dicts, loops, etc). Then there's a first tier of libraries you'll use all the time most likely - time, datetime, logging, os, math, sys. The exact list of what you think of as the first tier will kinda depend on the kind of programming you do, but you'll use those libraries a lot and will probably know what's in them and what kind of parameters they take.

Then there will be sort of second tier and beyond and you'll be vaguely familiar with what's in them, and when you start to use one more for a while you'll dig in and find new stuff and incorporate it.

It's the same thing with real life. I know how to cook eggs without needing to look it up. I could make an omelette by spending 5 minutes on youtube checking some things. I'd need to do a little research to make eggs benedict but I generally know what the ingredients and techniques involved are.

1

u/Bobbias Dec 24 '23

This is the correct answer.

You shouldn't be going out of your way to explicitly memorize things, but understanding what's available, and internalizing the most common things you use is important.

Those things come with time, and with (hopefully) reading the official documentation.

And about ChatGPT:

ChatGPT is not reliable, and often simply makes up answers that are completely wrong. It has no way of knowing what it is wrong, and should never be trusted. New programmers should forget that ChatGPT exists, because you need to be experienced enough to know when ChatGPT is wrong about something in order to use it in a safe and productive manner.