Re: Environment.Newline
- From: jeremiah johnson <naikrovek@xxxxxxxxx>
- Date: Mon, 03 Apr 2006 05:53:27 -0500
C# implementations do not always run on Windows, no. Google for "rotor", "mono", and "dotgnu" individually and you'll find examples of non-Windows implementations of the C# language, compiler, and runtime environment. as far as I know, the mono project is the furthest advanced. they have a complete 1.1 environment written, and its all open source. it compiles and runs anywhere Unix or Windows does.
Also, should it be the responsibility of the programmer to know exactly what the newline character is on any given system? personally, I don't think it should be. True, there are only two types of newline currently if you only count the latest PC operating systems, and hopefully that narrows to one in the future, but should it be the responsibility of the programmer to determine what operating system he is on and write logic that outputs the currect system newline?
jeremiah
Peter Kirk wrote:
Hi.
I would like to ask a little bit about the value Environment.Newline: what is it and what is the point of it? Ok, I can see in the docs that it represents "newline" for the current platform - I assume that it is a runtime property, and not compile time?
But won't it always be the same anyway - does dotnet run on anything other than windows platforms? So isn't newline always the same?
And what if I have a program that uses "Environment.Newline" to generate a string and send it to a program running on another platform - the other platform might have a completely different "newline" concept, and therefore to use Environment.Newline is pointless isn't it?
Thanks for any comments,
Peter
- Follow-Ups:
- Re: Environment.Newline
- From: Peter Kirk
- Re: Environment.Newline
- References:
- Environment.Newline
- From: Peter Kirk
- Environment.Newline
- Prev by Date: Re: Socket communication layer as a DLL - how?
- Next by Date: Re: Enterprise Library - Logging performances
- Previous by thread: Environment.Newline
- Next by thread: Re: Environment.Newline
- Index(es):
Relevant Pages
|