|
Launching on Pixel 3 family in US, coming to other Pixel phones "next month." Yes, please
Countdown to them figuring a way around it starts about now.
|
|
|
|
|
I didn’t like extension methods back then. I do like them now, provided they aren’t abused. "Anyone even peripherally involved with computers agrees that object-oriented programming (OOP) is the wave of the future. Maybe one in 50 of them has actually tried to use OOP – which has a lot to do with its popularity."
|
|
|
|
|
Okay, he's had a change of heart: he likes Extension Methods now ... but ...
A very interesting article, imho, for the use of quantitative textual analysis on a large sample of open-sauce flavors.
My idea of the right thing to do with any programmer who writes an EM on 'object, 'string, or other fundamental language objects: firing squad.
blinded by science, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
|
|
|
|
|
I disagree. Extension Methods can be useful on any type which you cannot change, no matter if it's a type in the .Net library or a Third Party component.
I wrote extensions on string :
public static string[] SplitTrim(this string _s, char _separator)
{
return _s.SplitTrim(new[] { _separator });
}
public static string[] SplitTrim(this string _s, char[] _separator)
{
string[] split = _s.Split(_separator);
List<string> collector = new List<string>();
foreach (string item in split)
{
string trimmed = item.Trim();
if (trimmed.Length > 0)
{
collector.Add(trimmed);
}
}
return collector.ToArray();
}
Do you see now that they can be useful?
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
First, I am sure you are among the most experienced, competent, careful programmers; whatever you chose to do, I'd never question.
My concern is more that in the context of a complex team project with programmers at different skill/expertise levels that making Extension whoopee with language foundation objects introduces the possibility of broken encapsulation. imho, it's not SOLID.
Consider:
public static class StringUtilities
{
public static string[] SplitTrim2(string _s, char _separator)
{
return SplitTrim2(_s, new[] { _separator });
}
public static string[] SplitTrim2(string _s, char[] _separator)
{
return _s.Split(_separator, StringSplitOptions.RemoveEmptyEntries)
.Select(str => str.Trim()).Where(str => str.Length > 0).ToArray();
}
} Every programmer using this Class is going to have to reference it per use, or, with a NameSpace 'using statement. In testing and debugging, it is easy, imho, to locate every instance of it's use.
In contrast, an Extension Method on 'string ... if in a NameSpace that's accessible by many other project components ... is, imho, an invitation to accidentally use it, possibly create a hard to find dependency.
cheers, Bill
«Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information?» T. S. Elliot
modified 10-Oct-18 9:03am.
|
|
|
|
|
My use of extension methods has been pretty limited but targeted in scope.
Two such extentions are:
public static string RemoveWhitespace(this string value);
public static string ToEnglishProperCase(this string value);
I have also used extension methods to perform basic operations that either are not in the .Net Framework or are in there but I haven't found them yet (e.g. adding bytes without casting, getting a sub array of bytes).
if (Object.DividedByZero == true) { Universe.Implode(); }
|
|
|
|
|
Quote: decline of traditional OOP Ehm, that would imply that some when in the past, OOP was in a better state than it is now. The author mentions "Single Responsibility Principle" in his article, which he said was hardly ever observed in his team when Extension Methods were introduced. But let me ask: how many programmers understand the concept of Encapsulation? And that comes before SRP, and SRP is just the first S of SOLID, and ...
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
The use of extension methods does not negate the use of OOP. Extension methods have their place, and their use should not be discouraged.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
In the US and across European countries, 50 percent of all new app development requests end in failure -- either by not being delivered at all, or being delivered without meeting the original business need. The other half never end
Anyone who guessed that the survey was paid for someone with something to sell gets no bonus points.
|
|
|
|
|
Nah, it's more like 70%. Half the remainder become bloated nightmares.
|
|
|
|
|
If you have an idea or a request for a feature, you can now use the new Suggest a Feature button on Developer Community and make your suggestions. Do they automatically add, "Resolved as won't add", or is that a manual process?
|
|
|
|
|
I think that's what their "AI" program is for.
|
|
|
|
|
Microsoft announced this month that it is omitting some basic printer and scanner drivers from the Windows 10 "October 2018 Update," also known as version 1809. Anyone need a slightly used dot-matrix for a boat anchor?
|
|
|
|
|
I'm just glad I kept my typewriter. Then I don't have to put up with companies telling me whats old and whats not. I also use it to write tattoo messages on my hand. Try that with your inkjet.
|
|
|
|
|
Want to take a trip down memory lane? The Internet Archive has you covered yet again, as the website today launched its own Commodore 64 emulator, complete with 10,500 programs as of writing. Lode Runner time!
|
|
|
|
|
Spinnaker is an open source continuous delivery (CD) platform from Netflix and Google, though it now also has the backing of other major software companies. Can it deliver us from hype?
|
|
|
|
|
If it goes half as well as the Portsmouth tower of the same name, it will be an unmitigated disaster.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Google said that it decided not to participate in the bidding process, which ends this week, because the contract may not align with the company’s principles for how artificial intelligence should be used. And by "principles" they mean, "everyone is watching us now."
|
|
|
|
|
Kent Sharkey wrote: because the contract may not align with the company’s principles for how artificial intelligence should be used. In other words... If I help you, I would not be able to do business with the AI, because you will get the full control and don't let us play with it
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Discovery shows China continues to sabotage critical technology components bound for America "Be subtle! be subtle! and use your spies for every kind of business. "
|
|
|
|
|
And the evidence is so super secret, it can't be shown so "just take our word on it"
|
|
|
|
|
It's showing the same signs that Voyager 1 did several years ago. Quick! Save the whales before it comes back
|
|
|
|
|
William Nordhaus looked for leading indicators of a Singularity back in 2015 but couldn't find any They're giving out Nobel Prizes for realizing the glaringly obvious now?
|
|
|
|
|
many profound statements are trivial, just not easily come by
|
|
|
|
|
New technologies keep on coming, but which are better to invest in now versus later? "There's a place up ahead and I'm goin'. Just as fast as my feet can fly"
|
|
|
|