r/AskProgramming • u/Rough-Implement-8801 • 3d ago
Is it true that programming is mainly reading and little typing?
Is most of the time spent learning or working as a programmer mostly reading code, docs and books?
I heard that as learning I should type everything to put it into muscle memory but that on the job I can use ai to work faster. I don't disagree with the advice of not using AI while learning, but I somewhat disagree with the "typing by hands every code snippet" part.
It feels like a waste of time while sufficing with reading actually makes more sense as I can spend absorb more information faster and go through more pages of docs.
19
u/wrosecrans 3d ago
Physically typing out code is the minority of the work of (good) programming.
But if you don't type out code, you'll never build the skill of figuring out what code needs to be typed.
2
8
u/KingofGamesYami 3d ago
Typing the code isn't about learning how to type code. It's about learning the stuff you're reading.
The human brain is weird. Doing an action makes different neurons fire than just passive observation, and this difference improves retention.
1
u/Ormek_II 2d ago
You can also tell someone else to type that. But if you copy paste you will not remember, because the action is always the same.
8
u/JohnLemonOfficial 3d ago
One time it literally took me 3 days just to write a single line of code just to fix that stupid bug.
1
u/tuser-reddit 2d ago
You mean to figure out a problem which is solved by one line, not like you spent three days to write ONE LINE <- "isn't this the same thing?"
5
u/Recent-Day3062 3d ago
Code is written once and maintained 10 times
1
u/tuser-reddit 2d ago
man I ****ing hate when I write some code, and these mother****ers come after 4 month asking me to explain the whole ****ing flow, and I need now to remember literally every querk I had to figure out to arrive at the solution.
1
u/Recent-Day3062 2d ago
It is stunning how hard it can be to understand your own code a few months later. I keep honking “who went in and messed with my code? I can’t have written this”
3
u/Ok-Spite-5454 3d ago
I don't know about y'all but it's mainly having a mental breakdown, sometimes some dancing.
1
u/generally_unsuitable 3d ago
The only way to get the information into the brain is to pound the forehead against the desk.
2
u/Square-Yam-3772 3d ago edited 3d ago
it is mainly reading and little typing. senior people know conceptually what needs to be done due to experience and knowledge. Some of these senior people later become professors and write textbooks based on what they know etc. But it is not really about the details; it is the other things like design/architecture/algorithms etc
I am stating the obvious but the basic idea behind all of this is that 1) computer is doing all the work i.e. executing the instructions aka computation while 2) the programmer provides the instructions
so yeah, the act of writing instructions isn't really the important part; it is knowing which instructions to give (which you get from reading)
in fact, many programmers would be better programmers if they simply spend more time reading better code or reading textbooks.
many people on reddit are either students or junior/mid level coders so their minds are always tunnel visioned on being hands-on/writing. They think memorizing things they can look up make them better coders but in reality... its learning new concepts via reading
if you ever find yourself typing lines and lines of code straight from your head, you are not really challenging yourself.
EDIT: also, improve your math will make your a better coder. another common thing people ignore
1
u/Rough-Implement-8801 2d ago
Thank you for the answer, which forums would you recommend for getting more reliable answers? Like from actual pros or seniors. Or should I just stick to books and docs and not waste too much time on online forums? What about stack overflow?
1
u/Square-Yam-3772 2d ago
use any other social media imo. reddit doesn't require people to identify/verify themselves.
it is not hard to find pros or seniors i.e. some internet blog's authors use their real name and you can see their resume online. (or they would tell you they have 10+ years experience in this or that, again, verifiable)
are you studying computer science in universities? if not, you should pull up a typical computer science curriculum and see if you have missed any areas of study.
if you are self taught, you may still want to spend some time typing. an average computer science students spent years with homeworks and projects so the "little typing" apply more to them than people who are completely new to this.
1
u/Rough-Implement-8801 2d ago
Ok thank you,
I'm self taught. I might go through roadmap.sh to not miss anything like you say1
u/Square-Yam-3772 2d ago
also just look up some tests/projects those students have to do and try to do them yourself. Being a computer science major isn't really all that in the world of programming so you should at least have enough knowledge to clear that bar
2
u/danielt1263 3d ago
I recently worked on a ticket. Writing the actual code took me about 3 hours, including the test harness. The ticket took 4 days from the moment I started working on it to the moment I passed it on to UAT. So that's 3 out of over 30 hours on the code writing portion of the job. (And interestingly, if AI made me 3 times faster, the ticket would have still taken me 30 hours to clear, so don't think AI will be some sort of massive improvement.)
2
u/PapaNoobara 3d ago
Is it true that programming is mainly reading and little typing?
Yes, in the same way surgery is mainly reading charts with a little bit of meat-cutting.
Astrophysics is mostly scribbling on paper.
easy-peasy
2
u/DepthMagician 3d ago
This advice might be inspired by some research that found that taking notes by hand improved learning, and they're extrapolating it into typing. I personally do type some code snippets in tutorials, and the reason I do that is because it's very easy to gloss over the actual code in the snippet, and reach the end of the tutorial having learned the concepts but having zero recollection of what it looks like in code. Typing the snippet forces me to slow down enough to actually look at the code.
I also have a sneaking suspicion that part of the reason why you are asking this is because you are a slow typist, otherwise you wouldn't consider this an impediment.
1
u/Rough-Implement-8801 3d ago
My max typing speed is around 120 wpm, however my (long but thin) fingers get tired very fast and then they hurt, so yes, this is definitely the reason why I asked.
2
u/BaronOfTheVoid 3d ago
Even without AI when you are not doing a greenfield project but working on existing software even during the implementation steps of your planned features, fixes or refactorings you are typically spending 10-20 times as much time on scrolling, reading and searching through files, trying to understand them, building up the mental model of how the software actually works line by line, compared to actually typing what you have.
Of course if you do work on greenfield projects you don't really have a software that you still have to understand so the ratios shift drastically towards typing.
Regarding the specific "typing to memorize" thing, I don't have a high opinion of something like that. But you do have to deal with software or code in general, including reading or typing, in order to build up habits and memorize things. It's hard to describe but over time the typical things you spend your brain power early on become trivial as time goes on: syntax, the hundreds or thousands of types and functions/methods of any standard library or commonly used 3rd party libraries, protocols, anything related to unit and integration testing, common things like accessing a database, the filesystem, the environment, error handling, input validation etc. - at some point all of these things are just like breathing or riding a bicycle. You just know and do it easily. Meanwhile in the first weeks or months all of that seems daunting and exhausting. And it would remain daunting if you didn't actually do your own projects at some point.
2
u/SmackDownFacility 3d ago
No. Thats not true. I spend the majority of my programming career typing and debugging.
2
u/rlebeau47 3d ago
I spent 30 years typing out my code. I hated being forced to let AI type it for me.
1
u/geekichu 3d ago
Im going to get flak for this ("incoming!") but in this new era, I tend to agree.. as long as you use A.I. to learn.. not just accept everything you're handed.. and if you at first stick to one language (javascript serves you well for client/browser and server).. you'll absorb it over time. you can type when you want to tweak the given code, maybe try something a little different..
6
u/DSudz 3d ago
This is like learning to cook by reading the ingredients at a buffet. You're not going to retain the information without doing it. Your only going to learn how to ask ai.
Now, asking ai may be the more important skill in the future but your not learning anything as well without the reinforcement of doing it.
2
u/geekichu 3d ago
nope. it depends on a person's discipline. yeah, if they're lazy, if they succumb to just taking the accepted code, then sure. but doesn't change that it works as a technique.
1
u/burlingk 3d ago
Eh. I am not entirely sure this comparison works. I mean, if you learn to cook by reading the ingredients, then go home and actually work on cooking the stuff, you are going to have to put a lot of though and effort into the learning.
Leaning on AI is more like, learning to cook from reading the ingredients, and never leaving the buffet.
1
u/funbike 3d ago edited 3d ago
Yes. That's why I prefer partitioning and segregation architectures.
Partitioning architectures would include Modular Monolith, Vertical Slicing, Atomic Architecture, DDD, and/or microservices. Segregation architectures would include hex, onion, clean architectures, event-driven, and cqrs.
These architectures allow you to write fresh now code in a bubble, so you need to understand smaller a smaller subset of the full app.
TDD allows you to focus on one point of the app and you build your code incrementally. However, for bug fixes or modifying existing features, it's less beneficial in this respect.
1
u/ChazBass 3d ago
The best way to learn is still by typing and experimentation. That "work" will enforce learning. AI is fine for learning more about what is going wrong and what is possible. But I would use that as a last resort. Try stuff. Doesn't work as expected? Debug! Try again. As someone said above, "Wax on. Wax off. The problem with just reading is you will (hopefully) understand it, and then forget it.
1
u/nevinhox 3d ago
I did the math a few days ago. Over the course of a 25 year career so far, I have learned over 750 programming languages, apps, products, tools, technologies and architectural approaches. This doesn't include things I just had to quickly research for a pitch or sales meeting, but something I legitimately had to invest time and resources into learning for practical use on a project or deliverable. L
That works out 2-3 new things to learn every month, on top of actually trying to hit 40 billable hours every week.
Tell me another job that requires this level of personal investment staying up to date with skills. It never ends. I'm tired, dreaming of retirement, and get sad to think I have at least another 10 years on this treadmill.
1
u/Rough-Implement-8801 3d ago
So you're basically answering yes to the question?
1
u/nevinhox 3d ago
You're going to want AI to do it all because you're not going to be able to remember everything by heart. You'll get confused about what functions are part of which language. You'll try to use a language feature in C#9 that is only available in C#10. You'll forget that a string needs to be URL encoded instead of HTML encoded or XML encoded, except that one time that version 21 of browser A requires an ampersand to be encoded, while patch 64.15B changes that so it needs to be double-escaped as well, but they dropped unicode support and change the BOM handling at the same time.
I'm joking, I obviously, but not really. AI simply has the brain capacity that we humans don't. There is too much to learn and not enough time to learn it. Our time is better spent learning the AI tooling than being hand on.
1
u/MimosaTen 3d ago
Type code is a completely trascurable part of the job, at least in production. In fact LLMs are perfectly capable of delivering 100% of code, however they are very bad teachers and thinkers. So how the human that instruct them learn?
1
u/lookForProject 3d ago
Depends on the field and the complexity. For mundane tasks, sure, 100% of the code might be true.
But the intresting, more niche, challenges, AI is not there yet.AI is a decent junior, but the worst senior.
1
u/NumberInfinite2068 3d ago
Not really, I've not read a programming book in over 20 years. Docs, yes, of course, but we're not reading them end to end, we're mostly scanning them for the bit we need.
Don't worry about muscle memory.
I think while learning, it's a good idea to not use AI, but the reality of the job now is is that AI does the coding. I haven't manually coded anything of substance in probably 6 months.
The job has radically changed now. A year ago, 90% of my job was programming, like typing in code in C, C# or Rust. These days actually typing in code is around 0%, I get an AI to do it.
I'm not 100% sure I'd have gotten into this line of work if it was like this when I started in the 90s.
1
u/APathSoTwisted 3d ago
A good amount is reafing documentation and deciphering legacy code, often refactoring it. I use Google or Copilot constantly, but I already know what I need to do, I just need the correct class names, methods, or solutions to a confusing bug, or some opinions on different approaches, etc...
I love coding because it engages many parts of my brain, I can focus on it for hours without getting bored, and it's instant gratification.
I do think you should understand the principles of good design and the underpinnings of security and performance before you just start vibe coding. It is possible to use AI to help you learn, instead of using it to avoid learning
1
1
u/GrumpyOldMuppet 3d ago
There have been studies that show that developers spend more time reading code than writing it. So that may be what you are thinking of. It's not necessary reading docs or stuff online. Although there is a lot of that, it's not more than, or even close to, the time spent "coding" which involves both reading and writing code.
The difference in time spent between reading and writing code varies from one study to the next. Ranging from a 60/40 split up to a 80/20 split. And "reading" code is more a case of comprehending code. If you are fixing a bug in code someone else wrote (or that you wrote a week ago and no longer remember the details of) you are going to spend a lot of time "reading" that code to understand it and determine where the bug is. Then maybe only a few minutes to fix it. (It can range from a single character to fix to dozens of lines of code.)
Even immediately after writing code, you almost always read it to "proofread" it.
Then lastly, you read the code other people just wrote as part of a code review (i.e. "proofreading" other peoples code).
So I wouldn't say we "primarily" read and do little typing. But I would say we do more reading than typing. But still, you can end up typing a hundred lines of code in a day.
1
u/Far_Oven_3302 3d ago
Don't forget, adding break points, stepping through code, tracing variables, figuring out why someone wrote the code the way they did, maintaining a repository, team meetings, the software development life cycle, UML diagrams, writing documentation/commenting, constantly relearning technologies as they mature, and so much more.
1
u/burlingk 3d ago
So, while we argue over the labels "programing" and "coding" there is some truth to the argument that the two are not the same.
Programming is the act of creating the program. Of deciding the paths, and planning it out.
Coding is the act of turning that program into code.
Both are a practice, and both are important. However, if you can do the programming/design and suck at the coding, Google will go a long ways to helping you figure out the code.
If you cannot plot out what is needed to make the program happen, i.e. you have trouble on the design side, Google can still help, but not near as much.
So, yes, there does tend to be a lot of reading and planning involved.
1
u/burlingk 3d ago
Additionally: If you do get a job that leans on AI, NEVER stop doing your own projects on the side, with no or minimal AI assistance.
The moment you get to a point where you cannot operate on your own code without AI assistance, you will become effectively unemployable. And in a lot of jobs that is going to mean doing your own projects.
BUT, also, make sure to read your contract (preferably before signing). Some companies claim employee work, so it is best to know that up front before you go trying to profit from side jobs.
1
1
u/LetUsSpeakFreely 3d ago
No. That's like saying "all you need to do be a mechanic is to watch some YouTube videos and turn a wrench?"
1
u/raven2cz 3d ago
First of all, it depends on what kind of person you are. There are many people who can learn well just by reading. I, for example, cannot.
To really understand something in depth, I first read about it. But then I put it completely aside and give myself my own task, which I have to program myself. Something completely new, based on the information I have learned.
1
u/Guybrush1973 2d ago
At this point I drive my dev students to focus way more on logic rather than syntax/typing, as this problem is almost already solved by AI.
1
u/mjmvideos 2d ago
Well, then just keep reading and don’t type anything. Sounds like you know what you’re doing. Hope that works out for ya.
1
1
1
u/Felicia_Svilling 1d ago
I once spent three hours looking for a bug, and then adding a single character to the code to fix it. So yes, typing is a really small part of the job. And this was true even before AI skewered it even more.
0
u/VirtualLife76 3d ago edited 2d ago
Programming is like speaking another language. The only difference is the grammar is more strict. Been coding over 40 years now.
-1
u/huuaaang 3d ago edited 3d ago
No, very little reading. But there’s a lot of thinking through things before actually writing it out. Also meetings and such if you’re pro.
In the beginning you might be reading more but at some point it’s about as automatic as speaking.
1
u/iOSCaleb 3d ago
IDK what kind of projects you work on, but any job where you have to create or maintain code is going to involve plenty of reading code, reading specs, reading requirements, reading documentation, reviewing code… It’s not reading like you read a novel, but there’s lots of reading going on in most programming jobs.
1
u/huuaaang 3d ago
Well if we’re counting internal docs and specs I’m writing a lot of those. So I should say I spend a lot of time writing, just not always code
-1
46
u/mc_pm 3d ago
Wax on, wax off.
Typing the code in is about building muscle memory of a sort -- you stop stumbling over for loop syntax by the 50th time you've typed it. Eventually your fingers are just doing the thing without you even thinking about it much.
But no, it is not true that programming is mainly reading and a little typing. It's mainly *thinking* and a little typing. Syntax is easy, your fingers will learn it. But learning how to think like a programmer is going to take a lot longer.