33

Many times I forget things about my application. I don't memorize the table names or what a query did and I search to get what I want. My team leader told me I'm supposed to memorize the table names that I use.

Is the developer required to memorize the table names in the database, the classes names etc? And if the answer is "Yes, all the time," what should I do to remember those things?

6
  • 27
    I wish I could forget them.
    – JeffO
    Jun 11, 2011 at 12:41
  • 6
    Tell him that he should write with his left hand (which is extremely easy for some and quite hard for others).
    – Job
    Jun 11, 2011 at 18:49
  • 4
    “Forced to memorize table names”??? WTF!? “Everyone must learn these ten thousand column names by the end of the week! Then there will be a test; anyone not getting 100% will be force-fed feet first to my private pride of rabid lions!!! Bwahahahahaa!!!!!” Jun 13, 2011 at 20:48
  • 4
    When I was a co-op student, I worked with a guy who demanded exactly that from me, told me I was "wasting time" when I looked things up, said "you said you'd been studying this!" when I couldn't recite table names (and their contents) from memory, and used my lack of commitment to memorizing table names as an excuse to stop mentoring me altogether. I savaged him in my co-op report.
    – user16764
    Jun 13, 2011 at 21:46
  • 2
    Don't memorize, memoize.
    – tylermac
    Jun 17, 2011 at 12:48

11 Answers 11

63

You shouldn't need to explicitly memorise these things. By that I mean sit down and learn them as you would a list of words for a spelling test. In the first instance the names should be memorable and discoverable so you can find them again without too much effort.

You should also have access to tools that help you out here with auto-completion and the like.

In a large system of over 100 tables there's no way you can really be expected to remember every table name and every column name, however, with memorable, discoverable names and regular use you should find yourself remembering the most important details and those you use every day.

2
  • 6
    Having worked in an app with 4k tables, I can attest to the utility of this advice. Memorization doesn't help, project conventions do (especially when they are enforced; and if not, you have to rely on your memory). Jun 11, 2011 at 14:34
  • 1
    To help discoverability, create cheat-sheets and/or (model)diagrams of the things you need. That way, you will just have to look at your paper or doc/image and can scan for the table and column names you need.
    – Kissaki
    Jun 11, 2011 at 19:52
34

Einstein said "never memorise what you can look up [in books]", and I completely agree.

Use your memory for abstract stuff (development techniques and principles) not facts that you can find when you need them.

1
  • yep... don't memorize it, it will come as you use the information. Do have the reference documents for this handy at all time though.
    – Newtopian
    Jun 13, 2011 at 22:36
17

Embarrassing to admit - I have been using C for nearly 30 years now, but can never remember how to declare function pointers - I always have to get out K&R to check the syntax.

Even more embarrassing, I have to think really hard about how typedef works - is it:

 typedef foo int;

or

 typedef int foo;

These are my personal blind spots. I wouldn't worry if you have similar ones.

5
  • 2
    +1: I started programming C in 1985, and still have to look up how to declare function pointers. I took a stab at one the other day and it worked, and I was quite pleased with myself. (I do remember how to do typedefs... :-)
    – Bob Murphy
    Jun 11, 2011 at 23:57
  • 2
    I'm happy that in the language I work with (C#) the equivalent of function pointers is actually parseable by humans, not just the compiler.
    – svick
    Jun 12, 2011 at 16:01
  • @svick Oh, I have no problem reading function pointers, it's remembering how to write them that I have trouble with. Jun 12, 2011 at 16:07
  • 3
    I deliberately didn't memorize the C or C++ precedence tables. I've got them handy for instant reference if I need them, and I really don't want to write code that will confuse somebody else who hasn't memorized them. Jun 13, 2011 at 21:05
  • Code that depends on non-obvious precedence rules is bad code. Feb 25, 2014 at 17:39
9

Computers are good at remembering stuff exactly. Computers are also good at finding stuff they have previously remembered.

So the key skill is to use the computer as an extension to your memory. Write clean code, document stuff, learn to use search tools effectively, set up your development environment so that it is easy to find things, etc.

A nice side effect is that you'll also make it easier for others to read your code.

5

Memory is important

A strong memory is indeed one of the top talents a developer can have; actually that anyone can have. It's truly a special thing and I envy and admire those blessed with it. It definitely can help a person be a stronger developer, lawyer, mechanic, or (insert job of choice here).

How much should be required?

But I don't believe it is a fair requirement to require memorization of all things. I do believe that you will begin committing things to memory as a natural part of doing things. This is why reading a book about a language and using it in a production environment are not the same thing. As you work daily with something (some would call this "practice") you will begin to make some things second nature.

As with the other posters, I do believe memorizing key parts of the application does help. However, I'm not sure investing in memorizing all of it is worth the investment when you can take advantage of features like intellisense, which is increasingly common in modern tools.

How can you improve?

I am not an expert on memory, but some believe that you can indeed improve memory through mental exercises such as brain games (crosswords, sudoku, puzzles, etc). The theory is that your brain is like a muscle and if you use it in different ways and exercise it then you can strengthen it.

It would be interesting to see studies on how things like doing brain games, programming, and interactive activities would effect a brain over time. Could such things help fight the onset of memory loss brought on by age or dementia?

5

Where i come from, there is an old saying that goes something like this in English: "A fool memorizes, a smart man writes down". Basically, no mater how good your memory is, you will forget. You are only human. And this, as a consequence, makes relying on human memory...well, unreliable. Even if you think you remember those table names, can you be 100% certain? You need just a few seconds to look up table names, but you could need hours, or even days, to track down bugs caused by misspelling it.

As a conclusion, no, it's a ridiculous requirement, especially on large projects, which can have thousands of tables and classes.

3

If it's in something that you are working on and it's a long-term assignment, then yes, you should be working toward learning and be able to remember various table and column names, classes, variables, and methods. This is something that will come through time as you work with them. You won't learn them all overnight, but you should strive to know as much about the system you are working on as you can. Also, in a large system, there's no way you can have everything memorized, but there's no reason to not learn and remember as much as you can.

Having to look everything up all the time is just a hit to productivity - if you're working on a task and have to stop and look things up every few minutes, that is a break in concentration. Use appropriate tools to assist you, and learn/memorize what you can. It'll greatly improve your productivity.

2
  • 1
    I strongly disagree with remembering details. You should remember concepts and functions. That is, know what your system can do, and know how to find out what the exact method/variable/column name is. Jun 11, 2011 at 13:56
  • 1
    I wouldn't expect you to know everything, but I would expect that anyone working on a particular subsystem would know that subsystem inside and out. I would consider that knowledge caring about your work.
    – Thomas Owens
    Jun 11, 2011 at 14:18
3

Is there any point to memorizing exact class names? I don't think so.

Is there any point to knowing the what kind of terms your project uses in class names, so you can search for them faster? Definitely.

2

I don't agree that you should have the table names memorized, but they should be easy to guess. To make it easy to guess, be consistent. In this way, you won't be asking your self "Hmm.. is the foo table plural or singular? Is the primary key ID or RID or FooRID?"

2

I don't know how you could query a database for any time at all without getting to know the major table names and critical column names (but certainly not everything). I do know the people who do know this stuff without having to figure it out each time become more valuable to the organization and become the "go to" people when others are stuck.

I find that often when people don't start to learn this stuff, they make errors in queries without realizing it. Errors I often spot instantly in code reviews because I do understand our database structure and how the tables relate to each other and what the critical business rules are without having to look them up.

Personally I find that people who don't bother to learn the structure often stay at the beginner level in querying that particular database. They also tend not to survive layoffs. I think you boss is trying to do you a favor to get you to pay more attention.

1

More than the strong memory the one that helps a lot is domain driven design and following easy conventions like table names and class names to be same. If your business owner speaks to you about the requirement, the domain specific terms used by him/her should be there in the code. In this case we don't have to remember the mappings between business terms and names in the code. This habit takes a while to catch on but it is very useful as it also reduces translation errors to and fro between the business owners and developers.

Along with this if the duration of the project is very long, getting comfortable with code base over a period of time will subconsciously help the memory.

2

Not the answer you're looking for? Browse other questions tagged or ask your own question.