Live data from Hacker News

Ask HN: How do you deal with the powerlessness feeling of coding?

news.ycombinator.com

1–10 of 35 posts

Ask HN: How do you deal with the powerlessness feeling of coding?

#1
I've been a developer for 7 years. I'm just a random web developer doing random application for random companies.

But I have a recurrent powerlessness feeling every time I code. I often get blocked on issue that are not made by me.

The last few years I was a front end developer and as you know everything is complicated in the javascript world and everything always change. For example it was recurrent to have issue with webpack or the ES6 compiler. It was the kind of hard issue, the manager doesn't care and doesn't understand, he just wants the new form to work but here I am, just another day and nothing work for no reason because of external issue (webpack here for the example).

The problem is this, I don't know how to resolve the issue, (and only a few people on earth know because webpack is so hard to understand), and I don't have the skill to resolve the issue which is not mine.

Yes I know I can report an issue, try to fix it, debug all the application and maybe with a lot of chance I will be able to resolve the issue. But the manager don't want me te take a few days on something he doesn't understand and which it isn't my fault. What am I supposed to do ? I feel powerless. How do you resolve this kind of issue ? It's a difficult state of mind and it get a lot of stress from it.

For the last few months I've been learning back Django which was my first love. I'm learning back the django rest framework and today I have an issue where in the DRF interface the button for POST/DELETE/PUT/PATCH don't work. They don't even send the POST/DELETE/PUT/PATCH request, they just reload the page as if the only thing those button do where `window.location.reload();`.

What am I suppose to do with issue like this ? I've found a 1 year and 11 months old stackoverflow issue with no answer, and it's such a basic feature. Nobody use the DRF framework nowadays for nearly 2 years ?

What am I suppose to do? Debug it ? I don't event know where to start from. Develop a better alternative than DRF ? I don't have the skills. Post an issue on github ? I will get an answer like "we don't have an issue here maybe check your code you should have miss something". But I don't know where to search because the interface is made by DRF and not by me. The browser don't even send a request, and the server receive just a get request to reload the page.

I feel so powerless and it's always like this. It's not as if I was missing something I mismanage in my model, it's the library I use that doesn't work. What am I gonna say when I will be looking for jobs ? Sorry it doesn't work for no reason so I couldn't improve my skill so I'm a shitty developer.

This is not a post about shaming famous project (like here Webpack and DRF for the example), those are incredible project that change the life of millions of people. I would have never been able to do 10% of those. I just often get stuck in those kind of things. I find no answer on the internet and I don't know what to do next. Pay a freelancer to help me debug the application ? What am I suppose to say to a manager or recruiter ? How do you manage the stress of the powerlessness feeling I have. Am I the only one to feeling like this ?

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#2
Well, as soon as you adopt a library it becomes your problem if something is happening.

I tend to simplify things as much as possible and using my own code. Doing PoC's to see if i can adopt a certain "thing".

So my solution for being "powerlessness" is owning the code i use and therefore I know what it does.

I use tools a lot, but also because of that, I'm able to fix issues fast and mostly the error is from my end.

For example, i had some slow query generation in EF a couple of years ago and this led to the EF team implementing a Like operator. - https://github.com/dotnet/ef6/issues/115

( I actually had to debug the library and give a reasonable explanation to the team. They found a solution, that they already considered. Which i think is pretty awesome of them! I use the like operator a lot by now)

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#3

Well, as soon as you adopt a library it becomes your problem if something is happening. I tend to simplify things as much as possible and using my own code. Doing PoC's to see if i can adopt a certain "thing". So my solution for being "powerlessness" is owning the code i use and therefore I know what it does. I use tools a lot, but also because of that, I'm able to fix issues fast and mostly the error is from my end.…

But what do you do when you don't own the code ? It as never been me which had the decision to choose which things to use. It is the manager or the market. The market is looking for certain kind of developer and I need to know how to use those libraries otherwise they will not hire me.

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#4
post #3

Well, as soon as you adopt a library it becomes your problem if something is happening. I tend to simplify things as much as possible and using my own code. Doing PoC's to see if i can adopt a certain "thing". So my solution for being "powerlessness" is owning the code i use and therefore I know what it does. I use tools a lot, but also because of that, I'm able to fix issues fast and mostly the error is from my end.…

But what do you do when you don't own the code ? It as never been me which had the decision to choose which things to use. It is the manager or the market. The market is looking for certain kind of developer and I need to know how to use those libraries otherwise they will not hire me.

Fixing other people's code is actually part of the job.

The more "s*t" you fix, the better you understand the toolset and the better developer you become by making better decisions.

The powerless feeling you have could be because a certain toolset is currently new to you.

Eg. I received a legacy project from a junior developer ( an important one), it took me 4 months to fix all ( and huge) issues. Now it takes me 5-10 minutes to identify an issue ( after improvements). It's a similar situation, but from a big internal project instead of a "small" library.

While your manager doesn't pay you to solve an issue from an external tool. He does pay you to solve the issue in the internal project. It's the same thing, but another perspective.

If you need to spend 2 days in that opensource project and you're sure that's the cause, so be it. A manager "only" cares about the end-result, not the road to it.

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#5
You're not alone. What you describing is the problem with abstractions. They are fine and dandy when they hide the details and let you produce a greater volume of results than if you had to develop from basic principles. Unfortunately, most abstractions are brittle and often poorly maintained. I have had many experiences comparable to yours.

I think you have two distinct problems. Your manager is obviously ignorant and possibly techno-illiterate (the most common variety of their species). To use an analogy, he is handing you a pair of Nike shoes and expecting you to outrun Usain Bolt - just like that. No training, no warm-up. Just Go!

As for the technical problems, when you are confronted with a problem that is beyond your abilities to fix, you tell your manager that they need to either give you time to debug the issue or they need to hire a specialist to fix it. Another analogy: if your car is not running and you don't have the skills to repair it, you take it to a competent mechanic. Nobody knows how to fix everything all the time. That is simply the price we pay for the ever increasing technological complexity. With cars people understand the issue. Seems like it is less obvious to the average person when it comes to software development.

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#6
post #3

Well, as soon as you adopt a library it becomes your problem if something is happening. I tend to simplify things as much as possible and using my own code. Doing PoC's to see if i can adopt a certain "thing". So my solution for being "powerlessness" is owning the code i use and therefore I know what it does. I use tools a lot, but also because of that, I'm able to fix issues fast and mostly the error is from my end.…

But what do you do when you don't own the code ? It as never been me which had the decision to choose which things to use. It is the manager or the market. The market is looking for certain kind of developer and I need to know how to use those libraries otherwise they will not hire me.

Not sure what you mean by "own" the code. It is all open source?

Managers tend to pick products that are most aggressively sold to them. Either by salespersons, or by public opinions.

As for the market for developers you either meet the market by developing skills in the libraries/frameworks that are in demand or you choose a different niche. You have 7 years experience so there must be certain areas that you are comfortable with.

Beware, of fad-driven development. The latest shiny new thing doesn't guarantee that it is applicable for every possible application.

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#7
> For the last few months I've been learning back Django which was my first love. I'm learning back the django rest framework and today I have an issue where in the DRF interface the button for POST/DELETE/PUT/PATCH don't work. They don't even send the POST/DELETE/PUT/PATCH request, they just reload the page as if the only thing those button do where `window.location.reload();`.

It's hard to know for sure without actually seeing it, but...

This sounds very much like a fairly typical JavaScript problem. Or to be more precise, a "lack of JavaScript" problem. Let me first explain what I think may be the problem and then how you could look into solving it.

The problem as described makes me think:

- There is a button which submits a form. It should use an XHR for the submission, which means there should be some JS event handler attached to the button.

- But instead of that, if for whatever reason the handler was not attached correctly, then the button would simply submit the form it belongs to in a default way, which would reload the page. This fits the description you give.

So, first thing, how can someone go about verifying if this is indeed the case of what is happening?

What you do is you open your browser development tools and look around for a couple of things. First, you load the page normally, and do not yet click the button. Now, you look in the console for any JS errors at all and, if there are any, see if one of them maybe either a. related in any way to the button, the form, the event handlers, etc, or b. there is one that breaks JS execution, which would prevent other code from being run. More: You inspect the button itself with the DOM inspector and verify if it actually has any click event handlers attached. Note that it may be the case that the handler is attached as a submit handler on the form, instead of as a click handler on the button. If there is neither of those, then it's very likely that something has prevented some piece of JS from being run and the handlers from being attached.

After looking at that, still with your browser dev tools open, you set the network tab as visible, and then actually click the button and trace what happens. There's a lot to learn about browser dev tools, and there is a lot of info out there, so when you have a chance, that's something you could spend some time on. But right now you just want to check the request that happens when you click the button. In particular you need to look at the type of request and the "initiator". These will tell you whether it is indeed a "normal form submission" or an "XHR request".

Once you verify these things, if this is not the problem, then you'll need to explore other options -which I cannot specify more due to the lack of information, of course-.

But if this is indeed the problem, that there's no event handler attached and the form is simply submitted, then you need to investigate why there is no handler attached, obviously.

Again, try to search for any errors in the console, check id's used on the form or button, check the template that generates the button and form. Also check the network template for any 4xx, 5xx, or any files that are not loading for whatever reason. It may be a misconfigured path, a missing library, a misconfigured MIME type... It can be a lot of things.

If you can't find anything like this that gives you a clue, then it's time to change the approach. Now start by looking for the origin of that button in the source. Where is it created? How is it created? Does it depend on any parameters? Are those correct? Does it depend on a global configuration? Is that correctly set up?

I can't tell you anything more specific than this, but that is how you "go about solving the problem". At some point, you'll most likely find a misconfigured path, or a missing file or parameter. Or, at the very least, you'll find an error message that can give you a clue of what is happening and what should be your next step. With that it will be much easier to ask questions.

----

So, in summary, you fight the powerlessness by actually trying to figure it out. There is no secret, really. There's no magic thing people do to solve problems we haven't seen before.

Note, also, that I cheated a bit. That is, going from your description I offered an experience I have previously had. But what if it was my first time? What if I had never seen this? The idea, then, is to first establish what is actually happening. You suggest "...as if the only thing those button do where `window.location.reload();`". This is an hypothesis. So you verify it. You do the thing with the browser dev tools -which you learn to use beforehand, of course-, and try to verify if your hypothesis is correct.

There's a small catch, though. Your hypothesis there is a bit "too sophisticated". Why would someone attach some JS to do location.reload()? Could there be an easier explanation? That's where the above comes into place: if you attache no handler at all, the submission is just a normal form submission; if the form has no explicit action declared, it will POST/GET to the same current URL.

So, in a way, that is a small secret -but really, it's not secret- thing: always start verifying from the simplest things. Always check the most simple hypothesis. This can even be extensible to "always check the most visible/obvious things", like always checking the error console and always giving the network tab in the dev tools a look for 4xxs or 5xxs.

Also, as already mentioned: owning the code. But this does not necessarily mean making the calls. Sure, you did not make the decision to use DRF, ok. But you can still make the effort to learn DRF to a desirable extent.

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#8
Happens to me all the time, I also feel powerless in many situations. How do I handle? Well, I try as much as I can to fix the issue by spending countless of hours on it. At some point I reach to my team for help and now the responsibility is shared: if we can't manage to fix the issue we try with another approach.

Managers usually like to say "we are here to clean up your way from distractions so you can focus on the important stuff". Well, most often than not what I need help with is with stuff like OP described... ironically managers can't help with that (they help with stuff I usually do not need help with).

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#9
post #7

> For the last few months I've been learning back Django which was my first love. I'm learning back the django rest framework and today I have an issue where in the DRF interface the button for POST/DELETE/PUT/PATCH don't work. They don't even send the POST/DELETE/PUT/PATCH request, they just reload the page as if the only thing those button do where `window.location.reload();`. It's hard to know for sure without act…

Thanks for your help and explaining your philosophy of debugging.

I found the issue, it was ublock origin which was preventing the request. My model name is called "Ads" so ublock think it was really ads ans so preventing the request and make the browser reload.

After deactivating ublock origin the request is executed and I receive data on the server. It still crash but now I can debug it and make my code work.

Thanks for your help and as you said there is no secret. You just need to work it out until you find out. thanks !

Re: Ask HN: How do you deal with the powerlessness feeling of coding?

#10
post #9
post #7

> For the last few months I've been learning back Django which was my first love. I'm learning back the django rest framework and today I have an issue where in the DRF interface the button for POST/DELETE/PUT/PATCH don't work. They don't even send the POST/DELETE/PUT/PATCH request, they just reload the page as if the only thing those button do where `window.location.reload();`. It's hard to know for sure without act…

Thanks for your help and explaining your philosophy of debugging. I found the issue, it was ublock origin which was preventing the request. My model name is called "Ads" so ublock think it was really ads ans so preventing the request and make the browser reload. After deactivating ublock origin the request is executed and I receive data on the server. It still crash but now I can debug it and make my code work. Thank…

That is such a monster of an issue, glad you were able to figure it out though
Post reply on HN