Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
324 votes

Am I too 'clever' to be readable by Jr. devs? Too much functional programming in my JS?

In your code, you have made multiple changes: destructuring assignment to access fields in the pages is a good change. extracting the parseFoo() functions etc. is a possibly good change. introducing ...
amon's user avatar
  • 134k
227 votes

Am I too 'clever' to be readable by Jr. devs? Too much functional programming in my JS?

If you are in doubt, it probably is too clever! The second example introduces accidental complexity with expressions like foo ? parseFoo(foo) : x => x, and overall the code is more complex which ...
JacquesB's user avatar
  • 59.7k
160 votes
Accepted

How to warn other programmers of class implementation

In such cases, it is best to use the type system of your language to help you with proper initialization. How can we prevent a FooManager from being used without being initialized? By preventing a ...
amon's user avatar
  • 134k
103 votes

How to deal with a not-yet-implemented method that will be done by a co-programmer?

Ask for stubs. Or write them yourself. Either way, you and your coworkers need to agree on the interfaces and how they're intended to be used. That agreement needs to be relatively solidified so you ...
svidgen's user avatar
  • 14.7k
89 votes
Accepted

PM opting for an overly-complex setup which nobody has experience with

Once we were halfway the project, the PM stated we had to use third party message queue capabilities instead of threads and had to implement load balancing This isn't an appropriate thing for a PM to ...
John Wu's user avatar
  • 26.5k
89 votes
Accepted

How do you normalize coding style among multiple isolated developers?

Have a coding standard. If the shop you're going to work for already has one in use, that's the one you follow. Avoid coding standards that are dozens of pages long; it's not that complicated. ...
Robert Harvey's user avatar
87 votes
Accepted

How to deal with 'almost good' code from a junior developer?

If you think the code should be fixed before merging, make comments. Preferably with "why" so the dev can learn. Keep in mind code is read far more often than written. So things which seem "minor" ...
enderland's user avatar
  • 12.1k
80 votes

How to warn other programmers of class implementation

The most effective and helpful way to prevent clients from "misusing" an object is by making it impossible. The simplest solution is to merge Initialize with the constructor. That way, the object ...
JacquesB's user avatar
  • 59.7k
71 votes

What's the correct way to do pair programming?

If pair programming makes you feel like you're an air traffic controller trying to talk down an air plane piloted by a fidgety 12 year old you're doing it wrong. The reason that's wrong is because you ...
candied_orange's user avatar
65 votes
Accepted

How to effectively work with teammates whose fixes to bugs cause more bugs?

Test your code Have an actual regression testing, so that when a bug is introduced, the programmer finds it right away. This doesn't mean that you should just write the actual tests. Instead, it ...
Arseni Mourzenko's user avatar
53 votes
Accepted

Un-ticketed work, how much is too much?

If you work in a company that doesn't place any value in paying down technical debt, you may have no choice but to do unticketed work. Stakeholders are generally not qualified to make decisions about ...
Robert Harvey's user avatar
46 votes
Accepted

How can I promote the use of the Builder pattern in my team?

Thinking that we have to start somewhere, I took it upon myself to refactor a data holder class This is where it went wrong - you made a major architectural change to the codebase such that it ...
gbjbaanb's user avatar
  • 48.6k
39 votes

How to warn other programmers of class implementation

I would normally just check for intiialisation and throw (say) an IllegalStateException if you try and use it whilst not initialised. However, if you want to be compile-time safe (and that is ...
Brian Agnew's user avatar
  • 4,686
35 votes
Accepted

How to deal with misconceptions about "premature optimization is the root of all evil"?

It seems you are looking for shortcuts not to try out the "purest naive implementation" first, and directly implement a "more sophisticated solution because you know beforehand that the naive ...
Doc Brown's user avatar
  • 208k
31 votes

Un-ticketed work, how much is too much?

In a few safety-critical industries, you need approval for every bit of code that goes into a product. Most people are not in that situation, and those that are, accept that condition. In normal ...
Karl Bielefeldt's user avatar
30 votes

PM opting for an overly-complex setup which nobody has experience with

What would be stupid is to let yourself get death marched. What you are describing is that you've lost critical feel. There is no sense of control and no clear way back to it. The last thing you ...
candied_orange's user avatar
30 votes

How to effectively work with teammates whose fixes to bugs cause more bugs?

Start by inviting people to pick apart your work. You don't need management to create a command structure to fix this problem. You need teammates that trust you. You build trust by showing you're ...
candied_orange's user avatar
28 votes
Accepted

How to handle a TODO in a pull request?

When you say that they "generally stay in the codebase for the lifetime of the codebase" in your team/department/organization, consider the following: Write it down in your DoD that TODO, FIXME, or ...
beatngu13's user avatar
  • 483
23 votes

Am I too 'clever' to be readable by Jr. devs? Too much functional programming in my JS?

This answer of mine comes a bit late, but I still want to chime in. Just because you're using the latest ES6 techniques or using the most popular programming paradigm doesn't necessarily mean that ...
b0nyb0y's user avatar
  • 394
23 votes

How to ensure that developers see only the project modules they are working on?

Why you shouldn't do it from a team perspective The most important rules of project management regarding teams are: The project can be a success only through intense teamwork. Empowered teams that ...
Christophe's user avatar
  • 77.9k
22 votes

How can I promote the use of the Builder pattern in my team?

As luck would have it, a team mate of mine was working on another module and happened to need the setters, because the values he required became available at different points in the flow. As ...
coredump's user avatar
  • 5,965
22 votes

Wouldn't it be beneficial to write tests during code review?

This is a wonderful idea, with one caveat. Don't replace developer written tests with reviewer written tests. Have your reviewers look for corner cases and inputs that will break the code. In other ...
RubberDuck's user avatar
  • 8,961
20 votes

How to deal with 'almost good' code from a junior developer?

Keep the criticism on the code rather than the writer. Any work produced comes with inherent emotional attachment. Consider easing this by disassociating the code from the writer as much as possible. ...
Legato's user avatar
  • 309
19 votes

What's the correct way to do pair programming?

The common pattern is that more senior devs generally end up handholding more junior devs throughout the whole process First of all, pair programming does not inherently entail tutoring or mentoring. ...
Flater's user avatar
  • 51.7k
18 votes

Wouldn't it be beneficial to write tests during code review?

I don't think the idea is entirely without merit - however, the main benefit of the TDD et al is that problems are found early. The developer is also best placed to spot which corner cases may require ...
Robbie Dee's user avatar
  • 9,805
17 votes

How to deal with misconceptions about "premature optimization is the root of all evil"?

Ask yourself this: Is the software NOT meeting performance specification? Does the software HAVE a performance issue? These are reasons to optimize. So, if people are opposed, just show them the ...
Jon Raynor's user avatar
  • 11.5k
17 votes

How can I promote the use of the Builder pattern in my team?

How can I promote the use of the Builder pattern in my team? You don't. If your constructor has 3 lines of parameters, it is too big and too complex. No design pattern will fix that. If you have a ...
Telastyn's user avatar
  • 109k
16 votes

How can I promote the use of the Builder pattern in my team?

You seem more focused on being right than on working well with others. Worse yet, you recognize that what you're doing is a power struggle and yet fail to think through how things are likely to feel ...
btilly's user avatar
  • 18.3k
14 votes

How to warn other programmers of class implementation

I'm going to break a little bit from the other answers and disagree: it's impossible to answer this without knowing what language you're working in. Whether or not this is a worthwhile plan, and the ...
Patrick Collins's user avatar
14 votes

What part of development should a software designer do?

Preliminary notes about titles: Sometimes, what you really do doesn't match at all your official title. As an example, years ago, I was hired as an “analyst-programmer in R&D department”; however,...
Arseni Mourzenko's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible