Why is code quality important

How can I deal with an employee who doesn't particularly care about code quality?

You're developing code for a company, so in addition to (actually more than) a developer, you need to think like an entrepreneur. This mindset usually grows with seniority.

All of the coding guidelines, self-documenting codes, maintainable codes, and other shiny things mentioned in books by various experts are great to follow. However, if you want to convince people to follow them, you need a more compelling reason than this:

Things that in my opinion shouldn't go into our main industry

You need data to secure your claims. You can certainly go to your boss and suggest doing all that shiny stuff (regardless of being a junior), but be ready to answer the question, "What would the benefits be for the project if you did this ? "

Vague statements like "it makes the code more readable / maintainable / testable / etc." (or much worse, "so and so recommends") does not convince anyone to change their best practices.

Remember, your seniors' "bad" code has been doing the job for ages. "Getting work done" is one of the most important things in business. If you tell people that there is a better way to do their job with just your "opinion" to keep them safe, you will not be persuaded to take the risk.

I would definitely encourage you to urge the team to do the shiny stuff, but be ready to put in the effort necessary to collect the data in support of your claims.

As an added tip, I hope you don't use the tone that you used in this post to convince your seniors. "Ha ha, you suck, I'll teach you how to do it" will definitely not work. "I have a suggestion to improve X and I think these are the reasons we would benefit from it. What do you think?" has a far better chance of being accepted.

code_dredd

I'm not sure if it's your intent, but when you talk about "shiny stuff ... in books" it might seem like you think the content is kind of meaningless. The books and other industry experts that have been around for decades are the data to keep it safe. In this case, the OP needs to summarize its concerns (e.g., "Working with X code is more difficult, time-consuming, and buggy than other code I've worked with that has best practices followed, etc."). They won't go read what he suggests and they won't care about the quality of the code because they won't have to work with themselves.

8 protons

@ray I guess what he / she is trying to say as this theory is great on paper but when a customer blows your throat down and now If you want results, theory and glittering code have to put productivity in the background. And in my admittedly short time in this industry, productivity and quality are not always linked.

code_dredd

@ 8protons All customers always want "now" results, but this is not limited to the software industry. The airlines want their planes "now" and for less money. should your engineers be excused when it comes to quality issues? Aircraft rely on software too, so it's not just limited to the physical framework ... and I'm sure you'll still have an angry customer who'll blow your neck when the software doesn't is stable . Quality will surely hit this point. If you defined "productivity" as "quantity", it would also be very "productive" to spend 100% of your time fixing bugs.

8 protons

@ray All I'm saying is that I've seen people write good code in X hours and others write near bug-free, good-looking code in 2 * X hours and at the end of the day the boss was happier with x and the Customer was happier with being charged for X hours. It's all awkward. You can write solid code without it having to be completely bulletproof

code_dredd

@ 8protons I understand what you are saying and you are right: it gives Costs for better quality. I wouldn't discuss that. What I am saying is this is true everywhere in everything. "It works" is not that only one relevant measure. Even the Titanic didn't sink immediately after touching the water. The technical flaws were revealed after a tragedy. My point is that cutting corners off you later the accumulated technical debt will cost. Future tasks will take increasingly longer, etc. The bill will always be due sooner or later.