joeware - never stop exploring... :)

Information about joeware mixed with wild and crazy opinions...

C# coding

by @ 4:36 pm on 9/20/2011. Filed under tech

So I had to write another C# program recently for work and my thoughts on C# is that it is growing on me, it reminds me very much of PERL actually. However I wish C# could be compiled directly to native machine code. If it could be compiled directly to native machine code, I would be very close to jumping to it from C++. Perhaps though I am only saying this as I am in the process of switching from C++ Builder to Visual Studio and I haven’t yet ported all of my libraries and utility code which do a lot for me that is done in C#, especially around string handling etc.

Anyway, what did I write? Unfortunately not something I can share on my website as it was for work. It is a command line tool for performing some list functions in MOSS 2007. Specifically it will enumerate the sites on a MOSS Server, then it will enumerate the#160; lists for a given site, then it will list the views of a given list and finally it will retrieve the data for a given list/view to a TAB delimited file.

I used to get that data from a list/view via the XML FEED format of the list web page, however I found a case where MOSS breaks and won’t output *any* information at all based on a certain field type and if you add that field to a view, bam you go from getting data to getting nothing. I had a PERL script that would pull that page and parse the XML and generate the TAB file in less than a minute. The new C# utility takes several minutes. Mostly I think that time is sucked up in the MOSS 2007 Web Services that have to be used to get the data. Thankfully my use of the tool is just to run it once a day to check for updates.

joe

Rating 3.00 out of 5

3 Responses to “C# coding”

  1. Scotte says:

    You’ve mentionted compiling to native code before and I thought the lack of that ability is what kept you on Borland and not VS. Have you found a way to compile C++ in VS to native code?

    I don’t program much, but when I did use VS, I found it annoying that I couldn’t write code that didn’t rely on .Net and the associated large memory footprint.

  2. dreamey says:

    Will using NGen be close enough to what you need?

  3. joe says:

    dreamey: NGen is machine specific, I couldn’t, for example, compile with NGen and then distribute the compiled version.

    Scotte: Visual Studio still won’t do RAD dev with compilation to native code… I.E. The Service Wizard or GUI Wizards are all .NET based. However I can do basic console apps that are compiled to native. I finally decided that it was more important for me to have x64 compilation available versus ability to generate native GUI or Service apps which I haven’t released to the public anyway.

[joeware – never stop exploring… :) is proudly powered by WordPress.]