Ask HN: I can never learn coding
Hello HNers,
I have been trying to learn coding for over 10 years. Languages I tried to learn include Visual Basis, C#, .NET, C/C++, Java, JavaScript, PHP, HTML, CSS. I cannot code in any language. It is serious attention problem I have been facing.
I tried to abandon the programming. But Again I got curious about web development. And for last 1 year, I am trying to learn Python. Again, I am failing due to lack of focus.
What is wrong with me?
How can I focus and learn coding? Or, should I forget about learning programming for good?
I would appreciate any help.
18 comments
[ 2.4 ms ] story [ 48.9 ms ] threadWithout knowing, here are some general ideas:
1. Stop expecting to understand the program at the "macro level" and the "micro level" at the same time - just accept that there will always be some unknowns. For instance, don't think about how the processor or memory works while just writing a few lines of Python to read a file.
2. Try to understand the code's structure and flow rather than specifics - do you understand how functions call each other, how module systems work, etc?
3. Try to start with an existing open source project and then modify it to your liking. As you dig around figuring out where your changes go, you'll appreciate more about how it all comes together
It would be impossible to "read" and understand the whole of a huge project as an inexperienced coder, of course.
If you've been reading random articles on the web and going to Stack Overflow whenever you need to figure something out, it might help to do something with more structure, such as working through a book on a particular language, or doing one of the introductory college CS courses that are available online. These will present material in an organized sequence and give you a foundation to build on.
Also, learning this stuff takes time and practice. There are things you won't understand the first time you see them, which you'll eventually understand after having read more and written more code.
Finally, don't jump the conclusion that something is "wrong with you". We live in a world filled with many distractions, and even if you don't have ADHD it can be hard to sit down and focus on something hard. Focusing on hard stuff is difficult, so you may need to gradually build a habit of doing it, starting with short periods of focus and working your way up. And you won't be able to focus if you're being interrupted by your phone beeping every few seconds, so try turning off distracting devices while you're learning.
So the takeaway from all of this? It's not programming. It's mental health. And having spent the last couple of years devouring medical research and throwing my every last ounce of energy at the problem (I started suffering from chronic fatigue, so it wasn't really a lot), discovering autoimmune diseases (celiac) which were causing sleep problems, blood tests indicating significant hormonal imbalances, experimenting with paleo, keto, exercise variations ...
The takeaway is that the state of mental health treatment is horrendous. Most of my recent readings and research has taken me into the direction of childhood trauma as being the most likely cause of most instances of mental health problems and a lot of chronic health conditions. Some pointers would be the ACE study, and start by reading works by Alice Miller, Bessel van der Kolk, Laurence Heller. Now, the medical consensus is quite different from what I've stated here, so I should back this up with some significant evidence, which I won't. The evidence is fractal-like, and there is huge predictive power in understanding this (that unmet developmental needs during childhood lead to coping strategies that are maladaptive in adulthood, and those are the cause of things like ADHD, chronic fatigue etc).
Is there a solution? I don't know, I certainly haven't solved my issues, but I've started to understand them. You'll probably have a hard time doing the research yourself, given the attention problems. In any case, there are risks associated with this path ...
But if it truly is possible to solve this issue, you'll not only be able to focus on coding. YOU'LL START LIVING.
I think you are struggling with learning a language instead of learning how to think logically. Instead of learning a language, learn how to break up a complex requirement into discrete steps. An example --
I ask you to save inputted text into a text file called "file.txt". What are the steps you need to take (to write this in any language?) This comes with experience but I'll walk through it here:
1. Take in input from the user. 2. Write out input into file.
I don't know everything, so when I forget, I google this stuff. "How to take in input in C++". Okay, I understand what I need to code. Next, how to write a file "how to write a file in C++". Done. By combining these steps, I've accomplished my goal.
Basically, my whole experience has been following this pattern of taking a problem, breaking down it into individual parts, coding these individual parts, and coming up with the solution. However, with each step, you get into deeper detail. How do you take in input in C++? Well that's with cin, what's cin? Google C++ cin, ah okay. etc. As you program more, you start to memorize these steps, which lets you code faster and better quality. Instead of googling things, you remember that you have 2 steps you need to do to write out a file. Of course, working in different languages is basically the same, just different syntax for the same thing. I'd focus less on different languages and just one for the time being.
Take a read on a post I wrote up, I hope it's helpful: https://debugandrelease.blogspot.com/2018/12/how-to-become-b...
Is there any other option to build web apps except coding?
Learning is not my problem.
I've seen a lot of people who tried to become programmers just fail because they can't think like a programmer. However, I have found those same people are awesome testers, designers, planners, etc. I would suggest looking to see if you somehow are more better at something else in the web development realm. If you do find something then you'll at least be in web development and be part of something you find interesting.
That said, I would suggest to learn coding by building something that you actually want to build. Maybe you have an idea for a project that could make money somehow? Then learn the bare minimum you need to learn in order to build that project.
If you just sit there thinking "I am going to learn how to code" then you will likely dick around learning little bits here and there with no real aim. Coding is a means to an end, not a means in itself.
Here is another idea: take a look at the projects on freelancing sites like Upwork. Try coding some of them yourself. You could make yourself a goal to complete a paid project on Upwork within one years time. Pick a language/platform, find projects in that area on upwork, do them yourself as practice runs, learn the bare minimum you need to complete each practice project. As you do more and more you will learn new things each time and eventually you will be confident enough to do a paid project (though you will likely have to bid a pretty low price to get the job!). But you will have the satisfaction of having earned hard money for your efforts, even if its not much!
Learn by building is great advice because I learnt basic HTML, CSS, and WordPress when I built a website for Excel tutorials. In fact, whatever I have learnt so far it is out of necessity.
I tried on and off to learn programming for years, and I was never able to get any traction until I started doing it as part of an actual job. I just have never been able to get myself to focus on manufactured projects whose only purpose is learning to code. I needed actual business problems to focus on, and an environment where I couldn't just abandon my project with no repercussions.
I started out small, and with tasks that were related to my (non-programming) job -- these made my life easier but weren't on anybody's radar at the business. I was selling mortgages at the time, and built myself a better mortgage calculator, slowing delving into Excel's Visual Basic for Applications when I wanted to do things Excel wouldn't let me do without code.
After getting comfortable with that, I found more opportunities to do light programming that helped make my job easier, in the few hours at a time when I didn't have critical tasks in my day-to-day work. I started using SQL and VBA in Microsoft Access, then moved on to SQL Server and C# by taking a few freelance jobs. They paid terribly, but I took them more because they forced me to solve real problems using "real" programming tools. Eventually I was able to turn that SQL Server and C# toolkit into my full-time job.
TL;DR: what I needed were real-world problems to solve. If you can, find some way to write some simple scripts to simplify your everyday life, and use that to build on.