Live data from Hacker News

Ask HN: Are my expectations on code quality and professionalism too high?

news.ycombinator.com

51–60 of 306 posts

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#51
Looking through the comments, I see most people saying these are reasonable standards, so I'll do what I can to give some contrarian two cents.

The standards you list are: * Code review * Test coverage * Meetings over architectural decisions, needs for approval for taking shortcuts

The things you've listed have costs and benefits. The benefits are primarily communication between members of a team, and ability to rely on correctness of code from other members of your team. The costs are time investment. Reviewing code takes time, writing and maintaining useful tests takes time, and meetings for day to day decision making take time. In order for these practices to make sense, the time that they take to implement has to be made up for by the efficiency gained by a team using the practices. To take a trivial example, a solo developer working on code would absolutely be wasting their time to implement all of these things.

These practices also have costs in terms of iteration time on coding decisions. You are much more free to experiment and change around code when you don't have to do these other tasks alongside. This is especially relevant when you are creating a solution to a problem you do not understand well - in that situation initial solutions tend to get thrown away anyway, so there is no point making them to a vigorous standard at extra time cost. Instead, it is better to explore for a solution which works, and then once a good solution is found invest the time in making it robust later.

With that said, you yourself said that you see how slow dev is, and you know how fast it can be with this discipline, which makes it a bit pointless answering your post because you are already basically saying that the way you want to develop code is superior in the post itself. Anyway, supposing that is true, if you prove to the people you work with that you can improve efficiency with the practices you are talking about, and they subsequently ignore that input, then you have definitive prove that the people you are working with are not acting pragmatically.

Fundamentally - when making software the actual task you have to solve is creating software which solves a given task to a given standard of robustness in as short a time as possible. The practices you have listed are strategies for team coordination, and they do not apply to all team sizes. I've read and seen enough of people online who think that every company/team should model themselves on bigger teams - e.g. Facebook/Google/Twitter/whatever, and this leads to a lot of false beliefs in software development. These days people do crazy things all the time because they have in mind some dogmatic notion of "the right way to develop software". In order to be a pragmatic, effective software developer you need to rid yourself of any dogma you may follow, and phrase your questions in terms of what the problems are and how they are being solved. In this case, the question shouldn't be "does my team do x, y or z?", it should be, "is my team utilising its resources to deliver product x to robustness standard y within time frame z?" and if not, you need to know "will practice x help?" and if so how will it help.

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#52
When I first entered an environment with CI and code reviews as a junior, my thoughts were "OMG I am going to get nothing done now - it is going to take forever to do anything!".

And I was right to a degree - before I could pickup a bug, fix it, and it submit to the main repo without any fuss or review within 5 to 10 minutes and it would be in the next release. Knocking out bugs was a dream - done! fixed! resolved! done! done! done! DONE! project managers loved it as you could just machine-gun through fixes. Afterwards my personal velocity slowed right down and it felt very restraining.

This freedom and simplicity to do what is needed for developers is super seductive. If you come in as someone new to a team and want to start taking this away from people, you'll probably get some pushback with people complaining about it slowing them down/taking too long etc

So with that said, I don't think your expectations are unreasonable, but if this "wild-west" culture is ingrained it is going to be hard to introduce it.

My advice:

- get explicit "firepower" from as senior person as you can find. Make the request to do these things come from that senior person, not you. If it is you boss's boss's boss's boss is telling your team to do it, that carries greater weight than "the new guy" (no offense) and complaints about going slow or whatever are then kinda moot since your boss's boss's boss's boss knows the repercussions and wants it done like that regardless.

- couch these things as a developer aid. E.g. proper unit testing can help to prevent embarrassing mistakes or make "risky" changes less stressful, CI and repeatable builds means that the boring toil of cutting the release is removed etc. Reviews are a harder sell as most people see it as an intrusion/trust-thing/"we don't trust you not to fuck up without us checking"-thing/etc.

- try introducing things piecemeal. At one place I worked, we had CI but failing tests were not a blocker (we had a more of a jokey "hat of shame" where someone had to wear a top-hat or cowboy hat or something if they broke the tests that day) - eventually people ran the tests before submission to avoid the hat of shame and people were proud to say they never had to wear it over the past 5 sprints etc. At another we did "ad hoc" reviews where senior devs or TLs would randomly pick some changes from the other devs and review those after they had been submitted to get some level of oversight - usually hideous hacks, lip-service unit tests, or spaghetti messes were uncovered pretty quickly this way, but didn't "slow everyone down".

Slowly as people get used to unit testing and reviews or whatever you can slowly tighten the screws and introduce more rigor. Hopefully eventually people will come to appreciate the benefits these things bring.

Good luck.

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#53
It depends on how large the company is.

Are you doing it on your own, you'll probably won't need unit cases because you know it from the inside and out. You also know what to test.

Larger companies and eg. Distributed companies are code-meshes. Everyone works in most of the code. You need code-relviews.

And smaller companies are in between. They aren't sure yet which road to take. You will have to do the grunt work if you want something to change

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#54
post #43

To counter the flood of 'you sound reasonable', I think you are probably being unreasonable. The hint is "spaghetti code". What might have happened is you started slagging off everyone's code as soon as you've come in and now you're plucking at straws to justify it as you're getting ostracized. Also, objectively speaking, how can writing MORE code and spending MORE time talking to people be faster? Your argument make…

working in a large company with tons of spaghetti code and i can assure you it’s a real thing and that it not only slows you down it can actually strangle your company. making sure no more of it gets to production has become a top priority company-wide

Yep. Worst application I've ever had to work with was a WinForms monstrosity where ~300 form elements were used to store the application state, and none of them were named (so it was all "TextBox1", "TextBox2", etc.). Most of the application logic was in a single ~8000 line method. An absolute nightmare to debug or modify.

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#55

Your standards aren't too high but I think you must realise that this is a cultural problem with little hope of changing. Even if the push comes from the CTO, it will take years for change to happen, it will require new hires and bringing new blood into the engineering leadership. If you do want to take the challenge (which I strongly discourage you from) you'd need to collect data to build your case, quantify the ti…

> this is a cultural problem with little hope of changing

I disagree. Most existing teams with good processes started out decades ago without them, and improved incrementally from where they started. Team culture can absolutely be changed, but it takes a lot of time (and requires cooperation from seniors and managers).

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#56
Me as a manager at a startup: "Look, we have 5 months of runway. Does that make sense?"

Young dev from large corp: "Yes. But if you don't use Terraform we wont be able to see our infrastructure changes over time. We don't even have a proper code review process."

Me as a manager at a startup: "We have two micro instances. Do not install Terraform. Finish the import prototype... now."

Young dev from large corp: "Sigh, ok, just saying in 2 years from now we wont be in a good spot". [Then proceeds to blow 2 hours complaining on hacker news.]

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#57
post #34

This seems below average. No tests or code reviews is common but pushing directly to prod or connecting to prod databases is unusual. It seems you've gone from one extreme to the other. From what I've seen, even at companies were people work in silos producing untested spaghetti code, production is protected. In any case, among small companies, you'll have a hard time finding the same level of quality you were used t…

This is how it struck me, as well. There is a big gradient, and this is the extreme opposite end. Just be thankful the devs can “push” to production and aren’t individually rsyncing their code into the app servers. :)

[deleted]

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#58
Your perspective is just right in my opinion (and apparently most of the commenters).

I have worked in several small companies with 1-20 devs and have seen this again and again. I have been thinking a lot about all this, so in case you're interested, here's my thoughts on the subject.

For context:

I use git for almost any size projects, unless it's a couple of files, for an internal non-critical project. I create tests for at least the critical paths and usually benchmarks for hot paths. I use docker to separate dev from prod, while keeping a realistic environment. I use code formatters to avoid spending brain power, thinking about details that are irrelevant to the solution. I monitor and log as much as possible from the start.

Early on I was a part of the "code, then deploy" group, thinking that it was the clearest, easiest path to get as much done as possible. Slowly I have learned to use version control as a helper while coding, rather than a chore to be done after changes. E.g. by not being afraid of large re-factoring, when I see a way to clean up code or as an easy way to just try something out as it can easily be discarded again. It has also put my brain into a "segment changes into similar things" or maybe rather "do one thing, then another", instead of changing 7 things at once. This is not always true of course, but I try as it makes it easier to keep track of changes.

The same thing with separation of dev and prod (and test, etc.) - it makes it safer, simpler and easier to try things out, when you aren't afraid of breaking things.

On top of what you have mentioned, I've also always been the ops. guy, which has taught me to monitor and log as much as possible, then remove unnecessary monitoring or logging, when it becomes obvious noise. It also helps you understand WHY it's important to have working code in production ;-)

What I have experienced:

ALL of the above have ALWAYS been seen as "extra" from the business side and usually from other devs as well. It's hard to make (some) people understand the value of checking for correctness now, is better than having to find bugs and fix them 3 months from now (after they've usually caused data loss or corruption).

It's even harder to argue for the value of changing existing code AND write tests for it. It can easily seem like so much extra time in which nothing new is being produced.

I think the issue can be summed up in just a few points:

We as developers can be very averse to changes in our daily routine and/or how we do our job. Also: to get any size team to be effective, everybody has to be on board with 1 way of doing things.

Both dev and biz needs to understand and trust, that what seems to be slow progress, compared to "code, then deploy", is actually a streamlined process that makes development safer, faster and less buggy (and more fun) in the larger perspective.

Possible solutions:

It all becomes a cost / benefit analysis for biz and/or a question of getting devs to see the benefit in their daily work. Biz can usually understands the reasoning behind spending more time now to save even more down the road and avoid bugs in productions as that equals happier customers. Even better: tell biz devs, they'll have a less buggy system to present, when they meet with potential customers! The most resilient idea I have fought against, is the the thinking that you can keep adding low quality code to low quality code at the same pace without creating more/new problems.

I think that the 1 thing that concerns most developers is what held me back from all of this to begin with: We want coding to be easy and fast. We want compile times to be as fast as possible, trying code and testing to be snappy. Everything that is not code should be the absolutely minimal amount possible. So... If you are used to "code, then deploy", then testing, version control, code review, CI, CD, etc. can seem like a lot of extra work, that will take time away from solving a problem in code.

If you can show what each step accomplishes, a lot of developers can see the reasoning and if asked if they're willing to try, will actually be willing to try. The next step is to make sure that each step is impossible to avoid. E.g. Somebody has to be responsible for code review, pushing to production, etc. It should be impossible to commit directly to master branch or whatever is used for live. Pull requests should simply not be accepted, until it meets the requirements agreed upon.

Sometimes a clear path can remove the perception of e.g. creating a pull request, being a roadblock rather than a safeguard that helps you code faster and more safely.

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#59

Me as a manager at a startup: "Look, we have 5 months of runway. Does that make sense?" Young dev from large corp: "Yes. But if you don't use Terraform we wont be able to see our infrastructure changes over time. We don't even have a proper code review process." Me as a manager at a startup: "We have two micro instances. Do not install Terraform. Finish the import prototype... now." Young dev from large corp: "Sigh,…

Your scenario can be a lose-lose situation as it applies to the question. Speaking from experience, you can do the “agile” approach do fail fast, release faster, but with no buy-in from leadership to address the breaks in the future, your compounding problems on problems.

So, short-term, you have happy leaders who see releases as they want, and unhappy devs who are in a shitshow of code.

Long-term, if your startup is either acquired or starts to grow a strong revenue stream, leaders need to appease their new owners or their influx of new customers, and you can’t slow down because either a.) the new board needs to be impressed to justify their large acqui-investment, or b.) your new customer base is too big to risk losing. So you keep building on bad code, maybe squeezing in a few skunkwork refactored that only the dev peer reviewing and QA know about, and accept any delay on release as the result.

The approach should be somewhere in between, ideally with the engineering team being empowered to tell leadership “yo, we have a bomb of bugs just waiting to burst if we add one more feature with duct tape, let’s prioritize time to address it”.

If leadership doesn’t trust your team, then you have bad leadership.

Re: Ask HN: Are my expectations on code quality and professionalism too high?

#60
Always remember, you are not there to make code better or implement robust processes.

You are there to make money. Or, if you are working a lower tier job, simply reduce costs. If you are not doing one of those two things as a developer, your job is in grave danger and you will be the first one cut.

Throw your standards away, your standards are the company’s standards now. If you want to preach standards go be a consultant.

Post reply on HN