Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Should I quit trying to be a programmer?
46 points by Tmp1234 on July 8, 2018 | hide | past | favorite | 68 comments
I recently graduated with a computer science degree in a top 50 school and have been grinding leetcode in preparation of applying to a job. I have no work experience and had a lot of help to get through the degree. About half of the coding assignments required for my degree I either didn’t do or was carried. I also got generous accommodations due to a disability. My in major GPA is 3.0.

I take an extremely long time to come up with solutions to any problems. I enjoy trying to solve problems and coming up with a high level solution, but I get stuck for hours on details or miss vital parts of the algorithm so often it becomes a drag. Personal projects take me an extreme amount of time too and I haven’t made any of note. I’m not good at organizing code and I am not detail orientated which means I tend to get a lot of one off type errors and can take hours to find them. Even problems I’ve seen before, I’ll likely forget the solution or fail to recreate it.

To give a concrete example of some of the above, just this morning I tried to code the brute force solution following problem: Give two sorted arrays return the median. I spent over an hour trying to implement the brute force solution involving linearly going through each array and couldn’t code it in Python. The entire time I was struggling to figure out how to increase the respective index variables given different cases, how I would ensure one of the numbers the indices landed was the median, how to differentiate which of the array indices I was keeping track of was the actual median and finally how to determine the next number I needed if the lengths of both arrays were even.

Many problems go the same way. I don’t know what the difference between the normal struggle associated with coding is and the sort of struggle that means it’s just not for me. I'm not looking for encouragement per se, but objective feedback on which group I belong to and practical advice on how to move forward.




I've a few years of experience tutoring programming. From what often see and from reading your description, it sounds like your problem is "need better planning before jumping to writing a code".

Programming is akin to building a house. Once the blueprint is figured out, the actual act of building (putting bricks together, etc) is actually pretty straightforward. The key though, is good the planning.

By good planning, in your example of returning the median, you should solve the problem before touching your computer. Use either pencil-and-paper or whiteboard method as much as possible. For example, I'd plan it as follow: 1. Solve it in a high-level manner, as if you're trying to teach someone who never codes a program before 2. Write down all the function definitions you need (don't code the body, just know what each does) 3. Write down how all the functions are to interact (again, don't write the body of any of the functions yet, just assume you have them) 4. Write down pseudocode for each of the functions 5. Code

I've seen lots of beginner programmers tried to skip over to 5 without concrete plan only ended up confusing himself over trivial problem. No matter how tempting it is, jumping straight to 5 without concrete plan is only going to confuse you.

I forgot whether it was Leslie Lamport or Edsger Dijkstra, but one of them said that a good programmer should have the skill to fully plan out a computer program without coding it.


I actually do go through the 5 steps you mentioned, but the problem is I don't see parts of the algorithm I'm missing until test cases fail or until I'm actually translating to code.

The need to make what I'm thinking precise and understandable to the computer or the oversight of edge cases or, sometimes, an entire set of cases I didn't have in mind originally when coming up with the high level solution, evades me until I hit a wall. I don't know how to know what I don't know- I don't know how to see what I'm overlooking when it sounds like a solid and complete algorithm on a high level.

Then there are times when I simply don't know where to start and nothing comes to me. I think your outline is good, but I'm not sure what to do with it if the ideas and logic simply don't come to my head.


>>The need to make what I'm thinking precise and understandable to the computer or the oversight of edge cases or, sometimes, an entire set of cases I didn't have in mind originally when coming up with the high level solution

To me this sounds like you should spend more time in the planning phase. Sounds like your plan needs to be more detailed and concrete. If you hadn't yet come up with a high-level solution, jumping straight to code wouldn't help either, it'll only make it more confusing.

>>but I'm not sure what to do with it if the ideas and logic simply don't come to my head.

What sort of ideas and logic are you specifically having problem with? If they're about algorithms, try reading more algorithm books (Thomas Cormen's Introduction to Algorithm is really good), do more practice programming (I used to practice a lot here https://practiceit.cs.washington.edu/). In general I'd suggest try to see more problems where the solutions are available, but don't immediately see the solutions. Try to do it yourself first.


The thing is I have no idea I need more planning. When I start to code the solution I've come up with seems genuinely complete and correct. It's only when the incorrectness hits me right in the face, usually in the form of test cases failing or not being able to code something I thought I could, that I realize I didn't have it.

To be concrete, yesterday I tried to solve this question: https://leetcode.com/problems/wildcard-matching/ I spent 45 minutes on the planning phase which would be the entire time I'd have for the problem in an interview. I had some pseudocode, thought through it, tried an example or two and then decided to code it up. As I did I realized a few more examples which I added in. Finally, I had some code that seemed even more correct than the code I thought was already correct. I run it and test cases fail. I spent 2.5 hours in total trying to get them all to pass without realizing the central issue of the question is what to do when you hit a * character. The necessity to try all the combinations of the string after a * doesn't not occur to me in 2.5 hours; I kept tweaking for specific cases I was failing. I ask a friend about the problem and in less than two minutes he realizes you need to try all combinations.

>>What sort of ideas and logic are you specifically having problem with?

It seems everything. Sure, some problems turn out to have an algorithm that I didn't know about it. Like the other day I was trying to do a problem that basically needed topological sort and I never really learned top sort. But then I read in the solution in CTCI that it's reasonable to derive that on one's own in a 45 minute interview so there goes that. More generally, it just seems when a problem reaches a certain level of difficulty my brain simply can't solve it. I suspect it's an intelligence thing. I just don't have a high enough IQ to get passed a certain point.

I will look at the resources you mentioned.


>>I spent 2.5 hours in total trying to get them all to pass without realizing the central issue of the question is what to do when you hit a * character. The necessity to try all the combinations of the string after a * doesn't not occur to me in 2.5 hours;

The fact you kept trying for 2.5 hours shows you are persistent -- an awesome ingredient to be a great programmer. In my opinion, you shouldn't blame yourself for not being able to solve that particular wildcard-matching problem. I think it's a typical "interview problem". I personally don't think "interview problem" is a good measure of a programmer because: 1. some people are more gifted in the thinking required to solve such problem. 2. if you practice a lot, basically you get better at it. It's like there's a certain pattern to such problems that you can learn. (think of it as similar to SAT)

>>Sure, some problems turn out to have an algorithm that I didn't know about it.

I'm not suggesting you need to know a lot of algos to be a great programmer. You just need to be familiar with the important ones such as linked list, hash map, binary tree, etc. Cos even at places like Google, they wouldn't really ask interview questions where you need to know anything unconventional. What I'm suggesting is that you learn to solve problem by reading solutions to existing algo problems, make sure you understand it, and try to re-implement it.

>>I just don't have a high enough IQ to get passed a certain point.

From your comments, it seems you think you have to be good at "interview problems" or what I like to call "algorithmic-thinking" to be a good programmer. I totally understand that perspective as most US tech companies' screening process involve such problems. I'm telling you from experience though, that computer science is much more than just "algorithmic thinking". There is the field of system where the main challenge is to envision how all the large number of components collaborate and work together (i.e. OS, distributed system). There is also the field of frontend web programming. Frontend involves the skill of implementing something that is visually aesthetic or implementing a web according to the design document. There's also product management role, where you have to understand the how the thing works but you don't have to go too technical. And many more.

In short, there are so much more in the CS than just "algorithmic thinking". Don't be discouraged. Try to figure out where your interest and talent intersect, work hard on it, and don't easily give up :)


It seems we both agree, indirectly, that these interview tests are like IQ tests. You are comparing them to the SATs and the SATs are just wrapped up IQ tests like the tech interview. Studies have shown scores on the SAT don't increase by more than 100 points or so even with 100s of hours of practice. In the end, the algorithmic thinking you mention just seems like another way of saying intelligence which would be a factor in any subfield I enter.

And the truth is I've been doing interview prep on and off for at least a year and I'm still at this stage. My goal is to be good enough to get into a Big 4. If I can't do that, I don't want to continue. Given that, do you think I should quit?


Honestly, I feel like your motivation is wrong. Most of the most amazing programmers are those that are genuinely interested in particular topics, worked hard in the area, and finally became very good at it. Your mindset really shouldn't be going to big 4 because they're cool or sound prestigious. I don't believe such mindset will last long there anyway...

Aside from personal opinion above, the chance of getting to Google is less than the chance of getting accepted to Harvard. And as you probably know, there are people who are qualified who got turned down by Harvard because they don't have enpugh spots anyway. So if your goal is merely to get there, statistically speaking there are much more plausible things to aim for, so you shouldn't waste your time..


Here are my two cents. The reason why you're talking such a long time to get simple things done is because you haven't had enough experience. You said you were carried through projects and assignments, so this is all coming back to bite you. By letting yourself get carried, you missed out on the opportunity to make stupid mistakes, think through design choices, and learn what's good and bad.

Alas, not all is lost. Screw what you did wrong yesterday and in the past, and start fresh today.

For personal projects, keep the scope minimal. Better to finish something than not finish anything at all. And if you're struggling with something as basic as type errors, then your approach to programming is wrong. You have to drill this to your head: code a little, test a little.

Of course, all of this on the assumption that you have speckles of ember left to turn it into a fire - to have the drive to learn and improve.

Best of luck.


How would you distinguish between someone who doesn't have enough experience and someone who is smart enough?


Don't give up ... Westerners are bit obsessed with the idea of "revealed" talents and leading indicators of capabilities. Pursue the things that draw you regardless of how good you are at them initially... don't waste your time lamenting test results. I would love to rant about the non-causality of IQ, grades, etc but it seems tangential.

Coding is not an activity reserved for the "gifted". Your daily thought processes are far more complicated than coding, and it's highly likely you have all the capacity you'll ever need to be good at it. Before you know it, you'll know 5-10 different languages and pick new ones up in days. You'll be able to solve problems in a dozen different ways, and translate problems from one structure to another; much the same way that you can already do with human language.

Ask yourself if you give-a-f*ck enough to stick with it. That's the main factor in most pursuits, the other considerations are for suckers and mostly benefit someone else.


The problem is that the interviews for the jobs are basically IQ tests wrapped in a layer of prerequisite computer science knowledge. The job itself, I'm willing to bet, also requires raw intelligence even if its one of those cases where getting in is harder than staying in. If I don't have the raw intelligence, the necessary conclusion is that my time would be better spent else where. Wouldn't you agree?


I was a bit like you... struggled at university, failed plenty of topics (some twice) because it never "clicked". I fluked a job at a small company and turns out I'm pretty decent with people & understanding what people want/need. I got by with my code, but it was elementary if I'm honest with myself.

For the past 14 years I've run my own web dev company but I understood my limitations and hired people who are actually good at coding and I've stuck to what I'm good at.

From what you write, there doesn't appear to be a passion for coding - avoiding assignments & now struggling with core constructs point to that. But something at some point got you into this field - perhaps there's something to the side that might suit your skills/passion more? Testing, QA, project management, client management, business analysis... there's lots of roles that benefit of understanding programming concepts that don't rely on you actually being a gun programmer.


I have a passion for coding, but I don't think I'm very good at it. It's not fun to do anything if every single step results in getting massively stuck especially when those steps are considered prerequisites to being competent. At that point, it just seems like a person is barking up the wrong tree.

I got into programming for the money and because I like problem solving and concrete results. I honestly think it would be perfect match if I had +10 IQ points. As for your suggestion, I wouldn't know where to begin looking for things "on the side" as you put it.


I've been in your shoes before, and I think the others have said it better, but basically:

- You need better practice, not more practice

- There's a difference between <being able to be hired by google> and <being able to be hired by a small company that needs a programmer>.

- Go through the MOOC "learning how to learn", sleep 8 hours, eat some ice cream, get hired by a small company, become a programmer.

Thank me in a couple of weeks for that.


What is MOOC?


Objectively, I would say that the problem you struggled with this morning should be doable by someone in comp sci 102 (and probably comp sci 101). That you're struggling with something like this, suggests that you're very out of practice and really haven't done any significant work recently (or at least not in Python). That doesn't mean you're unhirable, but it does mean that you're going to need to spend a lot of time prepping and working, probably significantly more time than your colleagues.

With that said, think about why you chose to major in computer science and what classes you enjoyed the most. Maybe there's a specialty you really want to do, maybe you would prefer to do something tangential to programming like project management, information security or data analysis. You may find more it more interesting and easier to work on practical projects. It's probably worth trying some web development work (especially in languages such as ruby or python with foreach semantics where you won't need to worry about off by one errors as much)


I've been practicing interview questions everyday for the past few months on and off in Python. I've been trying to prepare for technical interviews. I run into problems with almost any problem I attempt and I was even worse when I started. Even something as simple as recursive solution of fib sequence was undoable until recursion clicked more.

I chose cs because I like problem solving, having a concrete end result and because it's a way to make good money without an extreme amount of years in school.


I would say to forget about problems involving algorithms and try to build projects with a very concrete use case. Maybe you should just quit trying to be a programmer that can pass a whiteboard interview at Google, and start trying to be a programmer that can provide usable software that solves a problem for a regular company.


Totally agree here. You'll have no issues in your career if you can write software that increases revenue for a company. Sure, being able to visualize and implement data structures and algorithms is extremely useful, but I wouldn't say it's absolutely required to enter the industry. Hell, when I first started professionally, I couldn't tell you the difference between a binary tree and b-tree. If you're passionate about software development, it'll come naturally.


If I was only interested in programming to become a google worthy programmer, would you say I have enough evidence that I should quit?


Yes


Could you expand a little? It's a big life decision I would be making.


If you created a category in your mind that is "Google-worthy"* developer, that prioritizes above all specifically the niche of Software Development that your struggling with, I believe it is a sign that you should not keep trying to pursue this specific goal.

But I do believe you should try to be a software developer at all before you decide what exactly what kind of software developer you should be for all your career. You have never worked with software developer and you are willing to consider only one aspect of it "worthy"?

*A comment, google-type whiteboard interviews does not mean that they do select better software developers. It is a bias, not necessarily a bias to the best ones.


It sounds like you're not very satisfied with how your coding practice is going. If you have the resources, I would definitely recommend trying to find a tutor to do 1-on-1 sessions with. I've seen a lot of the behaviors you mention in people I've tutored.

This is especially relevant if you think your disability is affecting the quality of your practice. You made need to engage in different strategies to get the most out of practice. (or to manage the kinds of problems you're working on).

It's possible that you would have a lot of difficulty with a career in programming, but I wouldn't even consider that until a skilled tutor or two feel that way.


I don't have the resources for a 1 on 1 tutor. Do you have any other ways for me to know objectively if I should quit?


Keep working at it. Believe in yourself and your capabilities (as corny as it sounds). It really is about perseverance. If you find the frustration is wearing you down and making you feel hopeless, don't torture yourself doing work you don't want to do. With that said, if you feel a rush when things do click and that drives you, I think you'll do fine.

There are few prodigies in the field. Most people make it through sheer work ethic and self-belief. Do everything you can to hangout with other passionate people (if they're more skilled than you even better). The best way to do this is just get your foot in the door somewhere. Do whatever it takes. One year in a work environment gaining real world experience is priceless and your skills will skyrocket if you challenge yourself and step outside your comfort area.

Best of luck to you (whether you continue pursuing programming or something else)!

PS: For what it's worth, just understanding the above problem you described is half the battle. The other half is getting comfortable implementing different algorithms. For this, you can seriously just copy paste someone's solution from stack exchange and execute the code to observe the effects of your tweaks. It's kind of like how most people need to practice solving the math problems before being able to grasp the concepts behind the solution.


If you have a disability, you may well face similar frustrations with anything you try.

Some disabilities can be helped with aggressive nutritional support.

You can also learn coping mechanisms to help you work around your weak areas more easily. The exact mechanism will depend very much on the disability in question.

I'm speaking from firsthand experience.

I'm medically handicapped. I have days when I'm fairly together and days when nothing comes easily. I do a lot of self care and I have learned coping mechanisms. I am more productive than I used to be and some tasks are just easier for me than others.

I also raised and homeschooled two sons who have disabilities. They still live with me.


I'm curious about

> Some disabilities can be helped with aggressive nutritional support.

What do you mean? Any examples you could give?


This is from memory, off the top of my head. I am not going to try to come up with citations.

When I did a high school paper on functional hypoglycemia in the 1980s, at that time, the only known effective treatment was high dose vitamin therapy and a modified diet.

Studies suggest that children with issues like ADHD benefit more from certain supplements than from standard drug therapies.

Years ago when my now 31 year old son was 8, I found a vitamin therapy protocol on the internet for Aspie kids. He has never been formally diagnosed, but he reads as very Aspie. It was some B vitamins, magnesium and one other thing, I can't recall what the last item was. After a few months on it, his severe handwriting issues improved and he began comprehending social things better. To this day, when he makes me too crazy about certain things, the solution is to get more B vitamins into him -- though we no longer use supplements and the solution these days is beef. He gets a steak for dinner when he is making me apoplectic.

Magnesium helps with noise sensitivity. I frequently run fevers. Afterwards, I am often noise sensitive. At that point, I eat dark chocolate and cashews for their magnesium content.

Firsthand personal experience suggests that many neurological issues can be ameliorated with sufficient B vitamins, good quality salt and the right fats, including cholesterol, found in foods like eggs and bacon.


A Computer Science degree isn't a magic bullet.

I have a CS degree, and although I managed all my programming assignments just fine, I didn't really feel that I "knew" how to program for a few years after that. OOP took a long time to "click" for me, and every year I can look back at code I've written and see terrible mistakes I've made.

What's funny about that now is that I've built systems that are being used by millions of people, and despite them (in my mind) being a horrible mess of inefficiencies, poor coding practices, and questionable decisions, they're still working.

To me, it sounds like you're beating yourself up over nothing. It's easy to read comments on HN and assume that everyone else is a shit-hot programmer and that you must be useless, but in the real world programming is really fucking hard! Having a good CS education helps, but I've worked with fantastic developers with zero education or bootcamp experience, and CS graduates from Oxbridge that couldn't write real-world code if they lives depended on it.

I'd recommend simply getting a job. Find a company with a set of good senior-level developers, and learn from them. Even with a degree you'll be near the bottom of the ladder, and you'll be learning constantly, but that's why you're there. You'll be surprised at how much you'll pick up once you get stuck in.


1. The frustration you're experiencing is normal. Even if you switched to another field where you had an easier time at first, you'd eventually encounter the same frustration at a certain point.

2. You will get better with practice.

3. Nobody is born knowing how to code. It's fairly absurd to imagine Nature carefully selecting the ability to configure Dockerfiles. There may be genetic markers for neurobiological traits that accelerate learning in certain fields, but this acceleration is only an advantage if you're trying to master as many things as possible within a lifespan, or you're working under some other deadline. If you really want to code (whether out of personal interest, financial interest, or some other motivation), you can do it as long as you practice correctly and put in the time.

4. Practicing correctly is important. I'd recommend the "Learning How to Learn" course. I personally keep this quote taped to my computer:

"The most effective learning requires a well-defined task with an appropriate difficulty level for the particular individual, informative feedback, and opportunities for repetition and corrections of errors."

From here:

https://www.norvig.com/21-days.html


I think you've made a lot of mistakes in the past: allowing yourself to be carried, not doing internships to gain work experience, not actively doing on-campus coding related events like hackathons and contests, not going to on-campus recruiting events, etc. But it's never too late to reset everything and start afresh. You can decide whether or not you still have the motivation and interest to continuing this path; if you do, you can go to coding boot camps, do online courses on MOOCs like coursera, do random personal projects, even read your old textbooks again, etc. You might be out of work for a few months or even a year but think of it as the time spent remedying your mistakes during college days.

Of course the alternative is to not be a programmer; there are still plenty of related disciplines you can choose from.

Ultimately it's up to you to decide if you even love doing programming; recall why you chose this major; do some soul-searching and decide whether you have the motivation and interest to continue. Maybe take a short break go to the mountains or somewhere else, and clear up your mind.


With regards to actually getting a job, try and reframe your thinking around your Unique Selling Points. If you're feeling uncertain about the depth of your knowledge, then view that (and present it to others) as a certainty of your willingness to learn. There are a non-negligible number of employers who would rather take in developers who they can mold to their own coding style over someone who comes in heavily opinionated and looking to change the entire way the company does things.

Some developers I've worked with are incredibly smart, but also know that of themselves and (with that knowledge) prefer to work without the constraints of having to explain themselves to others. However genius doesn't scale well, and this kind of attitude can make them less effective in teams. So learning to be a team player and adopting scalable ways of working can be a strength of your lack of ego, if you choose to see it that way.

Don't just think there's one set of criteria that all employers are looking for. Present your best self and I'm sure you'll find somewhere to work.


You said you brute-forced it, but you mentioned index variables. I thought the brute force solution would look something like:

  merged = sorted(a + b)
  median = merged[len(merged) / 2]
Like twunde said, you just sound rusty. How often do you write code? Do you use Python or something else? It sounds like you're putting too much pressure on yourself.


That's not brute force; that's calling in the cavalry to do brute force for you.


Meh, it's a concise description of a median and it only uses builtin functions. People take "brute" too literally and think it means you should be writing a lot of code: It's about the performance.


Now THAT's brute force :)


A lot of the things you learn at university you aren't going to be using on the job. You aren't going to be finding the median of two sorted arrays (very often). And even then a good google search will lead you to an elegant solution on stack overflow.

Granted it does take a knack to be a good programmer, attention to detail a feel for what's wrong when tracking down a bug.

But every problem will be a struggle the first time but as you get more experience things will get easier and easier and your programming intuition of what to do and what's wrong will become better and better.

There is a wide variety of jobs out there. Maybe test out a few frameworks and see what you like.

I always recommend learning Rails or Laravel because working on web applications is always interesting and both frameworks have great communities and learning resources.

Don't give up if you enjoy it. I think you're making it harder than it is. Your degree just gets you in the door. You're going to learn and do so much that wasn't covered in your classes.

Good luck.


If you couldn't even do half your coding assignments, you're probably fucked. That indices edge case thingy with that problem is an annoying thing that trips me up too, but here you're saying you couldn't do half your coding assignments.

Let's say you want to make a single player Tetris game right now, on a platform of your choice. Could you do that?


It's not that I couldn't, but more so that I didn't. Maybe, I couldn't as well, but of those that I had to do I ended up being ok.

Single player Tetris, maybe not. I don't know graphics libraries. Maybe, if I just continually printed a 2d array on screen then I could figure out the logic, I think.


Don't sit down in front of your computer until you have a very good idea of how your algorithm is going to work and how to code it.

Sit down in front of a piece of paper with a pen. Draw diagrams to visualize the data structures that you're working with. Sketch different corner cases (for example, arrays of odd and even length). Informally (playfully) derive an algorithm to do what you want and convince yourself that it does what you want. Play through different cases on paper, maybe use markers (coins) to keep track of where you are. Write down the details so you don't have to keep them in your head.

I have plenty of experience now, but I still use paper and pencil when I have to solve a problem I haven't solved before. It's just so much easier to explore the problem on paper, to think about corner cases, to visualize the inputs, outputs, and intermediate data structures, and to wrap your head around everything.


I have been doing that, but as I said in response to another comment, I don't see what I'm missing or what's wrong until I start to code it. Either the test cases fail or I run into something that's easy to describe in pseudocode, but more difficult to describe in real code. It seems, at the time of using the paper and pencil, I would be trying to know what I don't know because it always seems fine before I start to code it and then I discover its not.


You’re wasting your time, don’t become a programmer!

My gut feeling is you won’t like that statement because you do want to be a programmer. Stick at it, you will be fine.

You are lacking in confidence. I created a saas product 10 years ago as a sysadmin with a quality of coding that would bring a tear to many programmer’s eyes.

My kids appreciate the code though as it has paid for about half a dozen trips to Disney.

If you want to work in programming you will. Part of the problem with your age group is expectation. Society has told you that you are all awesome which obviously can’t be true. You may be awesome, you may be good, you may be ok. Be confident and do the best you can when you get a job.

Ps. Some of my coding errors have involved editing the wrong file and spending several hours troubleshooting. A colleage also nicknamed me arraybreaker as I often abused 0 index arrays. Your problems are much more advanced :-)


Well, I think alexanderdmitri's advice of looking for answers to coding problems on places like Stackoverflow is great advice and I'd like to expand on it a bit.

It's easy to get sucked into a coding problem and fight with it for days like it's a personal challenge to your abilities. That can turn into a habit. It did for me. Screw that. Admit you have a problem and then get over it.

The goal of working is to produce something, and not necessarily, or even very often, to invent something new or even invent a new way of doing something. Coding is no different.

The truth is for most of us coding is more often akin to assembling something even when you're designing and building something new. That's how I approach it anyway.

When I switched from coding mainly Perl to Javascript I learned (the hard way) to start searching for answers first instead of banging my head on my desk for hours (even days) over what were often times really just syntax issues or things that already had boilerplate solutions publicly available.

Learning to search for answers first made a huge difference in my productivity and in how much I enjoyed coding. Getting stuff done provides a sense of accomplishment and we all need that to inspire us to keep working.

And it's made me a better coder too. I have learned so many new and better ways to do things, as well as how not to do them, and found great explanations on the "whys" and "hows" in the process. And I learn them when they're relevant to what I'm working on too, not in some abstract way that is easy to forget or dismiss.

The truth is there is way more to learn about coding than we can possibly learn already and that gap is constantly expanding. That's really a great thing though because learning on a need to know basis makes it so much easier to get stuff done. It lets us focus on one problem at a time and not worry about what comes after. We can learn what we need when we get there and by then there might be a new and better way.

When I first started making a habit of searching for answers and example code for how to do something I was amazed a few times to find an answer. Now I'm more surprised when I don't find one easily.

To me, that's what a "hacker" is in the truest sense. You find and write and hack together code. There's nothing wrong with that. It's why we have "open source" code and in fact it's truly awesome.


I agree with what you're saying, but I struggle with knowing when to look up answers. If I'm supposed to be able to solve any given problem on my own then looking it up won't get me the problem solving practice I need. I don't know the line of "I need to keep at it for more time" and "I can't solve this better to look it up" especially since I get stuck with almost every problem. It seems best case I learn how to do that one particular problem (for as long as I remember the lesson), but then will most likely get stuck on the very next problem I encounter.


My advice to you: pick a language and write a version of Space Invaders. Or find something else to tinker with. Bottom line, you need to practice your skill to get good at it. Right now you sound like you’re stuck in your head. Do something that renders your problem-solving skills in meatspace.


Ever since I started playing around with game development, I've learned so many important things. It's also extremely rewarding to see and interact with everything you're writing in the form of a game. I'd highly recommend doing this as a hobby.


Do you love it? Do you love programming?

It all comes down to this. To get really good at this (or anything) requires such an investment in time, and for you to push through all the stops when things get really difficult or tiring.

I know many entrepreneurs have said this repeatedly, but it's something I've really only learnt in the last few years. It's better to find some way to make money doing what you love, than learn to love what will make you money.

I pivoted in my business to an area that made more money and I got a lot more clients. And I was also really good at that area. But as the work load grew, and more clients came on, I started struggling with motivation because I really didn't love the work. I started letting clients down because I just couldn't motivate myself to put in even more hours to really excel for the client. I struggled to find people to hire because the skills were so rare, and that's part of the reason why clients were paying so much. Even though the money was great, it didn't solve the problem of the lack of motivation. It was a real struggle to even get started, and then to continue to work, even with the money.

Now I'm lucky in that I do know what I love to do. But I still haven't found a way to make as much money doing that. But what I did do is scale back the paying work that I didn't love to make way for more of the work I did love. I think with experimentation and persistence I may be able to pivot and find an income stream doing what I love. But one thing is for sure. I am much happier and much more motivated. So I am doing more work in general and of a higher quality. I feel like my life has more purpose, and that it's not 'going to waste'.

So If I were you I'd ask myself that. Do I love programming? Do you really love it? If you don't, what do you love to do? You may have been carried a bit through your degree, but you have it now, and it can open a lot of doors. The tech field is enormous. How can you take what you do love, take your degree, and combine it into a job that can earn you some money doing what you love, and providing your life with purpose?


I enjoy programming, but I don't like constantly failing, feeling I'm not good enough and having no spare time cause even a single basic prep question takes me 2-3 hours.


All you lack is lots of practice. Programming is hard but gets easier the more your practice.

And I mean practice on some project that you are personally interested in completing, some genuine goal, not an exercise or theoretical. /academic challenge.


I struggled on the exact same problem on leetcode - It took me over three days of obsessive coding to finally get something that worked (even then it was so hacky that it was non-deterministic, but somehow it passed the tests) In the end my point is that sometimes problems will take a long time to figure out, and that’s okay as long as you’re willing to commit the time. One thing you’ll learn with more experience is that if you’re on the edge of your understanding it will always be a struggle, the question you have to answer is do you enjoy the process enough to keep doing it?


I don't mind the struggle so much as the uncertainty. Will I be able to get a good job? Will I be good enough to keep it? Will I be good enough so I have enough free time to enjoy other parts of life? If I had a definite yes to all those questions, I wouldn't really mind as it would be the normal process of learning. But going through all this just to fail or plateau at a point where I have to work 12 hour days everyday to do what the guy next to me is doing in 8 hour weekdays is not the life I want.


> I don’t know what the difference between the normal struggle associated with coding is and the sort of struggle that means it’s just not for me.

Everyone struggles as they strain to reach the next level. Do you enjoy the struggle or its outcome? If you're not having fun now, programming as a career will seriously suck for you. If you are having fun, don't worry about your speed or how well you grok algorithms - find a job, any job, and try to kick ass at it. That'll set you up for a better job. Rinse and repeat.


The best way to learn programming is to make it a habit to spent long hours of your time in front of a computer practicing by picking up a book to teach you programming. Choose the topic you want to learn , a project you want to build , pick a book and learn it. Spend each day writing code for a few hours 5-6 Hrs preferably or more. And in 3 months you will become better, in 6 six even better. Also reach out for help, find what else is happening in that field , keep coming to HN. And you will be on the right path.


>>I enjoy trying to solve problems and coming up with a high level solution, but I get stuck for hours on details or miss vital parts of the algorithm so often it becomes a drag.

Even those people who invented these algorithms took years to do it. How do you expect yourself to do this in minutes?

Ability to not solve leetcode problems is a very bad proxy to measure anything with regards to your skills in delivering software.


Maybe. It's your life - and you only get one. A lot of this is what you see yourself doing day in, day out.

There are lots of jobs that are coding adjacent. Technical SEO is an example. A mate of mine does installations of software inhouse.

You don't have to code, per se, you can likely find a job where coding knowledge helps but is not specifically what you do.

There is a lot s scope in IT beyond coding, and I'd consider exploring that.


Also, note that very few programmers sit down and write algorithms all day. Boring line of business applications involve little of that skill. I've had no problem with writing such applications for then last ten years, but when came the time to write a simple naive quicksort I've struggled mightily. Those are very different aptitudes.


Being frustrated over a problem or a series of problems is a normal thing. It sounds like you are fully engaging yourself, so I would not quit. There are valid reasons to quit, but I don't think this is one. You won't believe the amount of crappy code you will see in your career. I won't even touch or go near any PHP codebase for example.


Don't quit. There is always someone you will be able to help. Computing science is not real life. Try higher level tools, they can do so much and help fill in a lot to connect the dots later.

You may be surprised to find you're able to help people solve technology problems that comp sci majors struggle to understand.

Keep moving, inward, onward, upward.


Working on a pet project and working on something you get paid for is also different.

When I work on my own things, I waste a lot of time trying different ideas/implementations because there's no time constraints or due date.


How old are you? These could be problems of low conscientiousness (which I have personally) or just problems of immaturity, and it's hard to tell absent further context.


Occam's Razor:

"...the simplest solution tends to be the right one..."

Although its not the intended context, its extremely useful to remember when building software (at least to begin with)


that problem is a red hard problem so don't feel too bad but I don't understand your brute force solution? the brute force solution is the last step of merge sort and then jumping to n//2


2 pointers, i and j, one for each array. I would have a while loop run for length of the arrays / 2 times. I would increment one of the pointers with each iteration based on which array had the next biggest number. When the while loop was done one of those pointers would be pointing the median if the length of both arrays summed to an odd number and I would return it. If the length was even, I would need to get the next biggest number from either array and average it with what would be the median if it was odd and then return that.


I think the OP was trying to accomplish the task without merging, so having a separate pointer for each array - with edge cases of differing array lengths?


yes that's much harder but not that's not what i would call the "brute force" solution so i'm not sure what they mean.


I think the best answer I can give you is that different people learn this stuff at different rates. Comparing yourself to others is not really the best way to judge if you want to do this for a living.

Your code example is trivial for me. But I've been a professional programmer for nearly 30 years. I've been programming for 41 years. I programmed at least a little bit almost every single day of those 41 years (I'm not sure if I have ever spent even 1 month away from the keyboard). When you have done the same thing as I have done, then this problem will be trivial to you too.

Doing a 4 year CS degree is waaaaay too short a time to decide whether or not you are going to be successful at this stuff. Yeah, some people are super talented and pick it up right away. But then, some of the people that look like they are super talented are that way because they've been programming since they were able to read.

If you are struggling now, then you will struggle at work too. You will probably have to work harder than the people who are talented or the people who appear talented because they have already put in a decade or two before you even started. You may find that the 9-5 work day is not enough for you to make the kind of progress you want in your career. There is nothing wrong with this.

The question you have to ask yourself is, "Do I want to do this?" If you are struggling, do you want to struggle? I struggle too -- even after more than 4 decades of programming every day. I pick away at it slowly, by slowly, by slowly. I have this super, ridiculous ego that fuels me, but I've also gotten old enough to realise that my ego is just that thing that let's me ignore how crap I am -- sometimes you have to do that. "Yeah, whatever. I seem to suck now, but just wait until you see my super awesome computer program that I'm doing on the side." (And... I never finish my side projects either... Don't tell anybody!)

On the other hand, there are lots of jobs in this world. You don't have to be a programmer. There are lots of reasons not to be a programmer and none of them revolve around whether or not you are talented at the job. It's lonely. It's stressful. It's stupifyingly hard to concentrate every second of the day all day long. People yell at you for fucking things up even when you've done a good job. Nobody can agree on what's good and what's not good and often sit around arguing about it all day long. because it's a super ridiculously details oriented job, most of your successful colleagues will have some kind of OCD related mental problem. Because it's a super ridiculously details oriented job, nobody will understand what you do for a living and everyone will think to themselves, "But that's easy. I could do that in 15 minutes. God you suck". The pay is good, but it's never enough to put up with the crap you have to take -- seriously, ask people why they want a raise; the answer is always, "Because if I'm going to have to put up with that crap, I want a lot more money".

So, be a programmer if you want to be a programmer. Not being talented is the least of your worries. That's just a matter of putting in the time and effort. Your rewards will be internal. If you love what you are doing, then the rewards will be great.

And I have a confession. If I did that coding example, I would definitely make an off by one mistake. Definitely. :-)


never give up




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

Search: