Dot Net Rocks just released the OSS Panel from DevTeach, I had made some comments there, including the GPL'ed If Loop statement. Listening to it, I sound aweful, I had no idea it was that bad.
It is out, although I have yet to hear the edited version, the real discussion was very interesting.
Go check it out.
Some of the best DotNetRocks episode was with Carl and the host of the moment just goofing around and talking tech, so I had high expectations of this.
I'm not a VB programmer, and it's interesting to see how a VB guy works, and it even includes commentry.
One thing that I don't understand is this construct:
Try
' do something that can throw
Catch
Throw
End Try
Isn't this a no op?
This video reminds me of a Joel On Software article about how hard it is to write a function that copies a file.
There is a lot of commentry on some ancient VB stuff along the way, since Carl often compare the way it was done right now and in VB6 and previous versions.
It is a nice show.
I was listening to DNR #170 and Tim Huckaby (Am I the only one who read tha Huckleberry?).
There was a moment there when Tim said: "Microsoft is never going to ship..." and there was a pause where I thought "WTF?!" and then he continues "another product as bad as Windows ME".
This sentiment goes a round of appluase from the crowd (which include Me and I, incidently). I keep recalling a quote: "No one will remember if you were late, but they will remember if you were bad."
I listened to the rest of the DotNetRocks episode 169 with Rocky Lhotka. This time, I wanted to comment about the part where Rocky talks about ORM. Before everything else, I would like to comment on something he said about Microsoft and O/RM.
He said that most O/RM are using Reflection, and that only Microsoft can solve this issue, because the can modify the CLR to allow direct access to private fields.
I wanted to note that there is already such a thing in .Net 2.0, and it is called LCG (Lightwieght Code Generation), and it basically means that you can inject a method into a class, which will have full access to all the class' members, regardless of visibility (just as any class on the object does). There is a patch for NHibernate that allows it to use this functionality in .Net 2.0, so you don't need to me Microsoft to use this.
I would also like to comment that NHibernte is already avoiding Reflection whenever possible, relying on runtime code generation to read and write to public properties / fields.
I want to address another part of what he said, where he said that O/RM assumes that objects are structure the same way as the database is. Only the simplest O/RM assumes this. One of the important charactaristics of objects is not the data they contain, but what type of object you have, and what relations it has to other objects. A good O/RM will know to map the schema of a database to your object structure without impacting the design of the object.
In fact, I would go as far as to say that this is the criteria of good O/RM.
I was listening yesterday to DotNetRocks episode 169 with Rocky Lhotka, and I was muttering "WTF??!!" throughout the first part of the show.
The issue that I had was Rocky talking about TDD and saying stuff that simply didn't match the reality, not by a long shot. Jeffery Palermo post about it as well, by the way.
Rocky's main objections seem to be:
First, what is the problem. You just created a class, why do you need intelli sense for something that you'll write in a few minutes? Yes, it is convient, but the rate of creating new methods / classes in my code is not high enough that I will forget that I created that class 3 minutes ago and need to think about the interfce I want to give it.
Second, good enough tools like the wonderful ReSharper or VS.Net 2005 (far less powerful) will gladly create classes and method for you on the fly when you refer to something that do not exist. This is not an issue.
Considerring that most of the wizards have to do with UI in the first place, and considerring the big problems in testing UI, I would say that this is a non issue. If I think that I need something that doesn't work directly in the UI, I can't see how the wizards and the tools will help me any. I am aware that other people feels just the opposite.
That said, do you really think that you can trust the code that the wizard generates? Or are you going to run it through it paces a few times, just to make sure it works? If you intend to check it yourself, you need a test for this (or several). You will change this part of the code, and you need it covered. I would also argue that you get far better design and working experiance when working in TDD fashion that you do with all the wizards.
You know what, he is right on this one, which is why you never write a bunch of tests and then try to implement them. You write one test, then you make it work, then you write another test, etc.
This is possible, and it indicate a design problem in the code, fix it. Check out "Working Effectively With Legacy Code" for the details. I can't imagine trying to change something in a large system without tests. How do I know that I didn't break anything?
If he is talking that it is hard to TDD a feature with small increments, than he is right, it takes some work. The end result is worth it since you got a decoupled design you know is working.
I was literally ranting at this point, and this one is really over the top. If I have ever heard a falser statement... TDD is made up of three things: "Red, Green, Refactor". If you don't do all three, you are not doing TDD. What he calls refactoring is not that, it's random code movement through the code, with the prevent wishes of the developer that he isn't breaking anything. Thanks, but "Code and Pray" are not for me.
Yes, it is easy, but you are only running one test that you keep changing, you are not check other parts of the code, can't add it to the build process, etc. In essense, this "test harness" is merely a way to execute the code as it would be on the production system, so you could debug the problems. I would rather not debug at all, and get a nice warm blanket of tests telling me where I am doing wrong.
If you're not familiar with the term, Pwop Ambassadors are geeks that donate bandwidth to distribue the files that Pwop produce using bittorrent. And Pwop is the company that produce shows like:
This means that I spent a couple of hours setting it up, and now whenever I see an annoucement for a new show being released, I can head to my Hard Disk, and voila, it is there already. Talk about immediate gratification.
In return, I'm sharing those files, of course, so this mean that if you are in Israel, you really should try downloading those shows (all of them are excellent, by the way) via BitTorrent, since you've a local source nearby, serving them.
Fact: DotNetRocks makes you a better programmer.
Boo makes you a great programmer.
What happens when you combine them together? The entire dot net rocks archive!
I keep going to the Dot Net Rocks site for more stuff, but because I listen faster than they record (except during the road trip {Hi, when is the next one due :-)}), I've started to dig into their archives. But they are lots of shows, and there doesn't seem to be any torrent for all of the files. After downloading a single show for the tenth time, I decide to put some code into action, instead of clicking on links like an idiot.
Here is the result:
- import System.IO
- import System.Net
- import System.Text.RegularExpressions
- link_url = """http://perseus\.franklins\.net/[\d\w]+\.mp3"""
- for i in range(1,157):
- base_url = "http://www.dotnetrocks.com/default.aspx?showID=${i}"
- print "echo Trying to connect to: ${base_url}"
- using response=WebRequest.Create(base_url).GetResponse():
- match = Regex(link_url).Match(StreamReader(response.GetResponseStream()).ReadToEnd());
- print "wget ${match.Value}"
I really like the way that Boo just stepped out of the way nicely to let me do it.