Re: comparing java & c#



Thomas G. Marshall wrote:
Dale King coughed up:

....[rip]...


Actually they aren't worthless. I think C# would actually be a really
good fit as a replacement for C/C++ in embedded systems, which is
where I work. But nobody seems to be developing C# for embedded
systems. For an embedded system I don't really want the .NET library,
but having a language that is really object oriented with garbage
collection would be a big improvement over C/C++.



True GC is difficult when you have a language with unrestrained pointer arithmetic, of course.


I've been pondering this for over a decade, meself.

Specifically to what you are talking about, I have the following thoughts:

C++'s hugest mistakes:

1. operator overloading

There's lots of debate over operator overloading. I don't use it much, but it really doesn't concern me a lot because it is only syntactic sugar and has no real runtime impact.


The thing I don't understand is that if someone thinks defining operators is a good thing why are they satisfied with the limited set of operators available in C++ with the predefined parsing rules. If you want to define operators, don't you want the ability to define any operator you want?

2. no top level Object
3. templates (which apparently are only there because of #2, AIUI)

C++ hugest shortcomings (to your point):

1. pointer arithmetic (enormous set of changes)
2. no GC
3. hybrid with C (allowing non-OO formalisms to creep in)

{shrug}

These are things that a C#-sans-MS-stuff would fix or bring to the table, and might be loved by the OO/embedded crowd.

That's my point. Java is not a good fit for true embedded stuff. You really want to compile ahead of time and there are things that are inefficient about Java for that space.


C# would actually be a better fit. There are actually many things that are good about C#, but the M$ lock-in out weighs them all.

Unfortunately where I work I can't even get them to move to a limited subset of C++.

--
 Dale King
.



Relevant Pages

  • Re: Coding embedded systems with C
    ... > I heard C is better for programming embedded systems than C++? ... Are you short on ROM/RAM - such as having to fit in to a 64kB address ... Then some C++ features will be unavailable. ... For any given project, examine your constraints. ...
    (comp.lang.c)
  • Re: Shameless Plug
    ... > I will be presenting two topics at the 2005 Embedded Systems Conference ... > on the z-transform as I can fit into 90 minutes. ...
    (sci.electronics.design)