OK, I’ve got nothing at this point to entertain you with other than pubic wigs so I thought it might be time for an open thread. What’s on your mind? What are you doing this weekend? Any plans for the Fourth next weekend? It’s all good. Except merkins. If you’re doing anything with a merkin, let’s keep that to ourselves, shall we? Great.
So I’m listening to Soma this morning and I glance down at Winamp to find that the band I’m listening to is called Merkin Dream.
Yup, I’m listening to music by a band who dreams about pubic wigs. Good times.
Ran across a fun one this morning and thought I’d offer my findings up to the Google god in case others out there suffer from the same affliction. We’ve got all our interfaces in one assembly and all our WCF services that implement said interfaces in another assembly. I rolled out some changes this morning and then tried to hit the services. Unfortunately, I started getting System.TypeLoadException asserting that “Method X in type Y from assembly Z does not have an implementation.” Except that it did have an implementation.
After an hour of frustration and banging my head against my keyboard chanting “But my method DOES have an implementation” which only served to give me a headache, I ran across this forum post that says the compiler/linker sometimes gets its panties in a wad and that I should try doing a full rebuild instead of just a build. I gave that a try, rolled out the services and whaddaya know, it worked.
If only they were all that easy.
Sometimes, I get down on myself because I don’t ever come up with good ideas for software projects. I feel like I should be able to come up with something that I could turn into a product that people might want to buy. I’m reasonably smart, I understand people at least 42% of the time and I can write software. Then tonight, I had an epiphany. I’m setting the bar entirely too high.
If I told you I had an idea last night for a new invention and that it was called the banana guard, would you immediately offer me venture capital? No, I didn’t think so. You’d probably tell me to go down to Condom Sense and ask them. But don’t worry, that link is completely work safe because SafeBanana.com does exactly that, it’s saves bananas. The yellow kind they import from Guatamala, not a banana used as a euphemism for a penis.
I need to stop trying to come up with good ideas and run with all the shitty ones I have. Clearly, if SafeBanana.com can be the “Official UK supplier of the award winning Banana Guard”, I can come up with something else those crazy Brits will buy.
I used to write code like this all the time (and used to is highly subjective and quite possibly includes a time frame as recent as 3 minutes ago):
MyObject obj = new MyObject();
obj.SomeProperty = 1;
obj.AnotherProperty = 2;
obj.YupItsAnotherProperty = 3;
With c# 3.0 (which on an unrelated note doesn’t particularly roll off the tongue in the way that Python 3000 does. We need to fix that. Or have Vanilla Ice write a rap song about c# 3.0: “Rollin’ along in my 3.0, got my nine in my pocket and I’m ready to go”. I digress.), I now have a new option that is so much easier with less typing and a cleaner look:
return new MyObject
SomeProperty = 1,
AnotherProperty = 2,
YupItsAnotherProperty = 3
How much nicer is that? Less code, more concise, easier to type, it’s a win-win-win situation. I find myself writing 3.0 code in a 2.0 manner all the time but I’m starting to catch on to the beauty they added in the latest release. And I have even scratched the functional programming surface found in 3.0. It’s all very good stuff. If I ever have to go back to 2.0 or god forbid, 1.1, it will be kicking and screaming and whining.
Eric Lippert entertains us with his trip into “Horrible Customer Service Land” or what I like to call “the people who work at Dish Network.”
Lots of words have been written lately about oil and why it’s trading at $135+ a barrel and what Congress can do about it and blah blah blah. Of late, most of the blabbering has been about speculators and how they drive the cost of oil up artificially. Today, on Capitol Hill, one Michael Masters of Masters Capital Management claimed that if Congress were to find a way to eliminate so-called speculators from the market, oil would be trading at somewhere near its fair value of $65-$70 a barrel within 30 days.
Wouldn’t that be nice? If we just eliminated speculators from the market, we could all afford to drive to work again. Who wouldn’t want to get in on that deal? Those crazy speculators, driving up the price of oil when all I want to do is drive to work without it costing me $60.
The problem with this amazingly easy fix for our gas worries is that’s it is most likely pure, unadulterated bullshit. It’s a fix for a problem that is easy for politicians to get behind in an election year but isn’t likely to solve things in the near or long term and also has unfortunate effect of having no effect on the actual problem that’s causing not only the rise in oil but also the rise in gold and corn and every other commodity right now. That actual problem is that our monetary system is seriously screwed up and that paper money isn’t worth very much.
Tim Iacono has been yelling this for two years now and of course, no one is listening. Look, does anyone out there really think that inflation is currently in check? Think your paycheck goes just as far as it did 12 months ago? Think it makes any sense at all for the government to measure inflation without measuring food or energy these days? Really?
The cause of that inflation is that for the past 5 years, money has been cheap. That’s why we have a housing market catastrophe on our hands. When the world is awash in cheap money, the majority of it being in US Dollars, that money has to go somewhere. When the holders of large numbers of Dollars can’t make money real estate or bonds or the market, that money goes into commodities, including oil.
From Tim’s post linked above, I couldn’t agree more with this statement:
Just once it would be nice to hear someone say to Congress, “There’s just so damn much paper money in the world today, most of it in the form of U.S. Dollars, that people feel they have to do something to protect themselves from its declining value. If the government would be a little more honest about inflation and if you could get a reasonable rate of return on your money elsewhere, then maybe pension funds wouldn’t be so keen on buying oil futures”.
It’s critical to understand that it’s not the people in the market speculating on the price of oil in the next 12 months that are the problem. It’s the fact that the Fed and the US Government have made the US dollar damn near worthless in the world’s eyes through missteps and blunders. That’s the problem.
The next time you fill up and it costs you $60 or $75 or $100, don’t blame speculators. Blame Congress. They are the ones at fault here. Until they can face the hard problems of inflation and the dollar’s continuing decline, commodities including oil will only continue to get more expensive. Eliminating speculators isn’t going to do a damn bit of good and is far more likely to have unintended consequences that are a great deal more painful than $4 a gallon gas. If we allow them to artificially affect the market by eliminating a significant portion of possible investors, the monetary system is only going to get sicker and it isn’t completely implausible that it might get terminal. Fix the core problem, not the symptoms.
Jeff Atwood recently wrote about the new var keyword in c# 3.0 and in essence came to the conclusion that you should use var a lot more than you are so that your code is more concise. Richard Dingwall shows why Jeff has missed the boat on this one. Jeff has written in the past that any time you can remove code you should. His example then was this one:
private string myString = "";
private string myString = String.Empty;
By writing 10 less characters in the first, your code is better. I think he missed the boat there in the exact same way he’s missing it currently.
His new example involves “refactoring” this code:
StringBuilder sb = new StringBuilder(256);
UTF8Encoding e = new UTF8Encoding();
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
into this code:
var sb = new StringBuilder(256);
var e = new UTF8Encoding();
var md5 = new MD5CryptoServiceProvider();
For one thing, that’s not refactoring. It’s not eliminating a code smell, it’s not making the code more readable, all it’s doing is 1) showing you know how to misuse the var keyword and 2) showing you don’t much care about future code readability and by extension, the people who have to maintain said code.
Richard gets it right by pointing out that Jeff is right on one count, that having to declare what type you want twice in c# variable declarations is silly. However, you shouldn’t be taking it upon yourself to “fix” the language by using var everywhere. You go to work with the language you have, not the one you want and all that.
All other things being equal, The Zen of Python had it right with “Explicit is better than implicit.” Using the var keyword everywhere you can is an example of the opposite and certainly doesn’t make your code any cleaner or more explicit.
Yup, I got nothing but cats around here.
And then we have Ms. Miracle proclaiming “If you beoytches won’t feed me all the food I want, I’ll open the damn case myself and climb in to gorge myself at my own damn leisure. Beyotch!”