Live data from Hacker News

Ask HN: What is your best advice for a junior software developer?

news.ycombinator.com

261–270 of 460 posts

Re: Ask HN: What is your best advice for a junior software developer?

#261
post #160

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…

Also great advice for a senior. Great advice for anyone really.

Re: Ask HN: What is your best advice for a junior software developer?

#262
A senior developer told me early on that all software is compromise. Thinking back to that has often saved me when I realize that I'm trying to find a perfect solution. There is no perfect solution. Also, read books, especially The Pragmatic Programmer. I finally read it this year as a Sr. Developer and there were some great nuggets of wisdom.

Re: Ask HN: What is your best advice for a junior software developer?

#263
1) Try to learn as quickly as possible which parts of the code are critical infrastructure and which parts of the code don't warrant perfection. I know this is probably difficult in an environment where every single character in a PR is heavily scrutinized, but time is a finite resource, and you need to be very careful not to overengineer things are not critical or will be replaced eventually. This was one of the hardest things for me to learn. Perfection is the enemy of the good.

2) 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?

#264
Good managers are rare.

Don'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?

#265
Understand key concepts in the (web) framework you are using. By sticking to patterns defined in the framework, you'll save a lot of time/confusion and prevent easily avoidable problems that accrue debt well into the future.

Example: 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?

#266
post #215

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

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

#267
post #225
post #215

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

If used correctly, «this should not happen» can be very useful, indicating e.g that the program is in some illegal state, as opposed to the input being incorrectly formatted.

Re: Ask HN: What is your best advice for a junior software developer?

#268
post #215

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

That's exactly what I felt as I was spending time on MSDN/Microsoft support website, reading about weird errors messages on Windows 95/98/NT/XP in 1990s. Some generic desc about the Windows error messages and no resolution.

Re: Ask HN: What is your best advice for a junior software developer?

#269
post #160

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…

Ok, I'm strictly a hobby developer so I don't really have co-workers to go ask for help. Do people really not read error messages? That boggles my mind. How would you ever figure out what went wrong?

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?

#270

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

This is absolutely true, but it mostly applies when your code is in development. Inevitably you will be asked to troubleshoot problems in production. So you'll need to learn how to read and understand log files. You should also learn how and when to log actions in your program.

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.

Post reply on HN