News for hackers. Stuff that matters.
Re:Introducing extended line endings support in Notepad by yiyus on Tuesday May 08, 2018 @02:40PM (#17023509)
I would not consider it a bug. It was working as intended. This is a new feature.
Re:Introducing extended line endings support in Notepad by rogerbinns on Tuesday May 08, 2018 @03:14PM (#17023855)
Correct. The existing Notepad is top level Window and menu bar around the existing [edit control](https://msdn.microsoft.com/en-us/library/windows/desktop/aa3...). It has always had the same limitations - eg in way earlier versions of Windows it was limited to 64kb of text.

Addressing the "bug" is not simple - the edit controls behaviour could be changed in which case it could cause existing programs to behave differently, or extra code would have to be written for notepad to do its own text editing. Microsoft takes backwards compatibility very seriously.

Anyone curious about the Microsoft side of this should find Raymond Chen's Old New Thing blog interesting (about 5 posts a week). For example here is content tagged history: https://blogs.msdn.microsoft.com/oldnewthing/tag/history and here is how there are actually two copies of Notepad on each system: https://blogs.msdn.microsoft.com/oldnewthing/20090312-00/?p=...

Re:Introducing extended line endings support in Notepad by simonh on Tuesday May 08, 2018 @04:41PM (#17024832)
>…the edit controls behaviour could be changed in which case it could cause existing programs to behave differently…

You just add a new mode to the control that enables the new behaviour. Existing programs using it would work fine.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @04:55PM (#17024985)
Adding new features to an existing Windows control, particularly one that has existed since the dawn of time, is a much bigger deal than adding to a simple utility. The last time that happened they added a whole new control, the Rich Edit.
Re:Introducing extended line endings support in Notepad by simonh on Wednesday May 09, 2018 @12:56AM (#17027488)
Oh come on, framework libraries add new features to controls in a backwards compatible way all the time.
Re:Introducing extended line endings support in Notepad by nintendo1889 on Tuesday May 08, 2018 @07:11PM (#17026175)
There's a quick fix on all existing systems, just open in wordpad.
Re:Introducing extended line endings support in Notepad by rootlocus on Tuesday May 08, 2018 @02:49PM (#17023604)
The article disagrees:

> Today, we’re excited to announce that we have fixed this issue!

Re:Introducing extended line endings support in Notepad by cstrahan on Tuesday May 08, 2018 @02:59PM (#17023700)
Users can take issue with intended behavior, as in this case. This resolves that issue, despite the old behavior working as (previously) intended. “An issue (as perceived by a user)” is not equivalent to a bug.
Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @03:57PM (#17024315)
> “An issue (as perceived by a user)” is not equivalent to a bug.

You've managed to encapsulate about 35 years of frustration with software in a single sentence.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @04:56PM (#17024999)
People don't seem to understand that a bug in the spec is just as bad (or worse) than a bug in the code.
Re:Introducing extended line endings support in Notepad by rootlocus on Tuesday May 08, 2018 @03:17PM (#17023878)
> As you can see, Notepad is incorrectly displaying the file’s contents, making the file look garbled.

So the intended behavior was to incorrectly display the file contents?

Also, I don't know why you quoted "An issue (as perceived by a user)", since I can't find that in the article anywhere.

Re:Introducing extended line endings support in Notepad by cstrahan on Friday May 11, 2018 @12:43PM (#17048794)
>> As you can see, Notepad is incorrectly displaying the file’s contents, making the file look garbled.

> So the intended behavior was to incorrectly display the file contents?

I would argue that you're getting hung up on the author's lack of precision. Does the file look garbled in that screenshot? Sure, I think that's a reasonable interpretation of things. Is it incorrect? That depends on what Notepad was intended to be used for. I suspect Notepad was intended from day one to be a simple means of read and editing "plain text" files written on Windows, and under that premise Notepad has always functioned perfectly.

To the author's credit, belaboring the distinction between incorrect behavior (a property of the object with respect to the intentions of its creator) and undesired behavior (an attribution given by a user with respect to their needs) would make for boring reading.

> Also, I don't know why you quoted "An issue (as perceived by a user)", since I can't find that in the article anywhere.

https://en.wikipedia.org/wiki/Scare_quotes

Re:Introducing extended line endings support in Notepad by Retra on Wednesday May 09, 2018 @12:20AM (#17027385)
Quotes are not solely used for citation. They are also used for emphasis or indirection. You can also use quotes to set off something that someone explicitly did not say as a way of indicating a paraphrasing.
Re:Introducing extended line endings support in Notepad by jl6 on Tuesday May 08, 2018 @03:26PM (#17023971)
I think “bug” used to be slang shorthand for the more professional term “defect”, and under that definition the Notepad change would accurately be described as a new feature.

But the word bug has been coopted by the masses to have the wider meaning of “doesn’t meet user expectations”.

Re:Introducing extended line endings support in Notepad by squiggleblaz on Wednesday May 09, 2018 @02:44AM (#17027840)
"Defect" always seems like a johnny-come-lately polishing of the word "bug", rather than vice versa. I would be surprised if "defect" is truly the original term for a software bug, and "bug" was chosen as shorthand.

In any case, bugs need not be only in software. As as earlier comment says, bugs can be in specs, too. Here, the spec was buggy and that has been resolved.

Or to put it another way, the defect was in the spec, and that has been resolved.

(Note that many specs are implicit and best derived from the software in question. If that is the case for Notepad, then fixing the bug in the spec requires one to fix the code. I somewhat doubt Microsoft follows that practice, but it's certainly not beyond the realm of the possible.)

Re:Introducing extended line endings support in Notepad by Stratoscope on Tuesday May 08, 2018 @02:41PM (#17023519)
When "working as intended" means "doesn't work at all", I consider it a bug.

Take a look at the first screenshot on the announcement page and then tell me it's working as intended.

Re:Introducing extended line endings support in Notepad by Latty on Tuesday May 08, 2018 @02:49PM (#17023608)
Is it a bug that opening an excel spreadsheet in notepad gives something unreadable? Linux line endings are a type of file that notepad was never designed for.
Re:Introducing extended line endings support in Notepad by Stratoscope on Tuesday May 08, 2018 @03:38PM (#17024112)
I suppose it depends on whether I'm wearing my "user hat" or my "Notepad developer hat".

As a Notepad developer, I might agree with you that Unix line ending support is a new feature.

As a user, I double-click a text file and it opens in Notepad. It opens fine in all of my other editors, but is garbled in Notepad. That feels like a bug.

I don't try to open .xlsx files in Notepad, so it isn't very relevant to me as a user that Notepad won't open them. If I did open one accidentally, I'd think "D'oh! That's not a text file!"

But this is just terminology. Files that Notepad couldn't open usefully before will now work. That's a good thing, whatever we call it.

Re:Introducing extended line endings support in Notepad by swebs on Tuesday May 08, 2018 @03:10PM (#17023814)
To be more precise, they're Unix line endings. So yeah, I'd consider it a bug if it didn't support what has been the standard line ending format since the 60's.
Re:Introducing extended line endings support in Notepad by ThrowawayR2 on Tuesday May 08, 2018 @03:29PM (#17024004)
> So yeah, I'd consider it a bug if it didn't support what has been the standard line ending format since the 60's.

The standard line ending format in the '60s, which was the height of the mainframe era, would probably have been the newline character in IBM's EBCIDC encoding, which differs from the value used for ASCII (https://en.wikipedia.org/wiki/Newline). Unix didn't really start taking off until around the early '80s IIRC.

Windows properly supported the newline format for its platform of lineage (CP/M + DOS) which also didn't start taking off until the early '80s. Not sure that Unix has any real claim to precedence here.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @05:00PM (#17025045)
The standard line ending of the '70s was CR/LF, because the printers commonly used as interactive terminals required them both. I wonder how that worked on the first Unix systems?
Re:Introducing extended line endings support in Notepad by cesarb on Tuesday May 08, 2018 @09:31PM (#17026806)
> I wonder how that worked on the first Unix systems?

Probably the same way it still works on today's Unix systems: it converts NL to CR+NL on output. See the manpage for the stty command:

  Output settings:
    [-]onlcr
      translate newline to carriage return-newline
Re:Introducing extended line endings support in Notepad by JdeBP on Tuesday May 08, 2018 @05:11PM (#17025145)
The standard in the 1960s, USAS X3.4-1968, actually prescribed both forms.

But (in §4.1.2.2) it "strongly recommended" that people "use CR and LF to obtain the effect of New Line".

Re:Introducing extended line endings support in Notepad by joshuaeckroth on Tuesday May 08, 2018 @02:41PM (#17023522)
I'd entertain an explanation of how the original behavior was a feature :)
Re:Introducing extended line endings support in Notepad by ams6110 on Tuesday May 08, 2018 @03:06PM (#17023769)
The crlf line ending has been the standard on the PC going back to the days of DOS. That's what notepad was supporting when it was developed. Unix was strictly a server or esoteric workstation OS at the time. So there was never a requirement for Notepad interoperability with Unix files on Windows.
Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @03:59PM (#17024341)
A double byte end-of-line sequence was a bug to begin with. Just like ending files on ctrl-Z (yes, it is End-Of-File, but filesystems know where the end of the file is already).

These are just holdovers from teletype days and with Notepad being solidly GUI based it could have simply had a backwards compatibility mode for 'DOS' style files.

Incidentally, CR-LF and LF-CR are interchangeable on a teletype, but various windows software would respond totally unpredictable to that alternative, including some spectacular crashes.

Re:Introducing extended line endings support in Notepad by 0x0 on Tuesday May 08, 2018 @06:48PM (#17026019)
> Just like ending files on ctrl-Z (yes, it is End-Of-File, but filesystems know where the end of the file is already)

Very old filesystems didn't track file sizes in bytes, just blocks, so a literal EOF byte was needed to know where to stop reading in the middle of the last block of 128 bytes or so.

Re:Introducing extended line endings support in Notepad by zaarn on Wednesday May 09, 2018 @03:28AM (#17028005)
Actually, I had to work with a line printer that didn't handle CR-LF but LF-CR. The printer was designed to have people rip of paper cleanly and the easiest way to do that is to have a button that locks the printer head on the left side, which causes it to engage a gearing on the line feeder which prevents it from moving. That allows a human to press the button and rip of the paper. The process was fairly fast and without it the linefeed would slip and you would rip out half of the paper from under the printer head. Unfortunately this also means if you issue a CR-LF you will first hear the printer head moving and then a jamming noise from the line feed followed by the printer blowing a fuse.

So any device that uses it usually requires a special adapter that converts CR-LF to LF-CR otherwise the printer could be damaged and buffers input while the printhead lock the linefeed.

The device was to my knowledge not very popular, incredibly old and irreplaceable as part of a legacy application written for an old 8bit computer system.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @05:04PM (#17025084)
Are they really interchangeable? Moving the print head from the right side to the left could easily take two character times, and a teletype didn't have any buffering.
Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @05:05PM (#17025104)
The combined time is equal, why would it matter what the order is?

http://hans.presto.tripod.com/scan/teletype/28_02.html

"Dependable carriage returns with only one carriage return and one linefeed signal" at 100 wpm.

Now I'm curious :)

I don't have a teletype handy though, I'm sure other HN'ers do.

Re:Introducing extended line endings support in Notepad by Stratoscope on Tuesday May 08, 2018 @05:19PM (#17025244)
It doesn't matter that the combined time was equal. What mattered was that both operations completed before the next character was printed. The carriage return and the line feed could happen in parallel, but I'm pretty sure that carriage return could take longer than line feed, at least in the worst case when the carriage was near the end of the line. So if you did the line feed first, the next character could print while the carriage was still returning.

We always played it safe anyway, by punching CR LF RUBOUT at the end of each line on a paper tape. The RUBOUT added a bit more delay before the next character was printed, so you could feel sure that it would print at the correct position.

Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @05:25PM (#17025301)
I see what you're getting at. That the next character would start to be printed before the carriage return had completed with the sending side not respecting the fact that it had just sent a carriage return by waiting for a bit.

From what I remember most TTY drivers would automatically insert an appropriate delay after a CR because the LF is optional, you can happily overprint a line if you want.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @05:49PM (#17025524)
I remember a system that overprinted about 5 characters to black out a password after you entered it. Good times.

The NUL character was useful for inserting a delay into the serial stream.

Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @05:54PM (#17025567)
Hehe, security by obscure it y.

And in sync links (not TTY's those were mostly async with start and stop bits, more like HDLC style stuff) those nuls were mandatory, you had to send something.

Re:Introducing extended line endings support in Notepad by mark-r on Tuesday May 08, 2018 @05:22PM (#17025264)
The head wouldn't start moving until it got the CR, and if the LF comes after it would have 2/10 of a second to traverse the page. If the LF comes first it would only have 1/10 of a second.
Re:Introducing extended line endings support in Notepad by JdeBP on Tuesday May 08, 2018 @05:22PM (#17025270)
Actually, no it isn't End-Of-File.

* http://jdebp.eu./FGA/dos-character-26-is-not-special.html

And SUB was ASCII's equivalent of U+FFFD.

Re:Introducing extended line endings support in Notepad by jacquesm on Tuesday May 08, 2018 @05:29PM (#17025339)
Nice link, but even COMMAND.COM would see CTRL-Z as special, so I'm not sure why the author saw fit to make that claim, it's fairly well documented that plenty of DOS utilities did that and together with the core they make up the OS.
Re:Introducing extended line endings support in Notepad by coldtea on Tuesday May 08, 2018 @03:59PM (#17024336)
>Unix was strictly a server or esoteric workstation OS at the time.

And of course Mac OS wasn't Unix then, and used a different (third) line ending style.