Visual Studio 2003 and line-ending-agnosticism



Some parts of Visual Studio 2003 are more line-ending-agnostic than others.
Consider the following scenario. You have two text files, one of which was
written by a Mac application and has a carriage return at the end of each
line, and the other of which was written by a Windows application and has a
carriage return followed by a line feed at the end of each line. VS2003 will
happily open and edit both of these files. So far so good. Now copy some
text out of the Mac file and paste it into the Windows file. Everything
looks fine, and the editor keeps working just fine, but you have just
entered a world of pain without knowing it. The file now has some lines
which end in the Windows style and some which end in the Mac style. VS2003
will happily save and open this file as many times as you like without ever
letting on that there's anything weird about the file, which might even be
considered a feature. However, in any case, the C++ compiler is not nearly
so cosmopolitan. When it encounters this file, it loses track of what line
number it's on, which means error messages are reported for the wrong line
and the debugger gets sorely confused. You can stare at the code as long as
you like and you will never see with your eyes anything wrong. Eventually,
if you're persistent enough, you will break out a hex editor and discover
what has happened. But by then you will have lost several hours, possibly at
a time when you can ill-afford it.

--

Pete Gontier
http://www.m-audio.com/

.



Relevant Pages

  • 15 reasons Macs are still better than Windows PCs
    ... With Windows 7 coming up, it's time to yet again ponder on whether ... I long ago stopped actively seeking out Mac vs PC discussions (partly ... Apple uses good quality parts. ... problem lies from those three apps. ...
    (comp.sys.mac.advocacy)
  • Re: Apple Notebook
    ... die gerne mit Unix Befehlen arbeiten und sich freuen, ... mich stören weder UNIX-Befehle (neben Mac OS X benutze ich selbst z.B. u.A. auch HP-UX, UNIX ist für mich also kein Fremder) noch Leute, die mit ihrem Mac zufrieden sind. ... Mich stört auch nicht, dass Windows mit Ausnahme von Windows Server 2003 R2 keine UNIX-Befehle kann, genauer gesagt geht mir das ziemlich am Allerwertesten vorbei, einfach weil der Bedarf nicht vorhanden ist. ... Und das nicht nur deswegen, weil Apple schlichtweg keinen professionellen Support anbietet, sondern weil die Masse der wichtigen Anwendungen eben nicht unter Mac OS X läuft, sondern unter Windows oder allenfalls noch Linux. ...
    (de.comp.sys.notebooks)
  • Re: I really do like OS X but . . .
    ... I think he was pointing out that Microsoft has to ensure backwards compatibility with the older MS-DOS based versions of Windows, which introduces a number of problems. ... But, of course, Mac users have no choice but to upgrade... ... support perspective too. ... even going to try to claim the PPC port of gcc is anywhere near as good ...
    (comp.sys.mac.advocacy)
  • Re: 15 reasons Macs are still better than Windows PCs
    ... 15 reasons Macs are still better than Windows PCs ... With Windows 7 coming up, it's time to yet again ponder on whether ... Microsoft has the upper hand in operating systems. ... I long ago stopped actively seeking out Mac vs PC discussions (partly ...
    (comp.sys.mac.advocacy)
  • Re: Aqua is a Plastic Cube!
    ... if WPF were put into Apple's old Mac OS X ... the problem this platform has is that it's rather vaguely defined, ... better than it is on X Windows or Windows XP. ...
    (comp.sys.mac.advocacy)

Quantcast