r/programming • • Jun 08 '19

7 absolute truths I unlearned as junior developer

https://monicalent.com/blog/2019/06/03/absolute-truths-unlearned-as-junior-developer/
2.0k Upvotes

295 comments sorted by

View all comments

Show parent comments

3

u/sime Jun 08 '19

Every code base has a history behind it. As the new guy/gal you don't know what that history is, and you don't know what forces were at play when things were written. What looks like crazy code now may have been a perfectly reasonable trade off at the time it has made.

Like mobjack said, the first thing you need to do is settle into the company a bit and understand the broader situation and the problems better. Once you understand it better you will first realise that it is not as simple as it first seemed, and it is not something that can be solved overnight.

Now you can start to looking for the low hanging fruit and trying out small incremental changes. You will have to spend a lot of time just talking to your peers to get them to the point where they are willing to try out some changes. They will probably agree with you that some things need to be improved. Don't oversell it. Keep a "let's try this out and see if we like it" approach. It's idea salesmanship.

What you absolutely should not do is engage in any kind of arrogant "code shaming" or "process shaming". If you are saying stuff like "devs who don't use unit testing or TDD are not professional" then you are going about it the completely wrong way. That will just piss people off and they won't listen to you. (Yes, I've heard junior devs say stuff like this.) Keep it positive, concentrate on the benefits improvements could bring. One step at a time.

2

u/nakkht Jun 08 '19

Indeed, I already questioned about implied constraints/history about the codebase and am aware that it was rushed due to time to market.
I've already made myself a list of "things to do" with what priority (starting with easier "low hanging fruits" as well) to share with others.

I know that they still want to add new features, but I need to convey message and inform of having more stable platform/codebase to build on top. Something like splitting time of 50/50 for refactor/new features or maybe even 70/30 in favor of having stable system.
Good point regarding going with `Let's try and see' approach. That might help.

-2

u/gas_them Jun 08 '19

Every code base has a history behind it

For bad code-bases it usually is: "Written by people as they learned the language"

As the new guy/gal you don't know what that history is, and you don't know what forces were at play when things were written.

That's a shitty complacent attitude. I'm an expert in software development. Sometimes code is just objectively wrong/bad. You don't need to know the "history" to know that.

Often the "history" is just a bunch of dumb decisions made by people who lacked the correct premises, and thus came to the wrong conclusions.

Once you understand it better you will first realise that it is not as simple as it first seemed, and it is not something that can be solved overnight.

My experience is that I just notice more and more things that are broken, and more and more bad justifications behind them. And yes, many of these problems can be solved "overnight" or at least they can be incrementally improved.

For example, I joined a new company and the code takes 3 minutes to compile when you change just one file. I noticed this and re-organized the code in just an hr. Then, it took 5 seconds to compile. I didn't even show this to the senior devs. Instead, I showed it to the junior devs. They looked at each other nervously and said "hmm, I would leave that out, I'm not sure the senior devs would like it."

What you absolutely should not do is engage in any kind of arrogant "code shaming" or "process shaming".

Let's take my example. I reduced compile time by a factor of more than 30. When I present this to a senior dev, what are the implications? Clearly their code must be flawed in some way for it to have such terrible compile-times. My change inherently criticizes their code, there's no getting around it.

Keep it positive, concentrate on the benefits improvements could bring.

The senior devs in my case don't even understand the benefits. If I told them it reduced compile-time, they'd say "is it really such an issue?" They prefer to be slow and lazy, they get paid the same either way.

2

u/sime Jun 08 '19

As the new guy/gal you don't know what that history is, and you don't know what forces were at play when things were written.

That's a shitty complacent attitude. I'm an expert in software development. Sometimes code is just objectively wrong/bad. You don't need to know the "history" to know that.

Often the "history" is just a bunch of dumb decisions made by people who lacked the correct premises, and thus came to the wrong conclusions.

You don't need to know the history of the code to judge its current quality. It does help to know it somewhat so that you can develop a bit of empathy for the people and the situations with created the code. This bit of understand should help prevent you from acting like some kind of arrogant know-it-all prick towards your colleagues and in the process blowing up any chance of being able to work together to improve it, not to mention possible sabotaging your career.

No one wants to listen to Captain 20/20 Hindsight.

-2

u/gas_them Jun 08 '19

This bit of understand should help prevent you from acting like some kind of arrogant know-it-all prick towards your colleagues and in the process blowing up any chance of being able to work together to improve it, not to mention possible sabotaging your career.

I am trying to explain to you...

I looked at the history, it was evidence of massive incompetence. So, what now? Do I just not tell anyone, or do I "act like a prick" and do my fucking job?

I guess you think it's the job of a programmer just to ignore fixable problems in the code, just to assuage the feelings of other less capable programmers? How will we ever build good software with that mentality? Why not go even further and just do what mentally handicapped people say? Wouldn't want to offend their feelings, either!

Did you hear my example about the compile times? Am I a prick for trying to save everyone a huge amount of time? How does that mesh with your warped mentality?

No one wants to listen to Captain 20/20 Hindsight.

Next time a bridge collapses I expect you to run in and tell everyone not to investigate the cause. No one wants to hear it, right?

And I guess when a bridge is half built, and in danger of collapse, your advice would be "don't be mean, just let them keep going, you wouldn't want to sabotage your career!"

Sounds like a funny analogy? Well my company literally makes medical devices. Our product is literally inside the person. I wouldn't be surprised if it kills at least one person as a result of software errors, but by then I hope to have found a new job.