News for hackers. Stuff that matters.
Re:Learn to Read Code by Mouse47 on Thursday June 29, 2017 @11:25AM (#14664016)
.NET MVC is really bad when it comes to this. I'm not sure what problem they were trying to solve, but referring to a specific controller-action by using Url.Action("Controller", "Action", "Area") was a really bad idea imo. This means that visual studio's 'find references' functionality doesn't work, and the project I'm working on has dozens of unused controllers (I think). It also means that developers can do stupid stuff like make links dynamically loaded from the database ('Controller', 'Action' fields that never change).

I also despise the whole concept of 'validators' in .NET MVC. Not only does it prevent you from using distinct validation for particular actions using the same model, it completely hides the fact that validation is used at all (if you trace the controller code). Why not just write a class that validates the model and use it in the controller? Is that 'too much code/too much coupling' for the controller? Ugh.

Re:Learn to Read Code by FLUX-YOU on Thursday June 29, 2017 @03:14PM (#14666073)
>This means that visual studio's 'find references' functionality doesn't work, and the project I'm working on has dozens of unused controllers

I know it's an annoying extra step to learn and do, but when doing anything with refactoring controller actions (e.g. changing action names or required parameters), Ctrl+Shift+F is really your friend. I have noticed references not getting picked up by the refactoring quick actions too, but it was sporadic.

Re:Learn to Read Code by Mouse47 on Monday July 03, 2017 @09:17AM (#14687991)
Oh I know -- powershell's my weapon of choice here. And it doesn't help when the previous developers decided to store action/controller names in the database...lol.