Hacker News new | past | comments | ask | show | jobs | submit login
Coding Is Hard (duttakapil.com)
121 points by duttakapil 10 months ago | hide | past | favorite | 157 comments



In my experience it’s not supposed to be that hard, unless you’re working at the cutting edge or on really hard problems. But from what you’ve written it seems like you’re struggling with basic stuff.

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


The author says he struggled with concepts that are “easy” or supposed to be. In my experience of coding since 6th grade and having been in the industry for quite some time, it’s difficult to say something is supposed to be “easy” or “hard”. The author doesn’t give many concrete examples so it’s possible he is just assuming certain things should be super easy… A lot of programmers I meet love to claim they don’t struggle with basics, then I ask them to write be a simple bubble sort or binary search from scratch and 90% cannot do it. They could only do it when they could reference or look it up. Everything thing seems “easy” after you learn it. There’s this romanticized super genius idea everyone thinks they need to live up to but that portrayal is simply fake. No one’s grasps things instantly.. I am a researcher at MIT. I work with arguably some of “smartest” people on the planet, and even they struggle with basic concepts from time to time, as does everyone. There is simply too much information for any single human to know it all, and learn new things instantly. It doesn’t happen…. Most things that should be “simple” or “easy” always end up requiring significant effort because we don’t truly know how to do something until it’s actually down. Forgive my spelling and grammar errors. I am typing on a phone and my hands are just too big to do it quickly.


I don't think writing bubble sort from scratch without mistakes is necessarily a good demonstration of someone's ability to "handle the basics"

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


> 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

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.


Every technical thing you know is informed by your practice in an area. There's a lot of roles where you don't even have to think about which algorithm is implemented behind your favorite sort method. If you work in a role like that for 10 years, bubble sort becomes "which one was that again"?

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.


Assuming knowledge and understanding of an algorithm but no prior practice with implementing it, one’s way of implementing it does tell about their proficiency in programming.

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.


> All you have to do is "compare and swap" and loop through until you are done, this is way easier than Fizzbuzz.

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!


> Fizzbuzz is actually completely trivial to the point where the problem statement is almost literally (modulo modulo) a description of the algorithm.

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.


for i = 0 to n { for j = i to n { if n[j] > n[i] { swap(n[i], n[j] }}}


Except that sorts the list in reverse: https://tio.run/##Vc6xDsIwDATQPV9xYyJ5od2Qyo9UGYhIwFXkVlY68P...

(Also a subtle off-by-one error, it should be 0 to |n|-1 and i to |n|-1.)


Thanks for catching the reverse. I was aware of the off by one but thought the “to” operator I invented would be exclusive of the second operand (kinda like range in Python) :)


1 point for having a good reply. 100 points for doing it in code. Well done!


>This is only hard if you have a hard time grasping loops, conditional comparisons or swaps

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."


> Or because you don't know the algorithm in question

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.


I agree with this.

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.


The problem is that people need to know the algorithm you're asking them to implement, which biases it towards memorization.

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.


No need to be so literal. Substitute "bubble sort" for "any simple algorithm involving nested loops/branches/collections" and the result is likely to be the same. Mistakes are common. Partially, that is why unit tests may be useful.


it's not even the most efficient search. I don't think any sort method in a language would use a bubble.


I agree it isn’t but the point I was trying to make is that when you have to do something from scratch, on your own, even if it’s simple, it can be a challenge. My example was poor because I am typing fast sitting in a car parking lot and I hate typing my thoughts on phones.. Forgive me..


I was agreeing with you haha

Companies ask that kind of stuff at interviews lol


Theory: "imposter syndrome" is simply seeing the truth. No one lives up to the social conception. Einstein needed help with mathematics. The realistic perspective is the curiosity of a scientist; the humility of a mortal. Knowing the premises does not automatically imply you know all the consequences... even though it "should".

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!)


> I think quicksort is easy to implement, if you know Hoare's fp insight

Could you please provide more information on this?


He learnt about recursion in a fp workshop(?), and as a first exercise, tried applying it to sort.

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 seems like an uninteresting test. Nobody (almost) is implementing sorting algorithms in their day job. We use libraries. It's like asking people who claim to not struggle with driving basics to change their spark plugs and saying "aha, I new you were an idiot".


It seems pretty indicative to me. Bubble sort is a simple idea that I understand conceptually but haven’t written the code for yet. That summarises most of my job. And yet, 30 years in, I still make stupid mistakes all the time.

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.


Yes but it is basic in the sense that it’s one of the first couple algorithms/data structs mostly everyone has been exposed to. Many knowing what they are and the general principle of how and why they work. That is exactly my point though.. Like what do we consider “basic” exactly? That line becomes blurry in any complex field…


If you don't use something, you forget it. Nobody is writing these algorithms in their job. If you did, it will get flagged in code review, the same way rolling your own crypto does. Which is why I think it's unreasonable to expect people to remember how to implement them off the top of their head.


> I work with arguably some of “smartest” people on the planet, and even they struggle with basic concepts from time to time, as does everyone. There is simply too much information for any single human to know it all, and learn new things instantly.

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 have been giving advice to a person, young also (16 years old) and he thinks he can go very far very quickly.

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.


Something I have realized with my struggles in learning how to program is that it's as much a philosophy of how we get a computer to solve a problem as it is an experience learning the structure and syntax of a new language. Coming at it from a complete newbie perspective I don't even know what I don't know, so therefore I can't begin to learn what I should. At best, I can memorize how to do basic things but I don't understand the fundamentals of how those things work, or why they were designed that way.

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..."


You probably don't know how valuable motivation is. I learned that lesson only three years ago. It is so easy to simply do nothing both when you are motivated and not motivated. You don't need to know how write lua if you can inspire your son to build things with it. In the last three years, I have probably had more ideas of things that I want to do than in the two decades before that.

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.


> I don't understand the fundamentals of how those things work, or why they were designed that way

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.


I've been thinking about this a bit lately and I think it's actually less about fundamentals and more of an issue with process. I'm not saying that fundamentals are not essential, but we often don't have the time to learn all aspects of a complex system.

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.


Whenever I see someone like this on HN – someone whose motivation is to build a large company and make a lot of money, someone who is an "idea guy," someone for whom programming is merely a means to an end – I'm glad I'm not like this. I'm grateful that programming itself is genuinely fun to me, that I don't mind whether what I'm coding is useful or ends up generating money. I'm glad I program because I enjoy it, not because I convinced myself to do it, hoping it would advance my career.

At the same time, it saddens me that the thing I love so much becomes a source of frustration for many others.


From the article,

>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 enjoy coding, too. But since there are so many fun things to code, I choose among the fun things things that are useful to others as well as myself.


> I'm grateful that programming itself is genuinely fun to me

> 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 :)


> I don't mind whether what I'm coding is useful or ends up generating money

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.


I've been programming for closing in on 40 years. I got lucky when I was 32 with a position that let me get out of the industry, stay home and raise my daughter while slowly building a libre software project that has been ongoing for almost 24 years, and making a living from that for the last 14 years.

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.


Dunno dude, I’ve been in the industry for almost 3 decades, programming for almost 40 years, and I still enjoy it a lot.


58, been programming since 13. Still enjoy it. Still both a hobby and a job


I think programmers are like writers.

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 got burnout from weeks of doing nothing during the pandemic. Think about it. What exactly do you put in your timesheet when you haven't written a single line of code or email or responded to a ticket?


I haven't burned out yet, and have been writing code for nearly 50 years.


> That's when I decided that I didn't need to go to college. I could just teach myself, for free, through all these online resources.

> 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.


As I was reading through it, it sounded like he didn't have an actual idea of what to build. I'd expect an 'idea guy' would learn just enough to get going and start building whatever the idea was, and use the project as a means to guide him to whatever he needed to learn next. I find this to be the most effective way to learn, as all the learning gets applied right away, outside of the context of a very controlled problem given by the teacher.

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.


I still struggle after 15 years into programming, and I never published or finished anything because of "judgement anxiety". I waste days, weeks, months writing and rewriting code and then I decide to abandon it because "other developers are going to see how shitty of a developer I am and it'll jeopardize my reputation forever".


You may not realize just how terrible much of production code actually is! ;-)

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.


> other developers are going to see how shitty of a developer I am and it'll jeopardize my reputation forever

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.


Humility is my most used tool. Pick up lots of new things, embrace being a beginner.


> "other developers are going to see how shitty of a developer I am and it'll jeopardize my reputation forever"

Those who put down others or leave nonconstructive feedback, even HN commenters, are not worth your time worrying over.


Even after a decade, many coders make limited progress for their potential, and some make very little. Progress depends on balancing consumption of knowledge and application. If one consumes a lot (watches many YouTube videos) but does not create anything with this knowledge, it is evident that they will not progress quickly. If one constantly applies the same knowledge and never seeks to learn new things, they will likewise stagnate.


I'll agree with this as a self taught person.

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.


I taught myself to code in high school and then did the 5 year CS degree at university. School taught me a lot of interesting stuff that I probably would've never picked up on my own, and gave me a much more grounded perspective on the entire field. But very little that was directly relevant for enteprise programming (which I've been doing professionally for over a decade by now).


I have been writing JavaScript since JS has existed, and the One Weird Trick I learned to working with JS’s OO system is to use it as little as possible. Don’t get me wrong, objects are wonderful, but you don’t need JS’s barking insane semantics around “this” when static closures work fantastically. It’s not even the prototype model that I’m talking about, it’s having to do things like foo.bar.bind(foo) or having to know that an event handler will re-bind “this” and so on. The Vue and React communities have caught on to this, and writing code for those is so much more pleasant now that there are fewer land mines like that to step on.


Yep. Resonates a lot. I've tinkered with code on the side and realised its very hard to do it "part-time".

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 don’t know, I only bother to finish projects for work. With personal projects, it always ends up following the 20/80 rule — 20% of the code produces 80% of the value. The remaining 80% of code is largely uninteresting busywork and just isn’t worth the effort for a pet project.

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)


Yeah, I don't think this guy's problem is that coding is hard, I think he finds learning hard. At this point I think a better understanding of pedagogy would help advance his coding more than anything.


He makes it pretty clear that his frustration was due to the overall brittle nature of code (change the wrong thing and the whole system breaks), not simply the learning process.

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.


I definitely relate with the author a lot. I have ADHD and getting in the flow of programming feels like a monumental task that makes me feel extremely dumb.

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.


It's interesting you say that math is blindly following steps. I have the opposite experience, that math is an exploration of concepts and how they relate to each other - much like programming!

Blindly following steps, whether in math, programming or anything else, does indeed sound unrewarding.


That's exactly my thought. "Blindly" following steps in Math or programming is rewarding only when used to solve bigger problems, to sort of free up working memory.


I've been coding since I was 15, am now an industry professional with 7 years software development experience. I just spent close to 15 hours debugging a really simple HTML/CSS issue. Why? Because I've never touched HTML/CSS before beyond some CS 101 labs. I'm sure an experienced web dev could have fixed it in 10 minutes.

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.


> In my experience programming is less having it all in your head and more where and how to look things up.

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.


> I was expecting it to be very easy, smooth sailing for me. On the high level, it's all very simnple stuff. It's just refactoring the codebase a bit, reorganizing it, making it cleaner and more structured, and it's supposed to be easy.

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.


Coding is hard exactly the way painting is hard or sculpting is hard or playing guitar is hard or writing is hard. It is but it's not. You need to put real effort in to learn, some less if you're naturally inclined to it, and many reach a point where they crest ahill and it really isn't that hard at all anymore.

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.


I have the impression that some people can be software developers for 10 years or longer but they still don't "get it" while some junior devs are really great right from the start.

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.


Absolutely. Some people just find learning itself hard too. It's a whole other skill that's orthogonal and similarly trainable. To keep making progress at making more things feel easy, you need to remain curious and ambitious. Many don't internalize that and just plateau when pressure lets up enough.


I object to bringing intelligence into the equation. It never explains anything that other factors couldn't. And it trains people to think they have innate limitations, which is a poor mindset for learning.


A common definition of intelligence is the capacity for problem solving.

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.


None of that implies an innate inborn limitation. Although I know the concept flatters a lot of people here.


You don't think a lack of intelligence limits people in stem?


Get a 1-on-1 mentor/tutor.

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.


Absolutely. There are very few 100% self-taught experts in ANY field. Teachers and mentors are critical in helping you focus your efforts and prevent you from spinning your wheels.


I'm mostly just riffing off the title but, as a programmer of 45 years I do often find programming hard or programming related things hard

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


> It's just refactoring the codebase a bit, reorganizing it, making it cleaner and more structured, and it's supposed to be easy.

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.


What personally helped me a lot was going through CMU's Introduction to Computer Systems class [1]. It gave me a series of frameworks on how to reason about bugs in the code and well as bugs in various package installations, etc...

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...


Have been feeling very frustrated this past week working on something. Started wondering if I am dumb or is this actually hard. Decided to write a simple quick blog post on it -


Thanks for writing something like this.

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.


It's hard.

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.)


Thanks for writing this.

I have added and removed about 4 million lines of code:

https://github.com/wekan/wekan/graphs/contributors

to WeKan Open Source kanban:

https://wekan.github.io

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.


I am certain you are not dumb, but personally I find that there are many things that I learn much faster when taught by other people.


Yo OP cool you commented here! At the very least I think your website is pretty good - and I like the prism logo. Being able to write up a post and have it get international eyes (via HN) is more than many people ever try to accomplish.

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.


Frustration is something I can feel as well when I am stuck. It is not a productive emotional state. It means to feel stuck, and maybe I was even stuck before I began.

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 have a lot of respect for self learners. Don't think I would have learned to code if I didn't feel the financial and academic pressure from learning it in University. I still remember my intro course being so mind numbingly difficult coming from an arts background. Simple if else code block assignment that I could complete in 1 minute now took me a whole weekend to initially do 10 years ago.


When it comes to programming we are all self learners because no one teaches you how to write the software you might want to write… Getting taught merely means getting exposed to. The real teaching of something happens when you do it on your own… Taught my self to code in 6th grade and was able to drop out of college to work.. Started and sold my own company. I have to say the CS/CE curriculum is severely lacking and in all honesty not many benefit from it. Someone coming out of school with a bachelors doesn’t seem to be able to translate their “learned” skills into real working knowledge. That can only happen when you actually do what you want to do. Grab a bunch of CS and grads and ask them to write a simple FizzBuzz and you will be astonished at how many barely know where to start. It’s quite sad. Ironically I am now a researcher at MIT… I am in academia and didn’t even finish my degree…


>It's just refactoring the codebase a bit, reorganizing it, making it cleaner and more structured

Famous last words.


Once I took over a project that needed some SQL updates. Oh, and there was one issue in the issue tracker that needed looking at. How naive I was.

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.


Now try learning to code in C with a single book and no Internet, like I did.

Kids these days

:P


I was blessed with a bunch of CHM files. I knew by heart how to browse that style of documentation. I still to this day prefer reference style to tutorial or by example.


Luxury! I didn't have the benefit of a computer when I learned to program.


one man's luxury...

how did you learn to program computers without computers around?


I kept on re-reading the RSTS/E BASIC PLUS language manual until it made sense. I remember DIM statements being the hardest thing to figure out.


I didn't either as a kid. I had one of those British Usborne Publishing computer books - one of their intros involved paper only with a long roll of instructions you wrote out and pulled through a cardboard "window" for the current instruction while you kept track of variables on a sheet of paper.

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.


Yeah the "Trash80" was the first computer I actually used, the display model at the local Tandy Electronics store.

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.


If you're doing CS50 and struggling with the exercises, I think this points to a problem with your study habits. I had the same problem for the first few years of my programming career (and honestly still fall into the same trap from time to time). I'd work my way through entire Codecademy "courses", receive a congratulatory message at the end, and then realize I hadn't actually learnt anything at all. I'd just been following instructions.

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.


Introductory CS courses (and engineering courses in general) can take a lot of time, especially if you are learning the material for the first time (which many people in the class probably are not!)

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.


Coding was hard when I was coding for the sake of coding.

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.


Posts like this are what is really wrong with this world :-)

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.


I find the story relating, though in a somewhat less dramatic sense.

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.


i feel very sad that this is a thing. in programming you should always have a feeling of absolute agency. there is no pile of crap deep enough you cant peek under. no bug you shouldn't be able to find, given enough time.

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.


> there is no pile of crap deep enough you cant peek under. no bug you shouldn't be able to find,

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.


That's the trick. You should not chase every issue down. You should prioritize, but give one issue you should be able to chase it down and get to the bottom of it. So it's not about actually taking om the task of solving every issue, it's about the capability of solving any issue you deem worth solving.


Yea that's fair

But I wouldn't describe it as a feeling of absolute agency. More like pressure-induced minor chaos


To OP: if pride is the only thing stopping you from dropping programming then that's a personal character development milestone for you. It does not come easy for many of us to admit that we cannot win all the battles. Been there, can relate, at the same time I'd advise you (over a beer) to shift your perspective towards the limited time you have on this Earth and to pick your battles and fight only those where you feel strong and on your own turf. Super long discussion though, one reserved for your closest circle of relatives and friends.

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.


The last compiler I wrote needed to be translated to another implementation language. The translator found one bug in it. It was effectively bug free. I am a good coder. I recognize most of these feelings though. Struggling through them is part of my process. I also have lots of ways of working that help me -- I take copious notes for example. Sketch a lot. Talk to others. Staying isolated is a way of staying stuck. Good luck.


In a 6 year period, the blog post author has only worked as a software engineer as part of a team for _one year_. That likely explains why he still finds it hard.


And never really seemed to learn how to code. I spent a bit of time in this phase of bouncing between tutorials and different learning approaches. Eventually, I found the one that worked for me. Coding is now the easy part. Designing this is the hard part.


got reminded of this video while reading through your blog: https://youtu.be/bkogwxzjwfI?si=9LmyTtB4zWXNLZQK.


Great video. The video suggests that people should be prepared to expect anything worthwhile to be seriously difficult, even painful.

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.


I feel like I could've wrote this myself. I've been dabbling with programming for about 20 years. Much of that time though I was managing other programmers and doing very little programming myself. I was also working on unchallenging (but profitable) projects for far too long. Only in the last few years have I felt like I've had breakthroughs and actually begun to feel confident. I attribute this to the fact that I've decided to do the work myself and take on more challenging work. However, most importantly, I've removed distractions from my life. The initial and intermediate learning curves of programming are certainly hard and I don't think it's possible to have any breakthroughs if you are not in a good place in your life. For me, it was the people I had chosen to surround myself with whom I realized were not supportive of me or my goals. Once I fixed that, I had more time and energy to focus on becoming good at programming. I still don't think I am "good" at it but I am certainly improving now. Don't give up, OP. I certainly never will.


>I forget how something was setup in some section of some file, and write code in another file and it just breaks the entire logic. I feel frustrated that I cannot upload and maintain the entire logical map of even this very small and simple codebase in my mind.

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).


I have a trick for understanding code. What I do is I look at the function, and when there is an if statement or loop, I extract this (and possible some of the surrounding code, depending on what the code does) into a named function.

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…


Sounds like the author didn't ever really progress beyond the learning stage. When I was starting out, I also tried things like Codecademy and CS50, but wasn't really learning anything from those. University courses provided enough structure and incentive for me to get through all the topics. At first, I agree, it is challenging. My first language was C++ and then we switched to C. It's tough to understand what you're doing wrong at first.

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.


I think the author is being a little too harsh on himself. It’s totally okay to struggle or feel like you can’t solve something right away. There’s no need to be so hard on yourself. The most important thing is that you have fun with what you do :) You don’t need to be the best for everyone, just be the best for yourself and enjoy it!


Coding, at least quality coding, is for slow people that are patient enough to study in depth and to get it right eventually. And getting it right can still be incredibly hard.

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.


This is a very insightful comment actually. I think you are right in many ways. My brain is wired to constantly try going fast. Everything I am able to do, is mostly from short bursts of dopamine rush. If that rush slows down or stops, such as when dealing with frustration of not being able to make something work immediately, my brain starts to shut down - and then it's like trying to swim across dry land. Curiosity and desire for problem solving helps sometimes, when I am in the right headspace, but other times it's simply absent. The work starts feeling dreadful. Need to figure out some ways around this.


Have you tried out working on multiple projects or tasks at the same time?

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 have been thinking to do exactly this lately. Just keep switching between projects when I hit the walls, keep the momentum going somehow


As a fellow aspiring developer, let me share a perspective that may be helpful.

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.


It's hard to make any kind of objective assessment based on a single article this sparse on concrete details as this, but I get strong vibes of a day-dreamer personality. This oscillation between excitement about an idea, and the hard reality and challenge of actually making progress. I have these tendencies at times myself, and my first piece of advice is to bring some structure and accountability to other people into your approach. In my case two things were game changers: studying CS with an actual teacher and classmates, as well as going and getting a professional job.

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.


I believe that stuck feeling, the helpless head banging feeling, is your brain forming new connections and breaking old ones. In other words, learning. That’s where the experience points are. Accept the feeling of being dumb and the reality of being smart, mixed together, and you’re advancing for real.


The way I think about it is that the struggle is essential if you want to push yourself to learn new things. Learning is a messy process and it's rarely a linjar affair.


I agree that coding is hard. This is coming from someone who's been coding for 15 years straight as my day job plus nights and weekends on open source. I've literally been working during 2/3 of my entire spare time excluding sleep (which is 6 to 7 hours per day).


I think coding can be easy and pleasurable.

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.


https://imgur.com/gallery/dzbQCj4

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.


Software is a mixture of engineering, art and mathematics.

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".


Coding is hard because most APIs suck. Most APIs

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.


This kind of sounds like my history. Wanted to learn, but had false starts for a decade. Then I found a project I actually wanted to complete, and that got me through the frustration.


The method that worked for me was working on actual projects. Build something useful for yourself. And just search the web and ask chatbots and keep hammering on it until it's done, one problem at a time. Maybe forgetting the bigger picture and focusing on small bite sized problems would work for you too.

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.


Becoming a good coder is like mastering anything, it takes deliberate practice, discipline and time.

“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.


> I wanted to prove to myself that I was smart, that all the adults in my life who told me I was "dumb and stupid" because I couldn't excell at school were wrong. I was not dumb, I was not an idiot, I could do it.

> And that was when reality slapped me really hard for the first time on my face.

These two consecutive paragraphs seem contradictory.


Learn the fundamentals and keep them surfaced, either through explicit spaced repetition or something that approximates it, such as writing, reading or trying to (re)implement them. Then build up on that. Just don't do more than what you can handle at a time. The goal is to reference at least 80% of the necessary from memory.


People are being too harsh. Deliberate practice and coming out of comfort zone is the key.

https://www.joshwcomeau.com/blog/how-to-learn-stuff-quickly/


One problem I see here is the desire to learn to code in some abstract sense, to prove something, even to understand CS, rather then starting from a simple project and asking yourself what you absolutely need to learn to do it.


Feeling dumb is a good emotion.

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.


Coding has always been easy and fun for me. I taught myself assembler programming when I was 11 on a ZX-Spectrum and have been coding ever since. Professionally (30+ years) and for fun. I know coding is super hard for most people but for some reason it just fits my brain. Perhaps you need the right brain structure to find coding easy? Not sure …


If coding is hard, then why is it constantly Devtember?

Could we make coding a little harder, please?


There’s a book I can’t recommend highly enough from the 80s(?) written by a tennis coach about teaching tennis. It’s called The Inner Game of Tennis. In it Tim Gallaway, the author says there’s really two games of tennis: the outer game, involving an opponent, a ball, a racquet, scoring, all the rest. And an inner game where the player brings themself to the court and give it their all. The inner game deals with setbacks and losses. He gives a really simple “formula”:

    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.


Yes coding is very hard. Glad to read this honest take on it!


Context for HN :

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’ve been through this and out the other side. I suspect your real problem is just loneliness. Coding used to be harder for me when I was alone.

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


coding is not hard. coming up with something worth coding is.


One of my students in a summer school class about programming just couldn't get their head around what a variable was. These concepts are very hard to teach when you are very familiar with them and they come natural to you.


A variable is a box where you can store a certain type of an object. For example, you can have a box with the right size and shape to store toy cars. At one point the variable (box) may contain a red toy car, and at another point it may contain a blue toy car.

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 concept of a variable is just the tip of the iceberg: the syntax for dealing with variables (e.g. assignment vs. testing equality) is difficult for newbies to grasp.

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 analogy is heavily stretched with dynamically typed languages, you could say that it's a box that can hold anything, but then the value of the analogy falls apart.


As you point out, all it takes to describe dynamically typed languages is describing a variable as a box that can contain an object. It can contain a fish now and a truck later. What is the problem? Assignments, l-values and such work just fine as far as I can tell.

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.


Did they not learn about variables in math class?

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.


teach them about memory first


I don’t mean to be insulting, but have you considered the possibility that you are too stupid to learn programming? For example, I could never be a doctor because I myself am too stupid at chemistry. Sometimes it’s better to take the path of least resistance. :)


If you're still bad at coding after 10 years, give up.

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.


He probably isn’t that bad. He just has imposter syndrome most likely… He is assuming people sit down and write things like web browsers in a single, linear sitting. You don’t write any nontrivial software easily if you’re doing something new. The decisions you need to make when developing real software or systems are numerous. Having been in the industry for a very long time and having worked with arguably some of the smartest people in the world, no one lives up the the romanticized “super cider genius” that solves all problems effortlessly in their first go. I am currently a researcher at MIT. I work with some of the most brilliant people out there and you’d be surprised what “simple” things or concepts they struggle with… Everything is simple when you know the answer, but try devising the answer to a truly original problem that hasn’t been breached yet and see how far you get. Even simple sorting algorithms, and basic data structures, were the product of research that took a long time. People didn’t just sit down one night and invent the quick sort in one go….


> He is assuming people sit down and write things like web browsers in a single, linear sitting

I can't imagine how someone with 10 years of programming experience would make this assumption.


> 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

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.


That's making three assumptions: 1) That everyone has something they're really talented at, 2) that they'd want to do that thing if they found out what is is, and 3) that the time, money and effort to do so would pay off compared to having remained an average developer.

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.


Agreed. It took me years to accept that it's ok for coding to be my hobby and not my career.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: