Coding Is Hard
duttakapil.com
duttakapil.com
Maybe you’re still lacking fundamentals? Seems like your strategy so far has been to grind tutorials and crash courses. They will make you feel like you’re learning a lot in a short time but in the end you’ll still not know what you’re doing, and you’ll keep struggling when facing new problems that are outside of the scope of the tutorial.
Maybe you’re learning from low-quality resources? Yes, the internet is full of free resources but most of them are useless and actually harmful, and some curation is needed. Instead of studying the basics over and over from endless free online tutorial/courses, just learn them once, the right way, from a high-quality resource instead. See: teachyourselfcs.com
Realistically you will never need to write it yourself unless you're coding in some very specific domains
It's at most a signal for whether or not they remember algorithms 101 or some leetcode exercise, but knowing that they do remember isn't really useful to me
Companies ask that kind of stuff at interviews lol
For bubble sort? Do you really think anyone should have to remember an algorithm to write a quadratic time sort? All you have to do is "compare and swap" and loop through until you are done, this is way easier than Fizzbuzz.
This is only hard if you have a hard time grasping loops, conditional comparisons or swaps. But if you understand all of those the sort writes itself. And understanding loops, comparisons and swaps is pretty fundamental to anything you do as a software engineer, so I'm not sure how any competent software engineer could struggle with it.
Engineering is about solving valuable problems. Solving some of those problems requires obsessive control over (and selection of) specific sorting algorithms, many do not.
Edit: it's also worth bearing in mind that many of the people who discovered these algorithms are famous in part for having thought them up. If data structures and algorithms were so obvious, nobody would know who many of these people were.
GPs bubble sort was obviously just an example, effectiveness of the algorithm or wether there’s ever need for implementing it by hand is irrelevant.
I think you have this wrong, Fizzbuzz is actually completely trivial to the point where the problem statement is almost literally (modulo modulo) a description of the algorithm.
Bubble sort is very easy but it's not literally trivial to the same degree as Fizzbuzz!
(Also a subtle off-by-one error, it should be 0 to |n|-1 and i to |n|-1.)
Fizzbuzz requires you to read and understand a few lines of requirements. That is much harder than just "order these elements, runtime isn't important", you can easily miss some part of the problem statement or misunderstand it for Fizzbuzz and fail, you shouldn't but it can happen, no such thing for a quadratic sort.
Or because you don't know the algorithm in question... The problem isn't bubble sort but any generic algorithms test. The examiner wants you to write code but not tell you the specification because it would be shockingly similar to telling you the solution.
When I read a post on HN about inverting a tree I was wondering how exactly you are supposed to invert the child and parent relationship so that children point to parents instead of parents pointing to children. I.e. leaf nodes are now at the root and the root node is where the leaf nodes are supposed to be. Then someone said "He meant reversing the tree" and I'm like "That is not what he said."
I don't think anyone would care if you did an insertion sort or some other brute force way to sort. Brute force sorting in general is trivial to come up with.
You'll often see responses like "but many people don't need to write sorting algorithms from scratch in their day to day work, so they're out of practice". But to me this attitude itself is indicative of the issue.
Being able to do this doesn't require sorting algorithms to be well-practiced and fresh in one's mind. It requires a general ability to visualize and reason about simple data manipulations. Which to me is an absolute fundamental for a programmer working in any field.
If the algorithm can be described with a small sketch or a couple of sentences, generally an implementation should just flow for an experienced programmer who has general fluency? For something like bubble sort, the description can be more or less directly translated to code.
The fact that someone even conceives of this as something which needs to me memorized / practiced suggests to me that they might not have that kind of basic working fluency.
When you tell them how the algorithm works, it feels like you are not testing anything except syntax.
If you let people look it up, it feels like you aren't testing anything except their research skills.
It is difficult to have a test in a vacuum. It would probably be better to have a test with multiple steps.
Exercise 1:
a) Research the topic bubble sort. Explain what bubble sort does and write some notes or pseudo code that will help you implement it. Once you are done, we will disable internet access and close your browser.
b) Write a working bubble sort in COMPANY LANGUAGE.
c) Modify the bubble sort so that it can sort by multiple columns.
The first tests your research skills, the second your syntax skills and the third your ability to deal with changing requirements and implement novel functionality without research.
I think the difference between professional engineers and person writing the blog isn’t necessarily skill. I think it’s how we react when we make mistakes. Maybe the real test of a programmer is watching how calmly they can write their buggy bubble sort, then test it and fix the bugs. Bugs happen. How we roll with the punches is what makes some people great.
Bugs have been found in production binary search.
Skipping bubblesort, I think quicksort is easy to implement, if you know Hoare's fp insight (I remembered it, but had to check it was him). Making a version that is both efficient and correct may be harder for me... Similar for Boyer-Moore substring matching (I remembered their names!)
Could you please provide more information on this?
You pick a number in the list, then put lesser numbers into a left-list, and greater into a right-list. Recurse.
It's very slow as intuitive, simple and elegant fp, because it's creating new lists like crazy; but a mutable, in-place version (e.g. in C) is super fast. Maybe the origin of the folklore "learn fp to be a better coder, not to code fp"? I don't think he expected it to be so good; he was just doing him. A very smart man.
This. Many programmers, for some reason, act like skill is a complete order; you are either more skilled or less skilled than someone else. In practice you are just familiar with different things, so if somebody doesn't know something that feels trivial to you, it just means he didn't encounter it in the same way.
I told him to be patient, to insist, to commit time learning not only typical courses of how to code your website with a database. In fact I gave him advice against doing that first.
I adviced him to learn binary/hex, algorithms, data structures and structured programming as a minimum. Also how a machine works (at least the abstract model): memory addresses, data, pc.ñ, call stack... etc. Interpeters vs compilers, some OS basics (though at first can skip most of this). My advice has been to first learn with Python and later C.
Understand why or when to use functions, certain data structures, etc. Do increasingly difficult but basic exercises.
And specifically, develop a sense and taste, at the end, on how to figure out how to code a solution to a problem he never saw. Cost analysis also helps lots and must be learnt at some point.
This is what happens when you gothrough random courses, exactly:
> Maybe you’re still lacking fundamentals? Seems like your strategy so far has been to grind tutorials and crash courses. They will make you feel like you’re learning a lot in a short time but in the end you’ll still not know what you’re doing, and you’ll keep struggling when facing new problems that are outside of the scope of the tutorial.
That is SO true. You have to start from scratch. I mean it. Because when you see something like s stacktrace that goes from Python to your native library with memory addresses you will understand NOTHING when the time comes.
Programming is a discipline where you need a lot of practice.
To be honest, I don't have an objective reason to learn much CS as that's not my layer, so I'm butting up against my own ignorance any time I try to advance in something easy. And then my ADHD determines memorizing that information is unnecessary so I struggle to get concepts to sink in.
Recently I discovered Roblox uses Lua so learning that to make silly experiences for my son sounds wonderful. It's goal oriented so I can convince myself it's worth pursuing, and I feel like Lua concepts will help expand my toolkit for the future. But I'm also not starting from a blank IDE page going "geez how do I even know what to start building first..."
The problem with not understanding things is that when you face a new problem or things crash or go wrong you get totally lost and do not know how to proceed at all.
Another recommendation if you want to learn is that you use a terminal and an editor. Nothing else. You will see things closer to how they work. You will be aware you are launching a script or compiling a file. You will see the output files, you will understand there is a compiled file to be run. You will see if it is native code you run it directly but if it is compiled to bytecode you need a VM, etc.
That is part of the details one must be aware of.
When I was 16, I had software skills but was clueless about what to actually build. Now I know what to do and don't have enough time to do it. The idea of grinding two hours a week just doesn't work for me. I want to do things in bursts. Like working 10 hours on it and then weeks of nothing.
There is definitely a lot of overlap here, but I have a finite amount of time that I can put towards solving problems. I've been thrown into AI over the past 6 months and know none of the fundamentals of this space, but I can still be very productive.
My process now is to know how to pull up docs quickly (in my editor), take advantage of the LSP, use my debugger and learn the systems on the fly. I'm probably not going to take courses in AI, Data Science and other aspects of this discipline as it will only have a marginal affect on my daily activities.
My job is to understand the flow of data, so I need to focus on that and make sure my process, tooling and access to documentation are the best possible to accomplish that.
At the same time, it saddens me that the thing I love so much becomes a source of frustration for many others.
This is a problem most commonly seen in junior developers. It leads to them making poor decisions that are not aligned with business goals.
> I'm glad I program because I enjoy it
Spend enough time working in the industry and that will go away.
For your mental health's sake, I hope you find a hobby that is unrelated to your job. What you are describing is a very common path to burnout. Been there, seen many classmates go through it as well.
An important reason things have worked out as they have is because I continue to enjoy coding and I don't allow what I work on to be controlled by "business goals".
While your somewhat cynical take may reflect the experience of an overwhelming majority of the people who write software today, it isn't a description of the only pathway along a life as a programmer.
Those who are good at it and love it don't simply retire. They just decrease their hours and continue their craft for as long as they have the health and energy. It probably leads to more healthy years to have something like this.
> I don't mind whether what I'm coding is useful or ends up generating money
you can have it both ways; i'm happy that I enjoy it _and_ i'm happy it's useful to others :)
>As frustrating as coding can be, I am still in love with it. I love to see my code work, I love it when people can use it, play with it. I love building things, solving problems. I love making progress through difficult challenges.
The "idea guy" part of the story was from the writer's past.
> I went through all the tracks, from basic HTML (again) to JavaScript and even Ruby amd Python. And I was super proud of myself for doing just that. I then started this 2-day python crash course...
> It's been 10 years since I first started learning how to code. And I still struggle with it, a lot.
> I go back to the basics, again and again and again.
There shouldn't be this much struggle after 10 years. I wonder if your issue is you were never intentional in your learning and practice and just bounced from topic to topic. You say you're the "idea guy." There's a saying that it's better to finish something than to start something.
I'll admit to being a little shaky on the types of programming needed in enterprise projects at the beginning (less of a focus on maintainable code, but probably more of a focus on what the machine is actually doing), as I only knew exactly what I needed to hack together whatever my hobby project was, but after 5 years of a career and working in 9 different languages it's been pretty easy.
I mean, occasionally there's something that takes a bit to work into my brain's L1 cache, like the precise semantics of prototypical inheritance in javascript, or call by name in scala, but for the most part, everything's been extremely transferable. A hashmap is still a hashmap in any language.
The idea that he was jumping from course to course, across a bunch of different languages made it seem like he valued having the identity as someone who built something, but didn't know what to build. The gap year suggests that as well. I've been in the same boat and the only thing that moved me forward was having a project to work on that I cared about. In my case, I had a normal job with some down time, and learned to code to make that job easier... no courses, just reading the docs and trying to solve the problem right in front of me. I actually had programming classes in college before this, and while I passed without issue, I never felt I learned how to code or built by own stuff, and years passed between that course and when I felt I actually learned. Having a problem, breaking it down, and building a solution, one small bit at a time, was required to go from knowing some basic ideas of syntax to knowing how to solve a problem with code.
Those who put down others or leave nonconstructive feedback, even HN commenters, are not worth your time worrying over.
When I first started pushing out shit code on GitHub, I did it under a pseudonym and never tied it to my real identity. I think that really helps when first getting started since you know it’ll never affect you personally. After getting the hang of it, then perhaps tie that to yourself.
But to be honest, I doubt anyone cares much about your/my code nor would they bother judging it.
Of course, I’ve only been programming for ~5 years so I might be missing stuff.
There is some source code I've looked at that I thought was clear and easy to understand (at the time at least. I also like simple C/C++ code that compiles with "make", ideally with minimal #ifdefs and without lengthy configure scripts.) This is very rare in my experience, although I really like to see it!
Seriously, building things that are fun and interesting to you and getting them to work is one of the best things you can do. Once you have something working then you can decide whether you can just clean up your existing implementation or whether you want to reorganize it or rewrite it completely, but you'll be at the point where you understand your problem and its solution.
Unfortunately brittleness is baked into virtually every computer system and development process: it's all essentially predicated on a series of finicky text files (source code, config files, etc.), none of which have any inherent, enforced relationship to each other except when seen through the lens of an IDE, compiler or interpreter. The system as a whole doesn't enforce meaningful constraints, and when it does you often have nothing more to go on than a cryptic error message.
Unfortunately that has been the nature of software development for the past 70+ years. Some developers are creative, willing, and talented enough to deal with this realm. But it's not for everybody.
But it’s definitely worth implementing the core concepts in total, both for whatever goal and your own learning. The rest just needs a working mental model, but actually implementing is a waste
As an aside, I’ve found this also holds true for most games, and stopped bothering to finish them (you can usually understand most games in total very quickly, largely because their systems are so shallow)
Learned HTML/CSS in 2012. Built an app in Rails in 2014. Learned basic Javascript in 2018. Delved into React in 2020. Shifted to no-code. Back to Fundamentals in 2023.
I think its hard to really be good at it, but depends on the goal. Most people want to be software engineers for the wrong reasons these days. To me it was always a hobby and if I can build some small useful things for people with just front-end and a database its a win.
Its not easy though. It never was. It requires commitment and patience as well as regularity beyond tinkering with it 1 time a month.
I think the issue is that there are too many low-quality programming resources, and the author should have asked for help. You won't have a personal mentor for free, but there are dozens of people in support channels to help you learn, all you have to do is ask. So many people have helped me understand hard to grasp things, and I've been very fortunate to have people around with expertise that can teach me as well.
Doing programming these days is brutal. Layers and layers of abstractions and you have no idea what's going on behind the scenes. My ADHD brain requires me to know why I need to do something, and how it happens. The more programming feels like math, where you just have to blindly follow steps, the worse I feel doing it. Thankfully, I've looked into many resources understanding how the hardware works, how memory works, how the CPU works, how the OS works. It's been a necessary foundation to make sense of anything. The bottom up approach was the only thing that kept me sane. People like Casey Muratori teach you how to program the right way.
Blindly following steps, whether in math, programming or anything else, does indeed sound unrewarding.
In my experience programming is less having it all in your head and more where and how to look things up. Because pretty much no one has it all in their head, and the ones that do are hyper-specialized workaholics and would be just as slow as anyone outside of that specialty.
This! I was helping teach web dev to a first year student in uni: I realized that for some beginners, knowing what to search is just as important as being able to code.
Having been programming for 5 years (not much but I do dedicate pretty much all my time to it), I feel like the secret sauce is being able to type in the magic words and be able to get the result you’re looking for immediately as the top results. That and being able to read the source code of libraries & lower level code to understand behavior.
Sigh. Refactoring is hard. Finding the "right" structure (whatever that means) is hard. Changing the existing code from one structure to another is hard. There is a huge amount of uncertainty and so many ways for it to go wrong. There are an infinite number of ways to change things and you don't really know which change is "best" until you try a lot of them and then look at what you made. Now that I'm 25 years into this, I have a sense of where the dead ends are and how to avoid them, but after 10 years a lot of people don't. And I still go down dead ends sometimes. The key is realizing when you're on a dead end as quickly as possible, then stopping and doubling back. Cut that sunk cost loose.
If you go into something with the expectation that it will be easy, you won't have the right mindset to deal with difficulties. When you hit difficulties, you'll strain against them instead of calmly taking a step back and reassessing the situation. The problem isn't being dumb. It's the act of straining itself, which makes you dumb.
Most difficulties are caused by not fully understanding the problem being solved, and the "easy" solution turns out to have overlooked some of the essential complexity that needed to be solved, which leads to kludges piled on kludges. Understand first. Then solve.
It's important to have a problem solving process. Look at times that you did find a solution. How did you approach it? What was helpful? What wasn't? Refine your process over time, keeping what works and discarding what doesn't. Then trust your process and relax. It's just a website.
If you're chasing after it as a career and coding feels persistently hard and unnatural, you might be aiming for a career not really suited to you. On the other hand, if you think making software is cool and you're just quite finding it easy all the time, keep grinding and you may get there. At least in this latter case, you'll be grinding on something you care about as you try to get there. If it's just about money (be honest with yourself), that can be found in a lot of places and some of them might come a lot more easily to you.
These Seniors might be good at duct taping, overengineering or have a "my way or the highway" mindset but aren't capable of finding and implementing a good solution given the constraints.
It probably boils down to factors like intelligence, creative problem solving, ability to focus, reading skills, knowledge retention and a healthy dose of humility.
I guess everyone can (and probably should) learn basic coding skills, but it doesn't mean everyone can become a great software engineer.
There are few fields where the capacity for problem solving is more relevant.
People do have innate limitations. I agree that it's dangerous to categorize one's self too harshly, but it's also important to understand your own capabilities and limitations.
Telling people they have no innate limitations sounds nice, but probably just results in them becoming more frustrated and confused if they do hit those limits later on.
I say this as someone who has hit my own limits before. They exist. Maybe not in an absolute sense - I could likely learn nearly anything - but in a relative sense. If it takes me ten times longer than the average participant, it's simply not viable as a career. As a hobby? Sure, go wild.
It's possible the things you're trying to do are just too difficult, but you are incorrectly assuming that they are easy and that everyone can do them. (This is especially common in game development - someone wants to create a 3D open-world MMO, not realizing that such projects typically take years to develop, even for teams of dozens or hundreds of engineers and artists.)
It's possible there's some fundamentals of programming that you never properly mastered. People sometimes go through multiple programming courses, but still have a shaky understanding of how basic control flow works, then wonder why they are struggling in their higher level courses.
It's possible you have some other weakness without realizing it, like (for example) trying to code from memory rather than regularly referencing the documentation (some people have this weird notion that you're supposed to memorize what every function does, when that actually couldn't be further from the truth).
Without working with you directly, it's hard for me to say what the exact problem is. You should have someone sit down with you and help you identify what's causing you to struggle.
Recent experience, trying to get any deep learning to run on my machine. Instructions all over the place about installing python, conda, making a virtual environment, installing certain libraries and when I finally get to the "run" command it doesn't work.
Similarly using many new libraries/frameworks, getting stuck on some detail and having to spend 20, 40, 60, 120 minutes trying to find a solution. This happened a lot, and still does, getting up to speed with TypeScript, not knowing how to express the types needed for some complex thing and not knowing how to even ask the question to get an answer. Posting on S.O. will just get closed but I don't necessarily know how to search for the answer. Recently I even tried asking ChatGPT but it failed too.
That said, I also understand, that there are many concepts I intuitively know that someone like the OP does not and that it's very hard to remember what it was like to not understand it. Pointers, pass by value, pass by reference, maps, stacks, race conditions, promises, file manipulation, memory, binary, hex, various math and solutions. Getting to the point that all of those things and more are 2nd nature is basically spending time coding for years just like becoming a good guitar player is spending time practicing for years
Why is that supposed to be easy? When things start to sprawl, and more and more tech debt gets left behind (i.e., in the codebase) then complexity increases, as do the risk of balloon grabs (i.e., grab in one place and something pops out somewhere else).
Of course you're tired and demoralized, every change has to be second or third guessed.
It's a mandatory class at CMU for anyone who gets near computers. They have like 2 or 3 versions of it, designed for different departments (with minor differences, in my view). The CMU undergraduate students were benefitting from this class since 1998. Now, usually abridged, versions are being taught at all major CS Departments.
There are several free versions of the class available online. Here is a Fall 2017 version, with video lectures [2]
[1] https://www.cs.cmu.edu/~213/
[2] http://www.cs.cmu.edu/afs/cs/academic/class/15213-f17/www/sc...
I often think of coding like making music: you don't need to be an expert at an instrument to make nice music - so much to the point where "making music" and "playing an instrument" can be considered very different things.
Sometimes I just need to take a step back and look at it the next day. Sometimes it helps, sometimes not. Sometimes taking a walk helps, or cycling, or taking a shower.
But when I feel frustrated, I know it's an uphill battle that will be mostly unproductive, mostly productive in getting a look at it, some reconnaisance.
I've come to feel that while I love reading HN, it's quite toxic as well. It's like the instagram of coding - every person is so smart, so authoritative, such breadth and depth of knowledge they are all making $300k/yr+ and profess how easy it is to find such a job. It can be really demoralising and even depressing for people who are struggling to be exposed to such potent concentration of things like that.
So it's great to hear someone being vulnerable and owning up to struggles.
I would say, my approach when I hit the types of feelings you express is always to drop down a layer to fundamentals. If X is hard, why is that? It probably means your knowledge isn't sound at some layer below the one you are working at. It sounds like a huge amount of your learning approach has been based on online learning and the issue with these is that they are usually very shallow. They teach you a direct skill but nothing underneath it. So drop down a level and just take time, to properly fill in those gaps. Steadily unravel what is going on one level down. Don't keep battering at the level above constantly getting frustrated. Build your knowledge at the level below. Learn the joy of patiently establishing a sound basis and a complete knowledge of the underlying principles on which something works.
The hardest part is the big gap between "I can write a function that does X" and "I can write non-trivial software that does Y".
That's where you're hitting walls - because there are a ton of them, and it is demoralising to try something that "should" be simple but end up spending numerous days and weeks fighting problems you didn't even realise existed.
Even experienced programmers have this issue. It's why a lot of us seem to think estimation is basically impossible. IMO it certainly is possible to estimate fairly accurately, but it requires a very good understanding of the problem, the technology, and the people involved.
First try to limit your problem space, only one or two new things to learn at a time. Use only mainstream ("boring") technology. Then spend a few hours every day banging your head against those problems. (Every day, not every weekend. A few hours, not 12 hours.) If you can, set goals you can achieve every week or two to keep morale up - small projects, proofs-of-concept, etc.
(I've been doing this for 20+ years, and if I'm working on stuff I'm comfortable with I'm pretty good. If I compare myself to people like John Carmack or Fabrice Bellard I discover am comparatively very very dumb indeed.)
I have added and removed about 4 million lines of code:
https://github.com/wekan/wekan/graphs/contributors
to WeKan Open Source kanban:
You are not dumb. It is normal to feel frustrated, when figuring out, step by step, how something works, and what to do. It is like labyrinth. Having enough breaks, taking a walk when needed, having enough coping skills or adding more of them, having patience to keep notes of what is current position in that labyrinth. If some way does not work, try some other way. Getting something working is victory feeling.
It is always about the basics. Many programming languages change syntax often. Some dependencies change.
For example, when writing some for database export:
1) There was no working code examples at documentation
2) Google etc searches had old info, did not work
3) I did not find from source code how it did work
4) ChatGPT, Bing AI etc examples did not work
5) So I tried with trial and error, what is correct syntax, character by character
For some error messages, sometimes Google search shows somebody having same problem, or even a fix. But if not, it's about reading source code of the software.
But this works only when code is available, like in Open Source.
If something is binary executeable, then there is need to decompile, read assembler, deobfuscate, etc. That means even more time required, I have not gone there yet. That is why I use and develop FOSS, when it is possible to more easily fix something, when it is broken.
Famous last words.
If I knew beforehand what it all would entail, I would never have taken over that project. Therefore I do feel lucky that I was so naive, it brought me many good things. Nowadays I easily see the scope of taking over a project and I hesitate a lot more doing that.
Kids these days
:P
how did you learn to program computers without computers around?
I soon figured out you didn't really need the roll and cardboard window, and could just do the while thing on normal sheets of paper.
Got to try it out for real on a borrowed TRS80 not too long after that though.
It was so very barebones with less than 2K free memory if I recall correctly. Later I found another local electronics store with a C64 which was bliss.
The key is to keep testing whether you can do the work cold, with no-handholding, at every step of the way. The steps to follow are the same ones they gave us in elementary school when we were learning how to spell: look, cover, write, check. First, look at the information until you feel you understand it, then cover it up and try to replicate it cold, and finally check your work against the original to see where you went wrong. If you can successfully close that loop over and over again, your brain will learn. It has no choice.
Many CS courses that I am familiar with (particularly systems courses and programming/project courses) can take something like 20 hours a week rather than the 5-10 that a regular undergraduate course might take. The best approach in my opinion is to not overload yourself when you are taking such a course - either pad your schedule with less time-intensive courses or take fewer units.
I'm actually in favor of handholding - particularly getting help from course assistants, attending practice sessions, attending office hours, etc. Individualized instruction can help a lot, and at a university you're paying for it regardless of whether you take advantage of it. Some schools even employ a small army of course helpers and section leaders (often selected from the previous cohort) to provide individualized instruction, and I think it really helps more students to succeed and have fun.
Self-study can be much harder than formal study because you may not have people like the course staff to help you out (though it's good if you can find someone!) Also you may not be able to cut back your workload outside of the course. On the up side, you can proceed at your own pace and don't have to worry about being left behind!
> CS50 at the same time and had challenged myself to finish the 12 week course within 4 weeks.
I'd recommend spending the full 12 weeks. This gives you more time to put in the effort and I think taking more time - and having more nights to sleep on the material - helps with retention.
Turns out after you spend a decade solving problems and creating/maintaining products that “coding” is probably the least difficult part.
These days I’m relieved when a task involves just some rote coding rather than racking my brain stuck in a debugging breakpoint for 3 hours to change 5 lines of code to get it to work correctly.
I am going to be contrarian and be harsh on the OP but for his own good. Empty "feel good" responses that i see here are actually toxic positivity at work.
Grandiose opinions about oneself, making excuses for one's failures, being unclear about one's goals, not applying oneself seriously to actually studying something, not understanding the difference between true knowledge acquisition vs. posturing for the same, caring more about others opinions of oneself and allowing that to define oneself etc. are the original sins.
The answer has always been the age old advice "Apply yourself systematically and work hard".
Sit down, quiet yourself and ask "What are you trying to do and achieve?" Narrow it down ruthlessly to something small and specific and then do it.
Even after 20+ years of coding, there are very little moments of feeling on top and fully in control.
The other end -- feelings of "damn I don't get it, why won't it work" and the feeling of being overwhelmed by a big mess -- is quite more frequent.
The weird thing is that thinking "I'm no good at this" is an easy trap to fall into. Sometimes I feel software engineering must be one of the hardest jobs in terms of mental flexibility, constantly trying to figure things out and adapting to new frameworks and ever evolving ways of working.
But most probably there are plenty of other jobs with the same kind of complexities.
the problem should be that maybe it doesn't make sense to so do in a given context, not that you couldn't choose to do that.
I mean, yea, technically? But when the codebase gets very big, it can become intractable to chase every issue down.
> given enough time.
Okay sure. One often isn't given enough time though, if it's for a job.
But I wouldn't describe it as a feeling of absolute agency. More like pressure-induced minor chaos
But, if you do decide to keep at programming:
1. Pick a much stricter language, with a strong static typing system -- like Rust. It might be too difficult and frustrating though, and I'd understand if it's a bridge too far. It that's indeed the case then pick Golang, it's a good compromise between productivity and strictness.
2. Write more tests. And I mean much more tests. From your article, you seem to have the problem of rushing too much and never stopping and establishing a solid ground before proceeding. Writing tests guaranteeing that what you wrote before will keep working will keep you in check and help you stop and think harder on how to fix the current problem.
I might be misreading your post, but you seem to be impatient. One more thing I completely relate to but it won't ever get you anywhere, sadly. Work hard on breaking down your tasks into smaller chunks and crossing them out as you progress -- works wonders for motivation.
Good luck.
It's difficult to keep working on something when you thought it would be easy but is actually hard.
The author of the original post seems like he thought coding would be easy and now is disillusioned because coding requires more than he expected.
To work through programming problems, it really helps to be curious and want to learn why something failed. If you don't understand why, you're clearly just changing things until they work. Programming is seriously punishing to those who try do things without understanding why.
This is a sign of technology with insufficient abstraction. Computation has largely been built on the shoulders of giants with a "You shouldn't need to know" mentality.
Think of code in abstract "bits" of information (not necessarily in the data/ram/storage sense)...
The more bits of information from seemingly unrelated sources that you must retain, the worse the codebase is. In the worst case editing 1 bit of source code flips 50% of the remaining bits, ie perfect obfuscation.
In a perfect code base, changing a bit would flip no other bits (say in other packages), because all of the change would be perfectly contained.
There is a pragmatic balance due to timelines, brevity, reaching perfect abstraction might itself be more complex than an "imperfect" implementation, and the sheer ingenuity of it might challenge or exceed some of our IQs (certainly mine).
Slowly, the function starts to make sense.
Another thing that works for me, is I write a unit test for a function. Personally, I’m beginning to loathe encapsulation in classes, because what would be better would to write a unit test for the extracted function, but if it is a private function - we’ll, that means you can’t easily write a unit test.
On that last bit - the only way I know of unit testing private functions is to ensure that a unit test for the public function is writtten. I then place a temporary assert into the private function code path I am exercising and run the unit test. If the test fails because of the assert, then I know I’ve tested that code path.
A dreadful way to test, at least that’s how I feel. I am increasingly looking at Haskell which is a revelation! I now know why some people aren’t happy with OOP…
Then, over time, you start to get the hang of things and can read the docs and debug your own problems decently enough.
Once you start working professionally, coding becomes the easy part. Your days will be filled with design discussions -- trying to figure out how to fit new features into your existing system that was already designed and built without those features in mind. That's the hard part. After you've figured out your new designs, coding is the easy part.
ADHD is certainly not a good starting point.
P.S There are certainly a few geniuses who code quickly and well. But they are true exceptions, not enough to run an industry.
When I hit a wall, it's often futile to continue working on that single problem. So I'll just leave it as is is for a day and work on something else.
When I revisit task one the next day, I often have a fresh approach or I'm able to spot that bug I just couldn't find the previous day.
Other devs seem to prefer working very "linearly", but I'm doing better if I juggle several tasks at once.
I've solved a lot of algorithm challenges (LT and CW) over the years but I recently reflected on why they don't seem to be getting easier. What I realized is that while I know how to write code, my understanding of the supporting problem solving strategies is weak. I don't understand the why very well.
It's possible you suffer from a similar situation. You jumped straight to the code and skipped over the theory. You know how to use the tools, but have limited training in how to design the house.
Consider investing some of your time watching people like Abdul Bari (https://www.youtube.com/@abdul_bari). It will help you start to build a better understanding of the "why" of writing code.
I had done a lot of self-taught stuff as a teenager, but honestly the essence of programming eluded me until 12-18 months into my CS undergrad. A lot of it was just the reps, but the structure of having a dedicated professor and assignments gave me a focus that really helped. I also think it was good to work primarily with backend languages like C, C++, Java and Scheme without the distraction of web and GUI elements that have a world of complexity (often incidental) that distracts from understanding the basics of data structures and algorithms.
The next big leap was working on a team in a professional setting. In my case it wasn't even with other programmers, I worked primarily with non-technical stakeholders as the sole web designer and programmer on a design team that primarily did print design (yeah this was a while ago). Even though I didn't have technical mentors in that first job, just the accountability of having to deliver on some projects that multiple people were contributing to taught me a ton about how to do what was necessary to consistently ship. This is the number one thing to improving: you've got to ship and keep shipping. If you get stuck, cut scope and ship something simpler. Just never stop shipping.
Finally, a word on motivation. I'm not here to judge anyone's motivations: do whatever works for you. That said, I feel the best motivation for getting good at programming is curiosity about how things work. If you're not innately curious about technical things, the steady stream of compiler errors and bugs will eventually grind you down. Perhaps this is what the title is referring to. Personally I don't think of programming as hard, but that's because the high I get from debugging a thorny issue outweighs the pain of understanding the root cause. Multiple times the author discloses an expectation that something should be easy, and then getting frustrated when it's not. Whatever your motivation, you've got to have some tenacity and grit to put in the work to power through—that's how it will become easier over time, not due to innate intelligence or time spent on tutorials/videos/reading materials.
But...
You have to start the project yourself. You have to start it with your tools, your language preference, and your ideas.
It gets harder when you have to adapt to someone else's environment, practices, requirements.
It is harder the further you stray from your ideal choices.
The only thing that changes with experience is the growing faith that whatever state you’re in now, you’ll be in the other shortly.
Everything we build is somewhat broken some of the time and layered on other things that are somewhat broken some of the time, all the way down to the interpreter baked into magic sand which is itself somewhat broken some of the time.
So yeah, the field is intellectually demanding. The top level symptom can be "wrong answer" and the root cause "error in someone's verilog from before tapeout". Or "sometimes it's broken in prod" and the answer "solar flare".
a) contain many leaky abstractions.
b) are unnecessarily complex in order to adhere to a specific ideology.
c) have various gotchas, either documented or undocumented.
d) the basic concepts behind them make sense only to the authors.
e) do not contain any abstractions at all, exposing all raw technical details to the user.
f) many details about their parameters are not documented at all.
g) have undisclosed side effects.
h) not implemented in the same way in different platforms. etc.
With all these and many more, a newcomer to coding can feel lost for many years.
And when you're done, start working on your next project and you will notice you can reuse some of the knowledge you already have. Make sure every new project challenges you.
“I tried to do a 12 week course in 4 weeks” … and failed, fell into a flurry chaos of self doubt and gave up.
You are not going to shortcut it, you’re running in circles because you cut too many corners.
Take a big breath, focus yourself, divide your tasks into smaller chunks until you can actually solve them, and keep going. There IS NO QUICK FIX.
> And that was when reality slapped me really hard for the first time on my face.
These two consecutive paragraphs seem contradictory.
https://www.joshwcomeau.com/blog/how-to-learn-stuff-quickly/
You are hitting your intellectual limits, when you feel dumb.
If you didn't 'touch the walls' by feeling dumb, I would wonder how much you're learning.
Could we make coding a little harder, please?
Performance = potential - how much you get in your own way.
Gallaway says everyone focuses on the outer game. And ignores the inner game. And that inner game is what stops most people from learning tennis.I’ve been reading The inner game of music lately, which was inspired by the inner game of tennis. There was an exercise in the first chapter - which I did and it made me cry. He said to just sit down at my instrument and play anything, while saying out loud all the inner thoughts. I must have talked for about 20 minutes straight - “I’m worried I’ll look like an idiot. That note didn’t sound good. I’m worried my GF will think I’m bad at piano and unlovable. I’m worried that I’m not very good and I won’t get better than I am now.”. It went on and on. I don’t have a problem with the outer game of learning piano. I’m held back by the inner game. When I play I swear half my brain is devoted to generating, and quashing those thoughts. There can’t be many brain cells are left over for actually playing and listening to the piano!
> And yet, every single day, I have felt frustrated, annoyed with myself and the problem I am trying to solve, mentally exhausted, stupid, dumb, feeling as if my brain is just incapable of grasping these simple concepts, keeping these simple details in mind.
I’ve been programming for 30 years, and by any external measure I’m really good at it. I’ve been doing it since I was 8 or 9 years old. For some reason I don’t doubt myself in programming like I do in music. Do I have setbacks? Every. Single. Day. Finally my point: We might be no different in our actual programming skill. Yesterday I refactored a simple 10 line for() loop. The new code should have been equivalent but it somehow wasn’t, and it took me 2 hours - even knowing where the bug was - to figure out why.
How many of your brain cells are actually devoted to programming, vs generating and quashing all your negative self talk? It’s possible you just need practice, and to go back and watch a Python course for the Nth time. But I suspect your trouble is you’re struggling with the inner game of programming, not the outer game. And you’re only programming with half your brain. Someone once said that the average error rate for a professional programmer is about 1 bug per 10 shipped lines of code. For every 10 lines of code written by professionals, we maybe write 3 bugs and only find 2 of them. If every one of those bugs is evidence that you’re an idiot, programming will crush you.
But the thing to learn isn’t how to make programming “smooth”. If you do it right, it will never be smooth. You aren’t making 1 million pizzas. Every program is new and different (else you should just reuse your old code). The thing to learn is how to stop abusing yourself like this when you struggle. As you said, Programming is hard. But you’re doing fine.
And read the inner game if you have a chance. If I’m right, that’s where the work is. Not in some Python fundamentals course you’ve already seen 8 other times.
It's 2 am here right now. I wrote this post very quickly in about 30 mins on the recommendation of a friend to just take my mind off things before going to sleep. I was not expecting it to get any real attention, and so did not attempt to provide much context in the post.
Genuinely appreciate your comments, especially those with encouraging, emphatic words and guidance. Also great to read your own personal journeys as well.
Although I started learning to code 10 years ago, I have not actually been actively coding for all these years. I have worked as a full time dev professionally for maybe just 3 months, and quickly moved into management roles from there.
My primary expertise today is more towards product management, sales, marketing, etc than coding. I currently work in a Enterprise Sales role, and my goal is still being an entrepreneur and building companies.
Zooming out and looking at my entire history, I have spent very little actual time coding. This is the primary reason behind the struggle I express in this post. I feel frustrated with how much little time I have put into it over the years, and how little progress I have made.
Also, perhaps important to note, I have diagnosed ADHD, chronic anxiety disorder and some level of bipolar as well. I don't like to attach these as part of my personality, but it explains a lot of my impulsivity, grandiose thinking and mood swings, which contribute to my frustration significantly as well. Also the reason why I could never learn well in classroom or with tutors. Self-learning has always worked better for me.
The post is intentionally very generic and vague, and doesn't give any specific examples of what I was struggling with and why, simply because it was more of an emotional post to express my frustration from the past week. I also have not written anything in a long time, so this was a good excuse for me to quickly write and publish something.
I recently started working on a new side project, and I have a team of people working with me, but we have been falling short of hands, and so I decided to get more involved in the development, and things were going great until last week when I started trying to refactor our codebase. I hit many walls with things I did not fully deeply understand, and struggling to keep track of a lot of different changes as I was making them - thus ending up breaking things and compounding my frustration even more.
I am currently strongly motivated to get better at coding. That is what prompted me to talk to my friend, who is the best engineer I know, and who encouraged me to write down my thoughts and publish them.
I am certain that with persistence and consistency, I would get through and not struggle as much as I have in the past week.
I have found that doing sessions of coding with colleagues and students— even if they don’t know how to code— seems to make my intelligence come out to play.
My mind seems to need an audience to please.
I wrote about this in my book on self-education: Secrets of a Buccaneer-Scholar
If you try to put a banana in there it won't fit because it has the wrong shape for that. We say that the type of the variable (the box) doesn't match the object.
The analogy can be extended to talk about null values (empty boxes), arrays (boxes with slots for multiple objects), etc.
The analogy works because it's not far removed from what is actually happening in memory. And while laypeople don't know what computer memory is, they have a good intuition about boxes.
Next level of difficulty for newbies is arrays: understanding expressions to set and get values in an array; variables that hold indexes; non-numeric indexes; each of these is a potential huge stumbling block for newbies. And remember, these are just basic programming skills. Things get much harder from there.
The concepts of data manipulation, let alone the mechanics, are difficult for many newbies. Some never get past that point.
That's where I learned before I ever saw any code. When I did see the code I was confused by "x = x + 1" since it makes no sense mathematically, but assignment and state were obvious and intuitive after that.
There are dozens of other things you might be great at, and every minute you're spent flogging the dead horse of becoming a coding genius, you're missing out on the opportunity to practice something you're really talented at.
I can't imagine how someone with 10 years of programming experience would make this assumption.
Personally, I'm not a great developer, but I was even worse at all of the other things I put a lot of time and effort into. And at the end of the day I do enjoy programming. So remaining an average developer it is.
Meh this is just cope. The things you are talented at may not be valuable, they may be outside of your reach, specifically if you’ve wasted enough time that your time for discovery is over. Flogging that dead horse probably pays the bills at least (unless you’re a total incompetent, in which case, yes find something ) and then some.
To be fair it sounds like OP found something else, but I’ve known people who never did or never could.