-
-
Notifications
You must be signed in to change notification settings - Fork 709
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add .byLine Windows Example: Update stdio.d #8860
Conversation
Thanks for your pull request and interest in making D better, @BoQsc! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + phobos#8860" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me what exactly the Windows specific example demonstrates. What does "^This Line is here." mean?
It demonstrates the use of
The The |
Co-authored-by: Dennis <[email protected]>
Ah, I get it now, I've been bitten by the The documentation of
I think the correct thing to do is open the file in text mode in the documentation examples, and explain that it's needed to convert "\r\n" to "\n" on Windows so there's no trailing '\r' on each line. A Windows-specific hard coded example might encourage people to needlessly write non-portable code. |
It's my second time encountering this issue, and I feel like introducing concrete example is reflective and ensuring. Overall lack of examples in the documentation really discourages programming and effective understanding. Let the people decide if they want portable code or not, instead of limiting. |
Those are good general observations, but I don't see how they apply here.
There's no lack in quantity of examples of
People can still write non-portable code if they want, but the documentation should have good examples, not examples of bad practice.
Then that code should be fixed. In this case, I don't see what's wrong with opening the file in text mode or using a portable |
If you really want a Windows only example, the code should be in a |
No description provided.