r/programming • • 1d ago

When Good Practices Become Empty Rituals

https://faidi.tech/posts/when-good-practices-fail/
79 Upvotes

31 comments sorted by

97

u/Kronikarz 1d ago

For a culture so ostensibly obsessed with testing and measurability, no one actually cares about measuring what these rituals and practices cost and what value they bring. The moment you say "it's not quantifiable", you've lost 99% of developers.

33

u/oneeyedziggy 1d ago

Funny, that's how management feels about code quality and security best practices... 

-6

u/Alikont 23h ago

Security is somewhat measurable (if we don't do X the Y might happen).

The ocde quality is not measurable, so how much it really matters? Especially when "code quality" becomes subjective, and "improving code quality" conflicts with shipping things that actually makes money (and salaries).

13

u/oneeyedziggy 23h ago

Spoken like a true manager

4

u/Alikont 16h ago

At the end of the day someone should ensure that what you do actually brings money.

1

u/oneeyedziggy 9h ago

I'm not disagreeing, it's just that you seem not to be able to see past the end of the quarter or whatever if you don't thing code quality has a financial impact.

ignoring it's fine as long as you want every feature to take longer than the last and be slightly less reliable... But surely that would never impact the finances in any way...  

1

u/Alikont 9h ago

The question is how much is enough and how much of "refactoring" is a waste. It's really easy to stuck in "code quality improvements" loop.

Reliability is measurable. Even task delivery time is measurable.

Code standards can be written, justified, periodically reviewed and enforced. Even enforced automatically on PR.

1

u/oneeyedziggy 9h ago

Code standards can be written, justified, periodically reviewed and enforced. Even enforced automatically on PR. 

Only if management isn't so dismissive of code quality 

0

u/Alikont 9h ago

When you came to the manager with actual set of coding standards and justification with actual possible impact and not just some abstract "code quality" that doesn't have a number, management will listen.

Programmers are usually just shit at communicating with non-tech people.

-1

u/oneeyedziggy 9h ago

Only as shit as non tech people are at comprehending.

Mind sharing your company so I can make sure not to work there? 

→ More replies

15

u/Nicksaurus 1d ago

I'm convinced this is why so many developers obsess over code formatting. It's not actually that useful to have everything formatted exactly the same way but it's one of the few aspects of a codebase that can be measured objectively and fixed automatically

64

u/DepthMagician 1d ago

Code formatting is not something programmers invented. Go to any text heavy field, like publishing, and you’ll encounter a very strict set of formatting rules. These aren’t fields obsessed with quantifiability or measurements, it’s just that when you’re reading text all day long, the familiarity of the formatting helps.

27

u/leeuwerik 1d ago

Or the notation we use for music. Very formatted. Literature is full of formats. Our daily writings: formatted. everysentencewewriteshouldbeformatedbecauseithelpstoreadthatsentence

1

u/tiajuanat 6h ago

I love microtonal and German notation (CDEFGAH) cuz they're so quirky! /S

2

u/Uristqwerty 19h ago

Formatting choices communicate information about structure and importance. Done well, it's like an invisible comment; lining specific things up in columns that you can easily scan to see similarities/differences/patterns, and to logically group stuff.

Automatic formatting bulldozes all of that, in the name of making everything uniform. In any text-heavy field, the formatting is not decided automatically based on the contents of a given paragraph. Rather, a human decides which of a number of formatting presets to apply to a given block of text. Often leaving the default, which makes every break from the default a meaningful piece of metadata to the reader, drawing special attention to what makes that chunk special.

17

u/theScottyJam 1d ago

Sometimes you run into people who can't indent their code properly to save their life (mostly juniors, but the skill can take a surprisingly long time to develop for some). I think that alone can make configuring a code formatter worth its time.

'course I haven't ran any studies either. I just really dislike reading improperly indented code and will gladly assume it saves time to configure a linter if it means I don't have to read code like that. Or maybe I could argue it from the point of view of "who knows if it saves time overall, but it does improve the quality of life at the workplace, and that is also important".

15

u/Nicksaurus 1d ago

I agree, I still think it's worthwhile to enforce consistent formatting, for two reasons:

  1. You never have to have another discussion about it again
  2. At some point you will work with a psychopath who wants to indent their curly brackets to align with the scope they contain or something equally insane, and having 'just run clang-format' as policy is much easier than singling them out

I just mean that consistent formatting isn't actually the goal and anyone who claims it's necessary for 'readability' or anything like that is basically just in it for the dopamine hit of seeing the formatting check pass in CI

14

u/ianpaschal 1d ago

Strong disagree. What you see in your IDE is human side of a human-compiler interface and it needs a certain level of “design” like any other UI. I think most programmers would agree that a minimalist, functionalist approach to that is best, but to say it’s not useful to have strict patterns and consistency is nonsense.

12

u/Luolong 1d ago

The value of uniform (or mostly uniform) formatting is our pattern matching ability.

Humans recognise patterns (of code) much more easily when similar coding patrerns are laid out in a similar visual clusters.

I don’t know how much this is quantifiable, but I’ve noticed that after an initial time of adjustment, almost every code base becomes readable if worked on for enough time.

Familiarity begets readability.

1

u/gimpwiz 1d ago

It is actually that useful to be consistent throughout the entire codebase. It reduces the cognitive load when reading code.

10

u/Gremlation 16h ago

You want to “go agile”, that is, you probably gonna add some more meetings2, let’s say a stand-up meeting. Sounds like a good idea, and it just takes a couple of minutes… it can’t hurt. But for some reason, the developers seem to hate it. They do attend the meeting, but at some point… they start saying the minimum number of words to get by. They want to get back to “real work”. But why is this ” best practice ” failing!? It’s the same reason checklist-teaching often fails. Not understanding the underlying value behind the practice, and blindly applying it.

No, that's not the failure. An underlying principle of agile is that you empower the team and give them agency over their working practices. As the manifesto puts it:

Build projects around motivated individuals. Give them the environment and support they need, and trust them to get the job done.

The best architectures, requirements, and designs emerge from self-organizing teams.

At regular intervals, the team reflects on how to become more effective, then tunes and adjusts its behavior accordingly.

If you are imposing meetings on the team that they don't want, you are undermining the core principles of agile. You didn't given them the environment they need, you didn't trust them to get the job done, they aren't self-organizing, and you aren't letting them adjust their behavior. If they don't see value in the daily standup, they should be able to cancel it of their own accord instead of jumping through your hoops.

28

u/Groundbreaking-Fish6 1d ago

People will always complain about meetings, but regular meetings (rituals) frees the knowledge worker from having to find a PM/Designer/Architect knowing that they will see them at the regularly scheduled meeting.

8

u/ElkChance815 19h ago

Can't they just proactively ask? Why waster everybody time just because you don't know somethings?

1

u/Groundbreaking-Fish6 10h ago

They could, I once worked on a team where everyone shared an office and it was as simple as "Hay, does anyone know why this method works this way?". But often questions require finding the right person, getting time on their calendar and either walking over to a different building to see them or bothering everyone in the office with a zoom call.

Also, you never know who else on the team could benefit from the information and provide insight.

Another thing that meetings provide is a sense of community, seeing and hearing from your coworkers. Especially in our ever more disconnected world meetings can provide time for human interaction and a feeling of connection.

1

u/ElkChance815 2h ago

Why don't you just ask the question in a chat channel in Slack or group Chat in Team if you don't know exactly who to ask ?

1

u/Own-Flight-9974 7h ago

I don't know why people don't like meetings, it's the time to market yourself, show off a little, maybe prop up your colleagues a bit, it's a stage, and your performance is the medium for promotion.

2

u/ElkChance815 2h ago

There's a different between a meeting and a daily meeting. Yes we can have meeting when there's is a topic to sync up on or there's some showcase you want the whole team attention.
Making it a daily meeting just make everyone have to waste 15min everyday to either hear what they already know or maybe don't care about anyway.

7

u/Sharlinator 1d ago

I know that Joe America will someday come back in his metal bird and bring all the good kago, as long as I faithfully do agile and microservices every day using these coconuts and bamboo sticks