The Inquisitive Coder - Davy Brion’s Blog

Trying to walk that thin line between intelligence and ignorance

Archive for December, 2007

Tech Blogs: The good, the bad and the ugly

Posted by Davy Brion on 21st December 2007

A coworker of mine just started blogging and in his first post he said something that made me think:

And I must admit, the thought of showing of my knowledge to the world through the same means - a blog - has crossed my mind more than once.

And that probably captures the motivation behind the majority of all tech related blogs: showing off our knowledge. Showing people how smart and great we all are. Who doesn’t like to come off smart to his/her peers? Of course, most of us will tell you that we’re only interested in sharing or spreading knowledge. And there’s definitely a lot of truth to that. But don’t let us fool you… it surely isn’t the only reason we’re blogging about our technical adventures. The other reason is simply Intellectual Vanity. We think we have interesting stuff to say, or interesting content to share, so we do it. And we hope people like it and learn from it. And i’ll bet most of us hope people will think we’re good at what we do because of it. It makes us feel good when people say “i liked that stuff you wrote on subject X” or “those examples really helped me out, thx!”.

To me, there’s nothing wrong with that. A lot of great stuff is being produced and shared because of this and a lot of people are learning from it. That’s always a good thing. Some people take it too far though. There are some tech bloggers that don’t really produce anything meaningful or original. Some of them are just recycling material from other bloggers or are just rephrasing press announcements from large software vendors they have an affinity for. Some of them are just praising whatever new technology comes out without actually giving it a critical look. Don’t get me wrong, we don’t need to critize everything new that comes out but we should be honest about those new technologies. So why do these people even have a blog? Probably the same Intellectual Vanity that drives the good blogs and the meaningful content. Some people are only doing it for the name recognition i suppose…

A certain developer who used to work on a large project where i worked is a good example of this. He was pretty much worthless as a developer, yet from reading his blog you could get the impression that he’s an expert at what he does. Yes, he’s involved in the ‘community’ and is no doubt working hard on his career. He easily impresses people with simple demos of new technology and is making a good name for himself with the kind of people who are easily impressed by fancy ‘hello world’ applications. But he has about a snowball’s chance in hell to become a productive member of a real development team in ‘real-life’ projects. These are the kind of people who really shouldn’t be blogging about technical stuff.

So what kind of blog posts do i like? The ones that are original. The ones that take a complex or relatively unknown subject and make it clear to those of us who didn’t know about said subject before. The ones that provide workarounds for obscure bugs we eventually all run into. The ones that offer good advice on how to solve problems we all face. The ones that discuss what doesn’t work. The ones that discuss what does work. The ones that show us how to do something. I could go on for a while but i think it’s best to summarize it as follows: the ones that provide valuable information for us to learn. There are a lot of great tech blogs out there that are filled with this stuff. I often have a hard time just to keep up with all the great stuff that gets posted.

So you’re probably wondering why i’m posting this. After all, it doesn’t really fit into any of the categories i just mentioned. Well except that technically it is ‘original’ since i just wrote this stuff… Anyways, these are just some thoughts about tech blogs that i wanted to share. Maybe some people feel the same way about it :)

Share/Save/Bookmark

Posted in Off Topic, Rants | 5 Comments »

Entity Framework and Oracle?

Posted by Davy Brion on 20th December 2007

David Sceppa posted a list of companies/organisations that plan to release providers for Entity Framework within 3 months of the final release… Notice how Oracle isn’t on that list? Apparantly there are 2 other companies that will be providing connectivity to Oracle databases, but i do find it kinda weird that Oracle doesn’t seem to support this…

Share/Save/Bookmark

Tags: ,
Posted in Entity Framework | 5 Comments »

List of recommended books

Posted by Davy Brion on 16th December 2007

I used to have a list of recommended books on my site but since i hardly use that anymore, i’m moving most of the content here. You can find the list here or click on ‘Recommended Books’ in the Navigation entry on the right. I’ll keep that list updated when i have new books to recommend :)

Share/Save/Bookmark

Posted in About The Blog, Books | No Comments »

YANSU

Posted by Davy Brion on 12th December 2007

That’s right, Yet Another Noma Status Update… anyway, there’s finally some progress to report. The hibernate mapping parsing is finally done so i can now start working on the rules engine.

At the moment, this is what I have in mind: each rule would have to implement a very simple interface which will probably only have 2 methods… the first would allow the rule to register which kind of ClassMappings it’s interested in, the other would actually execute the rule on each of the selected ClassMappings.

For instance, if you’d like to write a rule that has to be checked on each class that has one or more many-to-one mappings, you would be able to ‘register’ the data you want to check with something like: return AvailableClassMappings.Where(c => c.ManyToOneMappings.Count > 0);

The other method of your rule would then be called for each of the ClassMappings your rule has registered. Would be pretty simple and easy i think.

Anyways, the goal is to get an alpha release out the door somewhere in January.

Share/Save/Bookmark

Tags: ,
Posted in Uncategorized | No Comments »

Hmmm, lambdas…

Posted by Davy Brion on 9th December 2007

The Assembly class has a GetManifestResourceNames method which returns an array containing the full resource names of each embedded resource in the assembly. I need to retrieve the full resource name, even though i only have the last part of the resource name. Back in the old days, we’d probably write a boring loop to retrieve the correct full name, or use an anonymous delegate to do it. In both cases, it’s too much code to write for such a simple task.

Fortunately we can use lambda expressions with .NET 3.5 so all i had to was this:

        private XDocument GetDocumentFromEmbeddedResources(string shortResourceName)

        {

            Assembly thisAssembly = Assembly.GetExecutingAssembly();

            string fullResourceName = thisAssembly.GetManifestResourceNames()

                .First(n => n.EndsWith(shortResourceName));

            return XDocument.Load(XmlReader.Create(thisAssembly.GetManifestResourceStream(fullResourceName)));

        }

i’m gonna be using these _a lot_ :D

Share/Save/Bookmark

Posted in Software Development | 1 Comment »

using a default xml namespace with the XElement class

Posted by Davy Brion on 2nd December 2007

I just upgraded all of the xml parsing code in Noma to use the new classes in the System.Xml.Linq namespace, which btw are MUCH easier to use than the old-school XmlDocument/XmlElement/… set of classes. Anyway, i have a lot of tests that create xml elements in memory so the parsing can be tested on them. Now, all of those elements should of course use the correct xml namespace.

With the new XElement class, this is already much easier to do than it was with the XmlElement class. But, if you’re creating a hell of a lot of XElement instances that all need to use the same namespace, you can very easily extend the XElement class to set the correct namespace by default:

    public class NXElement : XElement

    {

        public NXElement(string name, params object[] objects)

            : base(Constants.XmlNamespace + name, objects) {}

 

        public NXElement(string name, object parameter)

            : base(Constants.XmlNamespace + name, parameter) {}

 

        public NXElement(string name)

            : base(Constants.XmlNamespace + name) {}

    }

And now i can create nested XML elements that use the correct namespace just like this:

            XElement element = new NXElement(Elements.List,

                                            new NXElement(Elements.OneToMany,

                                                           new XAttribute(Attributes.Class, “ClassName”)));

Share/Save/Bookmark

Tags: , ,
Posted in Uncategorized | No Comments »