How much code can a programmer know well?

Are there any statistics for this? I understand that it should vary from person to person, but there seems to be a general average.

The reason I ask is because the company I am contracting with has several software products totaling ~ 75,000 lines of code, and they seemed disappointed and shocked when they asked me a question about a specific part, about which I don’t immediately know answer (I am the only programmer that they have, and not the author of most systems). They think that I should know all this from memory. Therefore, I wanted something like statistics to show them that the average programmer could not have all this in his head at the time. Or should I?

+4
source share
6 answers

A really interesting question, but I doubt that there is an adequate answer. Here are just the obvious factors that I see from the very beginning:

  • Overall design quality . Even if you are new to well-designed code, you can very quickly determine where to look for answers.
  • The quality of project documentation . For poor documented projects, even developers who have been in the project from the very beginning cannot say anything about certain parts.
  • Workmanship . OK. You have good architecture, good documentation for interfaces, but even one really bad programmer can break it all. This is due to the fact that many companies are very strict about code review, and I think this is the only way to prevent this situation.
  • Programmer Experience . When you move forward, you see the number of ā€œalready knownā€ ā€œbricksā€ of code in the new software, and experience helps a lot in this, so contractors often have very experienced professionals who are familiar with different approaches, and this gives medium-sized contractors the ability to move much faster than a full-time programmer who is brilliant, but worked for 10 years in only 1 project context.
  • The general intelligence of a person . My opinion is really not as important as most other factors, but it is really important.

... but the common problem often is that companies hire contractors to make some improvements to existing software, and they just think it's just going to hang a photo on the wall. You must complete some negotiations to make them understand part of the work, to understand what really needs to be done to satisfy their needs in general. And such ā€œtrainingā€ requires resources and is part of the work itself. But I think this is a little off topic for StackOverflow (even though I voted;)). Is this more for discussing startups?

+2
source

You must remember where to find the right material that you don’t remember.

You must also be familiar with the code structure and architecture in order to get a reasonable guess about the problem. and where it can find the right material, but you know I don’t know where exactly.

Your brain works like a cache. The material you used recently is stored there, older recordings are erased. But there will never be enough memory to remember the code right away. Because then you will want to remember all the functions of the API, then all the specifications, then something else. All this is impossible.

And wondering if you don’t remember, all the code is probably just another example of these perverted ideas about how programmers do something. Ignore them.

+4
source

It depends not only on your memorization skills, but also on the code. Obviously, clean, idiomatic code is much easier to remember than a poorly written inconsistent mess. Probably because pure code can be broken down into much larger "abstract tokens."

+3
source

Even if you wrote all this code, you can forget parts of it. But you can remember it as soon as you look through it.

I think it’s natural for a programmer to forget some parts of his code after a long time.

+1
source

Ask them how they want you to spend your time: looking at a huge amount of code that you don’t write, and possibly writing internal documentation or something else that currently holds you in your hands. It's not a question. If they want to respond faster to new problems, they need to invest in research.

I do not think there is a meaningful answer to this, measured in LOC. As a manager, I want to know that someone in your situation can answer the question in a reasonable amount of time - and if I don’t know that you are in the middle of something, I would not expect a ā€œreasonable amount of timeā€ to to be instant.

0
source

You must understand all the components in the system and how they interact, so if a problem occurs you can select one or two possible components and expand.

I find it useful to draw some diagrams and keep them working, so I can use them to communicate with my boss / client, as well as run through my memory.

0
source

All Articles