3 ms·
I don't find any of these terribly impressive. 1. I don't understand this at all. You presumably typed your function return to expect whatever value.Format() r
by ufmace 6y ago
I don't find any of these terribly impressive.
1. I don't understand this at all. You presumably typed your function return to expect whatever value.Format() returns, presumably a String. You accidentally returned a boolean, which ought to be a type error. But your complaint is that the compiler didn't yell at you for discarding the result of the Format method. Huh? And I don't know and have never used the notebook thing he's talking about. If he has an issue with how that works, maybe it's a problem with that, and not the C# language.
2. Yeah that particular interface is annoying. I guess you could add a bunch of syntax sugar to make it easy like that, but the modern C# way seems to be more about using lambdas and the standard Linq extension methods to sort things. I can't get much enthusiasm about adding a bunch of new syntax sugar to make using the kind of archaic interface model smoother when there's already alternatives that work more like the way he wants.
3. Okay that would be kind of cool, and I think they already did add it, or plan to soon. I don't think it's enough of a benefit to be a major factor in choosing a language though.
4. I don't really know this IHtmlContent style of creating HTML. To me this seems like another case of, I guess that would be kind of cool, but I think there are better solutions for that already. I honestly would rather reach for whatever the standard HTML template format is for any language before using some object creator syntax sugar like that. It seems like that would be much nicer than any object creator format once you start adding in classes, IDs, formatting, etc.
5. Don't really know what he means here. dynamic is a thing all right. IMO, it's a handy thing for a few very special cases, and best kept as isolated as possible. For sure you can do some really horrendous things if you use too much dynamic everywhere, but it's on you to not do that. If you really wanna write dynamic code, best to switch to Ruby, Python, Javascript, etc. I suppose it's a good thing that it has it, just to give you the option if you really need it. Does he object to it existing at all, or to it being overused in some specific piece of code?