Read the error messages. Reread them. Extract every piece of information from them. Never close an error popup without having read and understood what it means. Always read stack traces when you're blessed enough to have them. 100% of the juniors (and an awful lot of seniors) I've ever trained simply ignore those and then come ask for help debugging. 99% of the time, the explanation for their problem is literally the…
Ask HN: What is your best advice for a junior software developer?
261–270 of 460 posts
Re: Ask HN: What is your best advice for a junior software developer?
#262Re: Ask HN: What is your best advice for a junior software developer?
#2632) Learn to love working on legacy codebases. This will happen everywhere you work. You will rarely (if ever) have the opportunity to start from scratch. If someone asks you to use an existing piece of code, and you decide to re-write it because you don't want to take the time to understand what's going on, you will A) appear to be anti-collaborative and B) reinvent the wheel, thereby wasting time. Obviously, there are scenarios where re-writing something from the ground up is necessary, but make sure all stakeholders involved agree and that you can estimate it correctly.
3) Always try to coax out as many details from designers and product managers/owners wherever possible. Perfect requirements will never exist but you want to be equipped with as many use-cases as you can before you start hacking on something. This may sound a bit waterfall-ish, but PMs and designers are not omniscient creatures. There is almost always some sort of gap that you may be able to help identify.
4) Don't be a dick, because there will almost always be someone who knows more than you. This applies to comments in PRs! Even if the entire company treats you like a god, that does not give you the freedom to treat others like worshippers.
5) If you are asked to estimate how long X will take, DO NOT give an answer until you have enough details so that you can make a reasonable estimate. If they force you to give one, pad it 2x or more depending on how much you don't know about what needs to happen for the task to be marked 'done'. Even better, ask them for a separate fact-finding task (spike, POC, or whatever you want to call it) so that this can be more easily tracked.
I could go on forever but these are some of the more non-obvious things I don't hear talked about enough.
Re: Ask HN: What is your best advice for a junior software developer?
#264Don't trust your manager(s) that they are going to lead/manage/mentor you in a way that will really help you. They are not.
If I allowed myself to be really cynical, they are mostly out for themselves. Most will have no problem using you or even throwing you under the bus to get themselves ahead (or protect their own jobs). And this involves things like having you do things (aka work with less valuable techs) that they don't want to waste their time with. That is what `delegation` is.
But don't worry though. Most of the time, they have little time left to think about ways to take advantage of you. They are just busy managing their own jobs, your fellow team mates, and their own bosses. Oh, and figuring out how to beat fellow managers. They have their own family/retirement-plan to take care of. They don't have much time left to manage you after sharing extended pleasantries with their own bosses.
And the more successful your manager seems, the more guarded you should be about them using you to their advantage. I've been around and of the bosses I had over me, two are now in high level position (VP) at really well known brand name companies in US. Because we were in smallish startup shop with cubes/offices near, I was able to observe them from nearby. Both were really good at pleasing higher ups (not necessarily through excellent work but with friendship), have no problem with pushing around those under them, and just do good enough job of actually managing the team.
Also, don't settle. Don't settle into a role that you feel comfortable. If you feel comfortable at a role, it's time to move on. And time flies. Make most of it.
Re: Ask HN: What is your best advice for a junior software developer?
#265Example: Junior is confused by where to put a new file/module/function in a frontend app and the app is built with Angular. Angular has Models, Components, Directives, Services, etc (I don't really use the framework, but same applies to Rails with MVC, Concerns, /lib, etc).
Learn your framework's constructs so you can frame your solutions in terms of the frameowork. You'll be more productive by reducing the scope of your decisions. Downside: you won't be able to find the 'best' solution to your problem - you are constrained by the framework's model of how a webapp should be built. This is ok, you are learning the ropes, so an increase in productivity is worth the constraint in freedom to choose.
First, imitate and understand why the framework does these things and what problems it means to solve. Once you've seen enough of these patterns/opinions (hmm maybe binding the view to a model manually isn't such a good idea, i've been forgeting and causing memleaks - hey Backbone days!) and have real life examples of where the patterns present problems, you'll be able to improvise/tweak/decide-yourself.
Re: Ask HN: What is your best advice for a junior software developer?
#266Earlier quoted context omitted.
It isn't just a huge hint, most of the time it tells you exactly what the damn issue is. This discussion is blowing my mind. I am honestly speechless. IT GIVES YOU THE LINE NUMBER AND THE FUNCTION CALL AND THE REASON! Why would you ever even attempt to debug without parsing it?
Wait wait wait. Not so fast. i'm one of those programmers who read manuals and stack traces but I have to admit that I've seen my share of both manuals as well as stack traces that didn't make much sense.
Those can be especially prevalent in systems that utilize a lot of indirection.
Re: Ask HN: What is your best advice for a junior software developer?
#267Earlier quoted context omitted.
It isn't just a huge hint, most of the time it tells you exactly what the damn issue is. This discussion is blowing my mind. I am honestly speechless. IT GIVES YOU THE LINE NUMBER AND THE FUNCTION CALL AND THE REASON! Why would you ever even attempt to debug without parsing it?
And in the opposite direction: remember when you are writing error messages to include all the relevant details, and never ever write "this shouldn't happen" or "document later".
Re: Ask HN: What is your best advice for a junior software developer?
#268Earlier quoted context omitted.
It isn't just a huge hint, most of the time it tells you exactly what the damn issue is. This discussion is blowing my mind. I am honestly speechless. IT GIVES YOU THE LINE NUMBER AND THE FUNCTION CALL AND THE REASON! Why would you ever even attempt to debug without parsing it?
Wait wait wait. Not so fast. i'm one of those programmers who read manuals and stack traces but I have to admit that I've seen my share of both manuals as well as stack traces that didn't make much sense.
Re: Ask HN: What is your best advice for a junior software developer?
#269Read the error messages. Reread them. Extract every piece of information from them. Never close an error popup without having read and understood what it means. Always read stack traces when you're blessed enough to have them. 100% of the juniors (and an awful lot of seniors) I've ever trained simply ignore those and then come ask for help debugging. 99% of the time, the explanation for their problem is literally the…
I mean, how could anyone ever learn to program well enough to get a job as a professional programmer without knowing to do that?
Re: Ask HN: What is your best advice for a junior software developer?
#270Learn how the debugger works for whatever language you use. You will be very tempted to just use logs as it's way easier and debuggers seem intimidating, but take a day out of your schedule to learn the debugger. When you really have no clue what's going on in your code there's no substitute for being able to stop your program mid run and inspect it's state interactively.
That last sentence is part of my piece of advice: Try to add stuff (comments, logging statements, etc) to your projects that will make things easier in the future, either for you or other developers.