|
Apologize if that sounded rough, that was not my attention. I don't care if you are promoting or not (FYI I'm a writer too), you really did not have to delete your previous message.
Nevertheless the point I was trying to make is that the text felt quite generic... there was no concrete example as to why one would consider tag helpers over existing solutions.
I literally read your message like this: "you can do this, you can do that, see my article I'm using them like that"...
Also thank you for that comparison link, this is actually exactly the problem that I'm talking about, so now we have two syntax.
HTML Helper:
@Html.Label("FirstName", "First Name:", new {@class="caption"}) Tag Helper:
<label class="caption" asp-for="FirstName">First Name:</label> Currently tag helpers do not fully replace the html helpers (there is no tag helper for each html helper), so does that mean that we'll have to use both syntax?
Also the conclusion that article makes is: "The markup is much cleaner and easier to read, edit, and maintain than the HTML Helpers approach."
My question is how, how is that easier to edit and maintain?
If anything I feel this has drawbacks, for example here are few things at the top of my head:
- You cannot use "Find All References" or any similar action to navigate or search for.
- You cannot use "Quick Actions and Refactorings..." for fast and accurate editing, for instance changing all "Label" to "MyCustomLabel".
- Etc.
|
|
|
|
|
Mario Z wrote: Also the conclusion that article makes is: "The markup is much cleaner and easier to read, edit, and maintain than the HTML Helpers approach."
My question is how, how is that easier to edit and maintain?
IMO HTML helpers were something of a mystery, no intellisense - you no idea as you're editing if you had to spell firstname as FirstName or if it mattered, or was remotely correct. I suppose someone could have added intellisense, but the Tag Helper alternative at least looks/feels more like HTML (for those who have no idea of C#, Razor etc).
Tag Helper classes for example, case in point. I'd rather edit class="xxx" with some training wheels (aka intellisense) than wonder what on earth to put in new {@class="xxx"} ... but what do I know, except I get older, I forget more stuff than I never knew, and anything that makes it easier works for me.
Anyway thanks for your reply, like most things - there's lots of choices, stick with whatever works for you.
I know some people who can't understand why I don't like tripe and onions, I'm happy without - but though puzzled, they are too (more in the world for them).
|
|
|
|