Where possible we should really be trying to use Lightning Web Components over Visualforce. The main reason we should prioritize Lightning Web Components over Visualforce is because of a lot of the out-of-the-box benefits: more modern, more responsive, and frankly, Visualforce will at some point be deprecated.
Visualforce is still useful though, here are some good situations to consider still using it:
- Building Wizards (multi-step processes)
- Needing to control the flow through an application.
- Org isn’t using Lightning yet (this should be really rare in 2021)
Apex isn’t going anywhere. For the most part, Lightning Web Components will need to call Apex code if you are doing anything really custom. The Lighning Data Service is pretty good, but it’s not going to work in every circumstance.
Wrapping it Up
Visualforce is slowly disappearing; there are very few situations that mean we should start new pages or Visualforce components with it.
Apex isn’t going anywhere.