Ask HN: Strategies for working with engineers that are too smart?
509 points- They're brilliant, I mean very smart people (in an almost academic way?)
- They have a big appetite for adding complexity to systems
- They also have a big appetite for adding work to their own plates
- Their code has no consistent style
I work in embedded systems, so I'm generally writing C for resource-constrained systems. This sort of environment is rife with footguns, and I spend most of my time just trying to avoid those. A big part of that is keeping the things that my team controls as simple as possible, and while we are resource constrained, it's a balance. The tension comes when someone's more than happy to, for example, implement a complex caching scheme from scratch to save a few hundred bytes here, a handful of microwatts there. To me, adding that type of complexity for those sorts of performance improvements is missing the forest for the trees.
When an engineer like this proposes something that adds unnecessary complexity, it's usually hard to argue with. The proposed change typically does indeed make the system objectively better, and they're the one taking responsibility for doing the work and ensuring its correctness. But the overall system becomes a little more brittle, and a little harder to reason about, two things that are much more difficult to measure than memory and power.
Here's an example: an engineer on my current team recently proposed adding a significant feature to a module I wrote to make something dynamic that's currently statically defined at compile time. I pointed out that we could just change a couple entries in a static table to accomplish his goals, and we were able to avoid the extra work. What was notable, though, was his immediate willingness to write that feature. Maybe I'm lazy, but I'd sit there and think of half a dozen other ways to do it before settling on changing the module itself. But because he's smart enough to easily reason about a complicated solution, and he's willing to take on the extra work, he stopped there without weighing it against the larger system.
Have you worked with engineers like this? Do you have any thoughts on how to work with them in a productive and friendly way?
--
One more example if you feel like reading more:
In a past role, I got into a debate about code style with the smartest person I've ever worked with. It boiled down to me advocating for more whitespace in his code and him arguing that adding whitespace made the code harder to read. It took a bit, but eventually I came to understand that he is so good at reading code that he just wants it all laid out in front of him as densely as possible. He can effectively run it in his head, as long as he can see it.
That was baffling to me, I walked away thinking that I must be pretty bad at reading code. I use a very consistent style with long variable and function names, I keep my solutions as simple as I can, and I use whitespace generously to provide visual cues about the code's structure. All of this is to minimize the amount of brainpower I needed to understand my code, so I can put that energy toward thinking about the problem itself.
Comments (474) 222 threads
Earlier comments”Any fool can write code that a computer can understand. Good programmers write code that humans can understand.” – Martin Fowler
Anyway, I think there has to be a decision/ranking on the importance of having
1. happy programmers & excellent code 2. code that any(?) developer could jump in and maintain
To me it often boils down to not making simple shortcuts due to laziness unless it buys time to market or has some other significant upsides.
Making a system flexible can often be done in a non-complex way so I would challenge then need to make software complex. There is often a trade-off between efficiency and maintainability. If the efficiency route is always preferred there could come a day when the developers quit and others have to maintain what they feel is a mess of code and want to rewrite it. So my vote would be to keep the complexity low (and flexibility high!) unless there's a concrete benefit of allowing the complexity to grow.
You could look into various design patterns to keep code flexible while keeping complexity low.
- Document everything, and have a system for keeping documentation up-to-date (stale documentation is often worse than no documentation at all). Often it's possible to include a README.md in the same folder as the code it is talking about. You can link to it from a parent directory to keep things discoverable.
- Have a test suite for anything you need to be able to reason about. Also, design your test suite so that it defines your application's behavior with positive assertions (i.e. when then )
- Focus on solving a "class" of problem and document over-arching solutions. E.g. littering your codebase with a bunch of one-off optimizations may improve your application's performance, but the goal should be to have a consistent way of building the application so that these improvements are essentially a free by-product. For instance, in a data-heavy environment you may want to write some abstractions around bulk insertion and paging that can be applied universally. This way of problem-solving leads to good consistency and less cognitive load, because rather than a giant block that I look at and think, "What is this thing? oh, that's a paging implementation, gross!" I can instead recognize almost immediately what this thing is ("Oh, this is paged using PagedQuery, cool!") and also have other examples of its use around the codebase I can pull from to do whatever it is I'm actually trying to get done.
- It could be that you misunderstood the argument. Maybe the engineer wanted to avoid the old 'static global global' structures, which are still omnipresent in embedded C code, and which is followed by especially bad engineers. It's not about memory at runtime here; it's more about encapsulation, state and testability
- If that is the case then let the engineer do it. Code quality can be measured by how easy it is to remove a feature
- I've went into numerous turf wars about code style. I lost all of them, even if I won some battles. At one company, they were paying one full time engineer to manually reformat the team's code.
Don't play this game. Slap on astyle or clang-format. Enforce it. End all discussions with "Then you change the style guide and check with other projects". You win in either case.
- Don't ever argue with people who organise their code in neat tables with tabs and spaces
- Don't you have a product to ship? Make that clear to everybody, break it top down, and let the engineers fix that stuff.
- Remember, they are doing the work, you are just organising. Why should the code be easy for you to read?
- Maybe that complexity just exists for you, not for them. An isolated system may be as complex as it wants to be
- I'm not always right. And other people as well. We need room for mistakes. That lets people grow. I did a lot of mistakes, and I will do more.
So even if I know for a 100% that my colleague has chosen a bad path with bad complexity and a lot of work further down the road, I still let him walk that path. He needs freedom. All I can do is support him and protect the rest against the fallout. Other people offer me that freedom as well.
That is just a workaround for the problem with formatters.
Formatters have no information of logical context.
Structs initializers can become unreadable after a formatter has enforced its whitespace rules. Easpecially arrays of structs.
Instead of some simple struct you might end up with alot of code to just please the formatter.
I worked with a guy like this on the last contract I worked, ended up resenting him, really poor social skills and would just obsessively code all day. Another older guy would get lost on a refactoring project for months and then the manager asked me to review it, he's spent so long just refactoring and moving stuff around but it added no functional benefit, that's a lot of time and money to the business lost.
You can set engineering guidelines, PEP8, or enforce code rules via CI pipelines, at least then if they become pedantic you can just refer to the rules.
Ultimately I think it's a combination of introversion, obsessiveness, lack of experience in coding for others, being pedantic and social skills.
All comments shown.
Couldn't load more comments. Check your connection and try again.