DEV Community

Discussion on: Essential Senior Dev Skill: Solving Problems With Patterns

Collapse
 
skyjur profile image
Ski • Edited

I don't disagree with your. I'm sure having details of situation you made correct decision. You mentioned it was legacy application but from your comment it sounds like it's actually actively maintained application without too many problems I wonder makes it "legacy". Upgrading some old applications to async can be very painful. For example it might require upgrading legacy libraries to more modern ones that will have radically different interfaces (http, database drivers, ORMs, etc). If thread locals were in use this will need to be upgraded to different approach. If transactions are in use then db connection needs to be locked to async context. If code is littered with long-spanning transactions then this first needs to be broken down before considering upgrade to async flow otherwise async will bring no benefits. These are just some things I would expect to find in legacy application.

In web apps, you usually cannot simply add "more threads" since the thread pool is a static size

Static pool size is usually configured through config that what I meant by saying "adding more threads" sorry if didn't made it clear.

Thread Thread
 
jamesmh profile image
James Hickey

I think you've made a lot of good points there. Some legacy apps are really messy, tangled and use some poor practices.

I suppose it would also depend on how central such a system is to a business. Does it represent the "core" of the business?

If so, I would think it's worth more to invest time into improving the quality.

If not, or it's just not being maintained, etc... then perhaps not so much, as you said

I would agree, that in the cases you described it's really hard to add async stuff 😜.

I think perhaps where we disagree is about how often these near un-maintainable applications appear? I really wouldn't know what the overall percentage is...

And in some cases, we aren't talking about adding async, but just code quality in general.

I guess it's all about trade-offs. Is there a real benefit that will save the company money long-term?

I'd say we're both right - it just depends!

Thanks for the comments! 👌