For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2008 > OT Java, C#, C++









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author OT Java, C#, C++
William M. Klein

2008-01-11, 6:56 pm

Although still off-topic, I was just wondering, ...

In the threads on Java, it seems to me that some of those embracing OO are
moving from Java to C# (not C++).

I know that the CLI run-time (I think that is what is still called outside
Microsoft) is available on other platforms, but I was wondering how "portable"
those using C# is in practice.

Are those using C# mostly doing Windows applications?

If you wanted to do OO for a "portable to where CLI isn't" environment, would
you use Java or C++ - or something else (and why)?

Just curious.

--
Bill Klein
wmklein <at> ix.netcom.com


Pete Dashwood

2008-01-11, 6:56 pm



"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:I%Phj.255354$He.247582@fe08.news.easynews.com...
> Although still off-topic, I was just wondering, ...
>
> In the threads on Java, it seems to me that some of those embracing OO are
> moving from Java to C# (not C++).
>
> I know that the CLI run-time (I think that is what is still called outside
> Microsoft) is available on other platforms, but I was wondering how
> "portable" those using C# is in practice.
>
> Are those using C# mostly doing Windows applications?


Speaking for myself, "Yes". (Its where the market is...)
>
> If you wanted to do OO for a "portable to where CLI isn't" environment,
> would you use Java or C++ - or something else (and why)?


Possibly Java, but more likely C#. It has arguably better facilities than
Java (although this is subjective; both languages are excellent), but I
specifically like certain features of C# (better IDE and Debugging, FOREACH
for iterating over collections... SO easy, and very easy-to-write event
handlers. Mainly, I like the succinct, easy-to-read code and the fact that
everything is typed. Stuff (even complex machine oriented stuff) just
works...

If the User had Java already, and/or expressed a preference for NO C#, then
I'd use Java.
>
> Just curious.
>


Based on a sample of one :-) written totally as an experiment, but a real
application...:

1. C# developed on a Windows platform and NOT using unmanaged code
(specifically, InterOp Services) or platform-specific Classes, runs
perfectly on any Windows platform running the appropriate version of DotNET.

2. The SAME C# Assembly runs correctly on a machine running Mono/Linux,
WITHOUT recompile or reconfiguring.

C# is accelerating in popularity for a number of reasons, and cross-platform
capability is just one aspect of it.

I only wish I had got into it sooner; I could have saved myself a lot of
aggravation with OO COBOL.

Pete.
--
"I used to write COBOL...now I can do anything."


LX-i

2008-01-11, 9:56 pm

William M. Klein wrote:
> Although still off-topic, I was just wondering, ...
>
> In the threads on Java, it seems to me that some of those embracing OO are
> moving from Java to C# (not C++).


But of course! :) (heh - I say that, but in my current job, we're 100%
Java. I had to write a batch job to run on a Windows server, so I wrote
it in J#.)

> I know that the CLI run-time (I think that is what is still called outside
> Microsoft) is available on other platforms, but I was wondering how "portable"
> those using C# is in practice.


I have tried to do some development on Linux (a web application), but I
couldn't get it to work. Granted, this was a while back, and I haven't
tried it since. I believe that Pete has someone using one of his
assemblies (that's the name for a .NET package) under Mono, the .NET
runtime for *nix.

> If you wanted to do OO for a "portable to where CLI isn't" environment, would
> you use Java or C++ - or something else (and why)?


I'd use Java. It handles memory management itself, and the JVM converts
types that aren't supported natively. Oh yeah, one other reason - NO
POINTERS! :) In my experience, C++ isn't portable; and, I've never
read anything that claimed that it was.

I've mentioned before, I've really been impressed with PHP, especially
with the enhancements in version 5. It's fast! And, anything I do
outside work is oriented to the web. It doesn't have to be installed,
it can be accessed globally, and everyone pretty much already has a
client. And, portability then becomes moot as well - you can serve from
whatever OS to whatever OS, and they all play nicely.

(Of course, economics comes into play here too. My web host charges an
extra $2/mo for Java support, and an extra $3/mo for .NET support (but
only on Windows accounts, which mine is not). PHP is free. I asked
them about Mono on Linux, and they said that they didn't even offer it
because when they tested it, they couldn't support more than a few sites
on the equivalent hardware without it really bogging down. So, I pay my
$6.95/mo, and use PHP.)

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \/ _ o ~ Live from Albuquerque, NM! ~
~ _ /\ | ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business E-mail ~ daniel @ "Business Website" below ~
~ Business Website ~ http://www.djs-consulting.com ~
~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~
~ Personal E-mail ~ "Personal Blog" as e-mail address ~
~ Personal Blog ~ http://daniel.summershome.org ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

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
LX-i

2008-01-11, 9:56 pm

Pete Dashwood wrote:
>, but I
> specifically like certain features of C# (better IDE and Debugging, FOREACH
> for iterating over collections... SO easy,


You know that the latter is pretty easy in Java too, right? :)

for (SomeObject oObj : oObjCollection) {
// do something with the object
}

or

Iterator<ObjectType> iterObj = ObjectType.Iterator();

while (iterObj.hasNext()) {
ObjectType oObj = iterObj.next();
// do something with the object
}

Of course, the "for" is much less code.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ / \/ _ o ~ Live from Albuquerque, NM! ~
~ _ /\ | ~ ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Business E-mail ~ daniel @ "Business Website" below ~
~ Business Website ~ http://www.djs-consulting.com ~
~ Tech Blog ~ http://www.djs-consulting.com/linux/blog ~
~ Personal E-mail ~ "Personal Blog" as e-mail address ~
~ Personal Blog ~ http://daniel.summershome.org ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~

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
Charles Hottel

2008-01-11, 9:56 pm


"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:5uqebmF1j2oi5U1@mid.individual.net...
>
>
> "William M. Klein" <wmklein@nospam.netcom.com> wrote in message
> news:I%Phj.255354$He.247582@fe08.news.easynews.com...
>
> Speaking for myself, "Yes". (Its where the market is...)
>
> Possibly Java, but more likely C#. It has arguably better facilities than
> Java (although this is subjective; both languages are excellent), but I
> specifically like certain features of C# (better IDE and Debugging,
> FOREACH for iterating over collections... SO easy, and very easy-to-write
> event handlers. Mainly, I like the succinct, easy-to-read code and the
> fact that everything is typed. Stuff (even complex machine oriented stuff)
> just works...
>
> If the User had Java already, and/or expressed a preference for NO C#,
> then I'd use Java.
>
> Based on a sample of one :-) written totally as an experiment, but a real
> application...:
>
> 1. C# developed on a Windows platform and NOT using unmanaged code
> (specifically, InterOp Services) or platform-specific Classes, runs
> perfectly on any Windows platform running the appropriate version of
> DotNET.
>
> 2. The SAME C# Assembly runs correctly on a machine running Mono/Linux,
> WITHOUT recompile or reconfiguring.
>
> C# is accelerating in popularity for a number of reasons, and
> cross-platform capability is just one aspect of it.
>
> I only wish I had got into it sooner; I could have saved myself a lot of
> aggravation with OO COBOL.
>
> Pete.
> --
> "I used to write COBOL...now I can do anything."
>
>


Java has a similar idion for iterating over collections. I think it came
with version 5.


Pete Dashwood

2008-01-13, 7:55 am



"LX-i" <lxi0007@netscape.net> wrote in message
news:U8idnbEUQcjsvhXanZ2dnUVZ_q2hnZ2d@co
mcast.com...
> Pete Dashwood wrote:
>
> You know that the latter is pretty easy in Java too, right? :)
>

Yes :-)

But C# FOREACH has more elegance...

(You CAN use the same "iterator" (enumerator) approach in C#, but I still
prefer FOREACH.)

Pete.
--
"I used to write COBOL...now I can do anything."


Judson McClendon

2008-01-13, 6:56 pm

"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote:
> "LX-i" <lxi0007@netscape.net> wrote:
>
> Yes :-)
>
> But C# FOREACH has more elegance...
>
> (You CAN use the same "iterator" (enumerator) approach in C#, but I still prefer FOREACH.)


Do you see some difference between FOR EACH as implemented in C#
vs. VB?
--
Judson McClendon judmc@sunvaley0.com (remove zero)
Sun Valley Systems http://sunvaley.com
"For God so loved the world that He gave His only begotten Son, that
whoever believes in Him should not perish but have everlasting life."


Pete Dashwood

2008-01-13, 6:56 pm



"Judson McClendon" <judmc@sunvaley0.com> wrote in message
news:oUqij.51733$_m.37436@bignews4.bellsouth.net...
> "Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote:
>
> Do you see some difference between FOR EACH as implemented in C#
> vs. VB?


I think Anders probably realized that VB's "for each" is a very useful
construct and included it in C# as a kind of high level "collection
processor".

To answer your question, no, I see very little difference, but I'm not
expert with VB. Certainly in C# automatic enumeration happens under the
covers (as it probably does with VB). I like the syntax in C#.:-)

Pete.
--
"I used to write COBOL...now I can do anything."


Richard

2008-01-13, 6:56 pm

On Jan 12, 1:01 pm, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:
> "William M. Klein" <wmkl...@nospam.netcom.com> wrote in messagenews:I%Phj.255354$He.247582@fe08.news.easynews.com...
>
>
>
>
>
> Speaking for myself, "Yes". (Its where the market is...)
>
>
>
>
> Possibly Java, but more likely C#. It has arguably better facilities than
> Java (although this is subjective; both languages are excellent), but I
> specifically like certain features of C# (better IDE and Debugging, FOREACH
> for iterating over collections... SO easy, and very easy-to-write event
> handlers. Mainly, I like the succinct, easy-to-read code and the fact that
> everything is typed. Stuff (even complex machine oriented stuff) just
> works...
>
> If the User had Java already, and/or expressed a preference for NO C#, then
> I'd use Java.
>
>
>
>
> Based on a sample of one :-) written totally as an experiment, but a real
> application...:
>
> 1. C# developed on a Windows platform and NOT using unmanaged code
> (specifically, InterOp Services) or platform-specific Classes, runs
> perfectly on any Windows platform running the appropriate version of DotNET.
>
> 2. The SAME C# Assembly runs correctly on a machine running Mono/Linux,
> WITHOUT recompile or reconfiguring.


While it is possible to write C# programs that will run identically on
both, it is also possible to write perfectly good programs which are
locked to 'Windows only'.

Partly this is because Mono will always be behind the latest Windows
stuff, but also because Mono doesn't/can't use the Windows API as can
be done.

If, however, one used the GTK+ windowing subsystem then it will run on
both.

> C# is accelerating in popularity for a number of reasons, and cross-platform
> capability is just one aspect of it.


When MS implemented their Java as J++ they added 'Windows Only' stuff
into it and failed to indicate that this was not cross-platform in the
expectation that they could have it both ways: alleged 'cross-
platform' _and_ Windows Only lockin.

Mono is supplying that for MS. In theory cross-platform, in practice
Windows only (unless special care is taken).

> I only wish I had got into it sooner; I could have saved myself a lot of
> aggravation with OO COBOL.
>
> Pete.
> --
> "I used to write COBOL...now I can do anything."


Pete Dashwood

2008-01-14, 6:56 pm



"Richard" <riplin@azonic.co.nz> wrote in message
news:c870ef8d-4cd4-4f97-a757-fa706a81aaa4@l32g2000hse.googlegroups.com...
> On Jan 12, 1:01 pm, "Pete Dashwood"
> <dashw...@removethis.enternet.co.nz> wrote:
>
> While it is possible to write C# programs that will run identically on
> both, it is also possible to write perfectly good programs which are
> locked to 'Windows only'.
>
> Partly this is because Mono will always be behind the latest Windows
> stuff, but also because Mono doesn't/can't use the Windows API as can
> be done.
>
> If, however, one used the GTK+ windowing subsystem then it will run on
> both.
>
>
> When MS implemented their Java as J++ they added 'Windows Only' stuff
> into it and failed to indicate that this was not cross-platform in the
> expectation that they could have it both ways: alleged 'cross-
> platform' _and_ Windows Only lockin.
>
> Mono is supplying that for MS. In theory cross-platform, in practice
> Windows only (unless special care is taken).
>
>


I really don't know enough about Mono to argue this, Richard, and I accept
what you say.

It seems a pity.

Not familiar with GTK+ either. How could I access this from a Windows
environment in C# (thought I might give it a try...)?

Pete.
--
"I used to write COBOL...now I can do anything."


Richard

2008-01-14, 6:56 pm

On Jan 15, 9:58 am, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:
> "Richard" <rip...@azonic.co.nz> wrote in message
>
> news:c870ef8d-4cd4-4f97-a757-fa706a81aaa4@l32g2000hse.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I really don't know enough about Mono to argue this, Richard, and I accept
> what you say.
>
> It seems a pity.
>
> Not familiar with GTK+ either. How could I access this from a Windows
> environment in C# (thought I might give it a try...)?


http://www.mono-project.com/GtkSharp

I notice that it also supports the Glade interface designer. I use
Glade for python programs.


Richard

2008-01-14, 6:56 pm

On Jan 15, 9:58 am, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:
> "Richard" <rip...@azonic.co.nz> wrote in message
>
> news:c870ef8d-4cd4-4f97-a757-fa706a81aaa4@l32g2000hse.googlegroups.com...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I really don't know enough about Mono to argue this, Richard, and I accept
> what you say.


> It seems a pity.


"""Support for Winforms 1.1 has been completed and was released in
Mono 1.2. It is now in a maintenance/bug fixing state. Support for
Winforms 2.0 is currently under development."""

"""some applications (and especially third party controls)
occasionally bypass the API and P/Invoke straight to the Win32 API.
These calls will likely have to changed to work on Mono."""



> Not familiar with GTK+ either. How could I access this from a Windows
> environment in C# (thought I might give it a try...)?
>
> Pete.
> --
> "I used to write COBOL...now I can do anything."


Pete Dashwood

2008-01-14, 6:56 pm



"Richard" <riplin@azonic.co.nz> wrote in message
news:83d2deaa-8d27-48d2-987e-ff53596b79f2@e6g2000prf.googlegroups.com...
> On Jan 15, 9:58 am, "Pete Dashwood"
> <dashw...@removethis.enternet.co.nz> wrote:
>
>
> """Support for Winforms 1.1 has been completed and was released in
> Mono 1.2. It is now in a maintenance/bug fixing state. Support for
> Winforms 2.0 is currently under development."""
>
> """some applications (and especially third party controls)
> occasionally bypass the API and P/Invoke straight to the Win32 API.
> These calls will likely have to changed to work on Mono."""
>


I decided some time ago NOT to use P/Invoke unless there was an absolutely
compelling reason (so far I haven't found one...)
[color=darkred]
>
>

Thanks for the link. I'll check it out and have a dabble as soon as I clear
the current workload.

Pete.
--
"I used to write COBOL...now I can do anything."



Howard Brazee

2008-01-15, 6:56 pm

There are other programming technologies that I'd like to see
emphasized more - for instance table driven programming has the
potential to be very useful as we separate data from logic from
display.

Is there an OO APL available?
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com