Advertisement

C# for Linux?

Started by January 12, 2003 04:02 PM
26 comments, last by stefu 21 years, 9 months ago
quote: Original post by stefu
I think C++ is best for game programming currently, but I hate using delete!! Using delete and doing all kind of that low level stuff is simply waste of programming time.

Hmm. There are situations in which explicit control of memory allocation is a massive boon to program performance. In any case, mechanisms exist in C++ that eliminate the need for delete yet still provide control over when deallocation occurs (smart/shared pointers) as well as mechanisms that provide actual garbage collection in C++ (come on, it''s not that hard).

quote: So C# sounds ideal. It''s so similar to C++ (what I know) and has garbage collection and can be compiled to executable.

IMO, C# is far from ideal. For one thing, all the features you mention are features of .NET, meaning any .NET-supported language (COBOL, FORTRAN, Python, VB, Managed C++ etc) inherits them. For another, C#''s syntax, structure and development cycle are so similar to C++ or Java that you won''t see as massive a difference as you seem to expect. I''m really more interested in the multi-language aspects of .NET, combining, say, FORTRAN.NET''s robust math features with Python.NET''s expressiveness (or imagine LISP.NET! *drool*).

quote: Why can''t I compile files without public static void Main()?

It''s a flaw in the Everything Is An Object philosophy of staunch OO languages like Java and C#. There was an interesting and looong article/thread on the subject over at Flipcode a while ago.
quote: Original post by Oluseyi
Hmm. There are situations in which explicit control of memory allocation is a massive boon to program performance. In any case, mechanisms exist in C++ that eliminate the need for delete yet still provide control over when deallocation occurs (smart/shared pointers) as well as mechanisms that provide actual garbage collection in C++ (come on, it''s not that hard).

I tend to go in problems with delete every time (where to delete). But that''s maybe a question of design. I''v tried smart pointers, but there''s always rules how to use and where they don''t work (STL containers?)

quote:
IMO, C# is far from ideal.

I agree now. It''s nice to try new things to learn and find out how they are. Now that I know a little more about C# it doesn''t feel that cool anymore.

There''s no ideal game programming language, just like ideal gas does not exist. It''s just theory
Advertisement
quote: Original post by Oluseyi
Why can''t I compile files without public static void Main()?

quote:
It''s a flaw in the Everything Is An Object philosophy of staunch OO languages like Java and C#. There was an interesting and looong article/thread on the subject over at Flipcode a while ago.

It is nothing of the sort. Try compiling a C++ .exe without defining main().

See my previous post.


"The fact that a believer is happier than a skeptic is no more to the point than the fact that a drunken man is happier than a sober one." – George Bernhard Shaw
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by Oluseyi
(or imagine LISP.NET! *drool*)

Here''s a Scheme compiler, anyway: http://rover.cs.nwu.edu/~scheme/


"The fact that a believer is happier than a skeptic is no more to the point than the fact that a drunken man is happier than a sober one." -- George Bernhard Shaw
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by Oluseyi
Why can''t I compile files without public static void Main()?

It''s a flaw in the Everything Is An Object philosophy of staunch OO languages like Java and C#. There was an interesting and looong article/thread on the subject over at Flipcode a while ago.

quote: Original post by Arild Fines
It is nothing of the sort. Try compiling a C++ .exe without defining main().

See my previous post.

It''s not the main that stefu or I was referring to, it''s the public static void signature, a consequence of the fact that if everything is an object then the entry point must be a method of an object, but since the object doesn''t exist as yet then the entry point must be a static method of a class (and thus can be called independently of any instance).

Single-paradigm languages always present such complexities; strictly functional languages require recursion to solve problems that are naturally iterative because of their lack of declarative constructs, strictly OO languages require entry points to be static methods (except using the DLL workaround, which isn''t a language feature per se and isn''t available in all instances)... For all it''s flaws - and they truly are legion - the one thing that C++ has going for it is its multi-paradigm support.
quote: Original post by Arild Fines
Original post by Oluseyi
(or imagine LISP.NET! *drool*)

Here''s a Scheme compiler, anyway: http://rover.cs.nwu.edu/~scheme/
Thanks! (Though I haven''t bothered to learn that particular LISP variant/dialect, nor Haskell or any other than Common LISP. Maybe it''s time to…)
Advertisement
quote: Original post by Oluseyi
It''s not the main that stefu or I was referring to,

Reread stefu''s question. It is pretty obvious what he was asking about. Notice the word "library".
quote:
(except using the DLL workaround,

Workaround?!? Now you''re really losing me here.


"The fact that a believer is happier than a skeptic is no more to the point than the fact that a drunken man is happier than a sober one." -- George Bernhard Shaw
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quote: Original post by Oluseyi
Single-paradigm languages always present such complexities;

I don''t really see the complexity. It is perfectly simple to me.
quote:
strictly OO languages require entry points to be static methods

Not true - take a look at Eiffel. In Eiffel you specify a root class - the application entry point is the constructor of that root class. The public static void [Mm]ain in Java and C# is there because that construct is recognizable to C/C++ developers.


"The fact that a believer is happier than a skeptic is no more to the point than the fact that a drunken man is happier than a sober one." -- George Bernhard Shaw
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]

This topic is closed to new replies.

Advertisement