2) Learn the name of the library functions, so your flow isn't constantly interrupted by looking for what you need.
Eh, this isn't necessary. I've been programming (and continuously making a concerted effort to expand my programming knowledge) for more than a decade, and memorization of anything simply hasn't been very helpful.
For example I have no idea what Python's regex syntax/library function is, even though I've used it a dozen times in the past. But that doesn't matter: alt-tab to chrome, ctrl-N, "python regexp", stackoverflow pops up with an example, copy-paste, done. Five to ten seconds, max. Far from breaking my flow, it's become an integral part of it.
Zed is the same way, for what it's worth. He talks about it in a Peepcode screencast. "I memorize concepts, not names."
> But that doesn't matter: alt-tab to chrome, ctrl-N, "python regexp", stackoverflow pops up with an example, copy-paste, done.
I find, though, that this is one of the most insidious causes of bugs in my code. All the little idiosyncrasies in those functions - do they throw an exception when they fail or return a code? Are regexes multiline by default or not? does re.match() match the whole string to the pattern or just part or it? Time and time again it's my assumptions about these subtle behaviors that creates bugs in my code, and I've actually come to the conclusion that I need to do some SRS type learning to get newer languages into my head.
If you don't memorize anything you'll be going to stack overflow for everything. If you spend 10 seconds everytime you need to get the first char of a string, a substring, create an array etc you'll be wasting an awful amount of time. Knowing the core functions is a huge timesaver. Python's regexp functions are arguably not 'core' library functions.
If you spend 10 seconds everytime you need to get the first char of a string, a substring, create an array etc you'll be wasting an awful amount of time.
Not at all. You only need to do it once for the current program you're writing. Now you have a working example to refer back to, within the program. So the lookup time only comes into play the first time you need to do a certain thing. It's a negligible constant factor (about a couple minutes in total per program, and without interrupting flow).
Also, being prejudiced against those who have a bad memory is not helpful.
Knowing the core functions is a huge timesaver.
Not really. By using Google effectively, it's possible to be productive in any language without knowing any of the core functions.
Eh, this isn't necessary. I've been programming (and continuously making a concerted effort to expand my programming knowledge) for more than a decade, and memorization of anything simply hasn't been very helpful.
For example I have no idea what Python's regex syntax/library function is, even though I've used it a dozen times in the past. But that doesn't matter: alt-tab to chrome, ctrl-N, "python regexp", stackoverflow pops up with an example, copy-paste, done. Five to ten seconds, max. Far from breaking my flow, it's become an integral part of it.
Zed is the same way, for what it's worth. He talks about it in a Peepcode screencast. "I memorize concepts, not names."