DEV Community

Discussion on: Simple Working Code > Working Code

Collapse
 
piatro6 profile image
Ross Barnie

Absolutely agree with this as I know I'm very guilty of hashing stuff together sometimes to just get it working.

In this case there are differences between the two implementations. The controller action and route allows someone to visit your site at '/awesome' and be redirected to the very long URL. The helper means that you have to render the link on one of your pages, so a user could be taken to your site before having to click another link to get to the awesome page. Both fine, but have different implications for your traffic, usability, analytics, etc. So much of programming is understanding when you should and should not introduce complexity and the compromises you make between two different solutions.