|
I had a small FUBAR with my network and I needed to do a bit of kicking the boxes and rebootarama
veni bibi saltavi
|
|
|
|
|
The Interview
Some men are born mediocre, some men achieve mediocrity, and some men have mediocrity thrust upon them.
|
|
|
|
|
It would seem to me that there is a joke in there somewhere about Paris and doggy style, but since this is the Lounge and not the Jokebox, I think I ought to just leave it alone...
Anything that is unrelated to elephants is irrelephant Anonymous ----- The problem with quotes on the internet is that you can never tell if they're genuine Winston Churchill, 1944 ----- I'd just like a chance to prove that money can't make me happy. Me, all the time
|
|
|
|
|
Johnny J. wrote: Paris and doggy style
Paris Hilton? Seen that movie, not much dialogue in it to quote from though!
How do you know so much about swallows? Well, you have to know these things when you're a king, you know.
modified 31-Aug-21 21:01pm.
|
|
|
|
|
|
Had a Carrera-Servo and was fascinated that it was possible to steer and change tracks within the race. Had several bada** sessions with my dad
Now they come up with this high-tech stuff[^].
I feel older now...
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}
|
|
|
|
|
Buy the toy and feel younger.
|
|
|
|
|
I feel older every second of every day!
Life is like a s**t sandwich; the more bread you have, the less s**t you eat.
|
|
|
|
|
Three college professors were driving down the highway at a very slow speed. A policeman pulled them over and explained that driving so slowly on the highway could be hazardous. The driver pointed out the sign that read "20." He explained that he was going 20 mph because of the sign. The policeman pointed out that the sign indicated they were driving on Highway 20.
Somewhat embarrassed the professor apologized and promised to be more observant.
As the policeman turn to walk back to his car, he noticed the other two professors on the floor ...looking scared to death!
He asked the driver, "What's wrong with them?"
The driver replied, "We just turned off Highway 105."
|
|
|
|
|
Scared to death? At 105 what? Miles per hour, I guess. That's a speed I reach only seconds after driving onto the Autobahn.[^] If traffic and weather permit, of course. Time to retire when I feel anything but pure joy when doing that.
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a f***ing golf cart.
"I don't know, extraterrestrial?"
"You mean like from space?"
"No, from Canada."
|
|
|
|
|
|
Twenty five years and one day ago,
Nelson Mandela walked into freedom, after 27 years.
|
|
|
|
|
My one political 'rant' for the year; And Jacob Zuma took only a few years to destroy all the good things Mandela did after his release. At this rate we will pull all of Africa into the dark ages before the end of the decade.
My plan is to live forever ... so far so good
|
|
|
|
|
I'm against making a fuss about terrorists being released from prison. Don't give them the attention.
I wanna be a eunuchs developer! Pass me a bread knife!
|
|
|
|
|
|
IMetaFactoryDependencyInjectionResolverFactoryProxyFactory , anyone?
Software Zen: delete this;
|
|
|
|
|
Oh you use that pattern?
It's alright but a bit too tightly coupled for some of our code!
|
|
|
|
|
What do you get when you cross a joke with a rhetorical question?
---
The metaphorical solid rear-end expulsions have impacted the metaphorical motorized bladed rotating air movement mechanism.
---
Do questions with multiple question marks annoy you???
|
|
|
|
|
While INowResolver seems like overkill, sometimes tests need to fix the time to get reproducible behavior. I find using the registry is similar, as are really any external data stores or sources of info, ie random numbers too.
Unit tests should never rely on external input to work correctly. MUCH easier said than done.
So I get it, and I also get where you're coming from. It's certainly a shock to the system when you're used to the ease of static methods.
Good luck with it!
|
|
|
|
|
al13n wrote: Good luck with it!
Thanks! :P
|
|
|
|
|
Has everyone written their Y2.038K unit tests yet? We don't want to wait till the last minute, like Y2K, when the legacy 32-bit time_t range is about to run out.
|
|
|
|
|
I'm sure just like everything else it's going to become an anti-pattern.
I love it though. Not in the, "I'm going to use it everywhere!" way though. Like every coding choice there should be a good reason when you apply it.
In ways, it's one of my problems with async-await. It's great except how it creeps like a fungus where you don't want it. Not to get off topic.
|
|
|
|
|
Exactly! There is such a thing as too much of a good thing!
|
|
|
|
|
The rule of thumb I use is pretty simple. If i'm designing a class that depends on some other class, and there is a logical reason for that class to change either at runtime or in testing then I use dependency injection.
I also use DI when it makes sense to control something at runtime, such as a configuration entry, connection string, etc... or anything I might otherwise use a factory for.
Your example above for INowResolver seems kind of silly at first glance, but in reality, it's a great example of a DI resource. The problem with DateTime.Now is that you cannot alter this in testing, it always uses "Now" even when you might want to use a different time for "Now" (think when you want to test what happens in 2037 when the Y2037 bug hits, you can now substitute INowResolver with a different date/time for "now" to test what will happen in the future). Yes, you could write conditional code in your method to deal with this, but now you have test code in your methods, rather than in your test cases, which makes them messier and more difficult to maintain. There are also "Moles" or Proxy stubs that can replace the runtime behavior of methods like DateTime.Now, but not everyone uses those.
Your problem here is that you're not truly understanding the purpose of Dependency Injection, and as such you have a hard time understanding why it's used so much. You probably see it as a simple service locator or abstract factory service... injecting stuff so you don't have to bother typing "new". While it's true that you can use it for that, it really opens up a whole new array of possibilities when you "drink the Kool-Aid".
As for your Utility functions... in general, no.. you don't need to use DI for utility functions if there is no configuration or other dependencies involved. Particularly if they are pure static methods with no state.
--
Where are we going? And why am I in this handbasket?
|
|
|
|
|
No, my problem is always it COULD be used in theory to do... some special things...
Which I haven't seen BEEN put into practice...
(which is to be expected when there is a combinatory explosion of mock call to write equals to number of method to test times number of interface method to mock!)
But enough, I am not here to argue, on the contrary!
You love dependency injection! Wonderful! Me too! Gonna write no more public constructor or static class for the foreseeable future ever!
modified 12-Feb-15 1:49am.
|
|
|
|