Re: [OT] Of Java and C#



Hi Daniel,

not sure if this is the Rogers Cadenhead book I recommended or not.. I
thought it was Java 2 in 24 hours... Whether it is or not, very pleased to
see you have found something that was of use and shared it with the group.

Didn't realise you were getting into C#. I am deep into it now and will
deliver my first commercial application next week. ( I stress that this is
"hobby" commerce and I won't be getting a real job again until April when
the Summer here is over...:-)) At last the weather is improving (we've had a
very wet summer) and it will be good to get out of the house and away from
programming for a while.

The new application is concerned with NZ Postal Address Validation (it
sounds trivial, but actually it is very complex... :-)) and uses a major
legacy COM component I wrote in OO COBOL some time ago. I used the Interop
classes to connect the managed and unmanaged code, and at one point I
thought it was never going to work :-). I had some major problems and have
documented them and the solutions on the MicroSoft C# forum, where everyone
was bewildered to imagine that COBOL would be used with C# :-). It is a
tribute to the claimed interoperability of C# that everything functioned
exactly as it was supposed to (once I got it right :-)) and COBOL plays
nicely with the managed code just like any other language. You don't even
need to get OO COBOL for DotNET; existing legacy COBOL can be wrapped into
this environment VERY easily. (Obviously, if you use a DotNET compiler your
code will be MSIL and so will be "managed" as opposed to "unmanaged", but I
don't see this as warrranting the cost of a DotNET compiler. C# is every bit
as good as COBOL for development (better, in many areas) so nothing is to be
gained by perpetuating COBOL development on the PC platform. The one thing
that would give me pause, would be having to write off all my existing COBOL
investment. I am now completely satisfied that I don't have to, so I'm
afraid Fujitsu are on their own as far as I'm concerned... :-).

[How different a story this might have been, if someone had bothered to
contact me when I wanted to purchase DotNET COBOL and had several thousand
US Dollars in my hot little hand, allocated for that purpose. Obviously,
they are doing so well they don't need to pursue custom, but if I was
running that company, someone would be doing some explaining... Never mind.
Water under the bridge, and if I hadn't been pushed, I wouldn't have found
the joys of C#. Most of us tend to stay with what we know until it becomes
untenable. I have learned something from all of this].

MicroSoft, although much maligned :-), have invested huge money in creating
the DotNET framework and ensuring interoperability. This is a major advance
for application developers and MS deserve credit for it. (I still can't
believe they make this, and the IDE, available for FREE...:-))

Now that it is working, I have to say I am very impressed with C#.

For example, I wanted the errors from a batch process to be written to an
Excel spread***, so that someone could go through them and apply manual
fixes, update the status of the error on the spread*** and add any
comments for others. Under Office 2007, Excel spreadsheets are easily
shareable on the network, so this means that several people could be working
correcting errors from the same error reporting spread***. The error
spread*** had to be created on the fly and updated with error information
as the errors were detected, and this had to happen from within the same C#
process that was interfacing to unmanaged code.

Creating and updating the error spread*** was a 30 minute job, and that
included finding out how to do it!

I was blown away by the simplicity of it, having tried similar exercises in
OO COBOL using COM Automation. (They worked, but it took days...) (The C#
solution is also using COM Automation, but all the hard work is encapsulated
into classes under the covers that do everything for you and you don't even
have to be aware of them...)

From now on, the error logs from all my applications will be purely for
system problems and the "Error Reports" will be Excel spreadsheets...

I am becoming more and more convinced that the difference in productivity
between COBOL and C# is largely down to the IDE and the vast amount of
information that is at your fingertips when using C#. I found any number of
articles, including sample code, when I searched on accessing Excel from C#.
And it is SO good to get sample code that is actually in the language you
are using, rather than having to translate VB into COBOL :-) Having said
that, I also like the simple elegance of C#. It is a very good compromise
between Java and C++ in my opinion.

Daniel, I'm really glad you found VS 2005 to be what I said it was. Thanks
for endorsing my comments.

It rocks!

Pete.



"LX-i" <lxi0007@xxxxxxxxxxxx> wrote in message
news:c60ae$45bb58f6$454920f8$17651@xxxxxxxxxxxxxx
I've got to say, to those of you who recommended _Sams Teach Yourself Java
2 in 21 Days_ as a Java learning tool - that book is excellent! I've
completed the first 7 days, and OO is finally "clicking" in my mind.
Thanks for the great recommendation.

In conjunction with that, I've also written my first C# class, which we
(will, starting next week) use with our COBOL configuration management
system to create program/proc (copybook), program/call, and program/reject
cross-references. (I'll share it if anyone is interested - it's also
going to update a program/database item xref when it's completely done,
but that code is a bit more complex than the other 3.) I'm very happy with
the way it worked, although I was bitten by a couple of things that are
different than Java.

I agree with Pete Dashwood's assertion that the IDE makes development a
piece of cake. I started writing this class on Wednesday, and had it
completely debugged by Friday at noon!


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"Who is more irrational? A man who believes in a God he doesn't see, or a
man who's offended by a God he doesn't believe in?" - Brad Stine


.


Quantcast