ANN: xsdbXML release with C#/.NET port, with C# question...

  • Thread starter aaronwmail-usenet
  • Start date
A

aaronwmail-usenet

ANN: xsdbXML release with C#/.NET port

Part I: Announcement
====================
There is a new release of xsdbXML which provides
bugfixes to the Python implementation and also
provides a completely separate implementation in C#/.NET.

The xsdb framework provides a flexible and well defined
infrastructure to allow tabular data to be published,
retrieved, and combined over the Internet.

Read more and download at
http://xsdb.sourceforge.net

Part II: C# Question
====================

In Arithmetic.cs I built my own simple arithmetic
expression parser.

http://cvs.sourceforge.net/viewcvs....s/xsdbXMLcs/Arithmetic.cs?rev=1.1&view=markup

I would have preferred to use a parser library of some
sort, but it would have to actually make it simpler to
define the parser (I've noticed that some libraries
actually make it harder to do relatively simple things
like this).

Q: Should I use an available library to make maintenance
and enhancement easier?

Part III: Discussion
===================
The C# implementation is primarily a transliteration
of the Python implementation. I hope to also do a java
transliteration of the C# code. Some brief observations:

- Development:
Using python for the first implementation was the
right way to go because it made it easier to backtrack
and refactor the implementation. If I had tried this
in C# backtracking would have been much more painful.
Testing Python code, especially during development, is also
much easier in part because you can write
{"a": [1,2,3], "b": MyClass("argument")}
in a few keystrokes whereas a C# analogue runs to many
lines.
Interestingly, however, the C# port exposed several
nasty bugs in untested code paths of the python
implementation (incorrect calling sequences) because of C#
static typing, even before the C# code was running or
even compiling.
For the most part the transliteration was
straightforward, except where the python implementation
leans on the python expression parser (the parser had
to be "hand rolled" in C#).

- Libraries:

The python http services are more "bare bones" than the
..NET libraries and this is a *GOOD* *THING* (tm). The
..NET libraries seem to do all kinds of nice things under
the surface where I can't influence their behavior (even
in principal because of the type system information hiding).
The python implementation pretty much allows me to
modify any part of the implementation, and the default does
as little as possible. My reservations about the C# http
services didn't actually cause problems in this case, but
it made me nervous.

On the other hand it's nice in C# to not have to guess about
which XML library to use. As any python programmer can
attest it is not fun trying to decide which of several
implementations is the best and will stay alive, etcetera.
I just arbitrarily chose the one I knew already, but I
really should switch to something else, dunno what.
In C# there is only one choice.

- Environment

What can I say. VS/.NET is really nice and there is
nothing close in Python AFAIK.

- Conclusion

Don't have any. I'm just making comments :).

Thanks for your attention -- Aaron Watters

===
% if I had a ( for every $ bush spent how many ('s would I have?
too many ('s
 
N

Nicholas Paldino [.NET/C# MVP]

Just a note, you should probably have separated this into two (or maybe
even three) posts, as the question part is easy to lose in the post.

As for the answer, usually, using a third party library is easier, as it
(typically) relieves you from the burden of having to code and maintain it
yourself. Of course, the library has to be flexible enough to accomidate
your needs as they grow, or offer ways for you to provide the missing
functionality yourself. Other than that, I would say for that specific kind
of task, look for a third party library.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

ANN: xsdbXML release with C#/.NET port

Part I: Announcement
====================
There is a new release of xsdbXML which provides
bugfixes to the Python implementation and also
provides a completely separate implementation in C#/.NET.

The xsdb framework provides a flexible and well defined
infrastructure to allow tabular data to be published,
retrieved, and combined over the Internet.

Read more and download at
http://xsdb.sourceforge.net

Part II: C# Question
====================

In Arithmetic.cs I built my own simple arithmetic
expression parser.

http://cvs.sourceforge.net/viewcvs....s/xsdbXMLcs/Arithmetic.cs?rev=1.1&view=markup

I would have preferred to use a parser library of some
sort, but it would have to actually make it simpler to
define the parser (I've noticed that some libraries
actually make it harder to do relatively simple things
like this).

Q: Should I use an available library to make maintenance
and enhancement easier?

Part III: Discussion
===================
The C# implementation is primarily a transliteration
of the Python implementation. I hope to also do a java
transliteration of the C# code. Some brief observations:

- Development:
Using python for the first implementation was the
right way to go because it made it easier to backtrack
and refactor the implementation. If I had tried this
in C# backtracking would have been much more painful.
Testing Python code, especially during development, is also
much easier in part because you can write
{"a": [1,2,3], "b": MyClass("argument")}
in a few keystrokes whereas a C# analogue runs to many
lines.
Interestingly, however, the C# port exposed several
nasty bugs in untested code paths of the python
implementation (incorrect calling sequences) because of C#
static typing, even before the C# code was running or
even compiling.
For the most part the transliteration was
straightforward, except where the python implementation
leans on the python expression parser (the parser had
to be "hand rolled" in C#).

- Libraries:

The python http services are more "bare bones" than the
.NET libraries and this is a *GOOD* *THING* (tm). The
.NET libraries seem to do all kinds of nice things under
the surface where I can't influence their behavior (even
in principal because of the type system information hiding).
The python implementation pretty much allows me to
modify any part of the implementation, and the default does
as little as possible. My reservations about the C# http
services didn't actually cause problems in this case, but
it made me nervous.

On the other hand it's nice in C# to not have to guess about
which XML library to use. As any python programmer can
attest it is not fun trying to decide which of several
implementations is the best and will stay alive, etcetera.
I just arbitrarily chose the one I knew already, but I
really should switch to something else, dunno what.
In C# there is only one choice.

- Environment

What can I say. VS/.NET is really nice and there is
nothing close in Python AFAIK.

- Conclusion

Don't have any. I'm just making comments :).

Thanks for your attention -- Aaron Watters

===
% if I had a ( for every $ bush spent how many ('s would I have?
too many ('s
 
A

aaronwmail-usenet

regarding http://xsdb.sourceforge.net C# port expression parser
component.
Nicholas said:
I would say for that specific kind
of task, look for a third party library.

Yes I agree. I guess I should have specifically asked for
recommendations
of specific libraries. Do you have any? Thanks!
-- Aaron Watters

===
Except for the randing it was a terrific fright.
-- pilot who undershot SFO, landing in the bay.
 
J

James Curran

Yes I agree. I guess I should have specifically asked for
recommendations
of specific libraries. Do you have any? Thanks!

Try Steve Hebert's .Math Library:
http://codebetter.com/blogs/steve.hebert/category/99.aspx

Except for the randing it was a terrific fright.
-- pilot who undershot SFO, landing in the bay.

Is that correct as written ? It seems to have two typos -- one of which
could been a pun, but the other doesn't seem to make any sense....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top