[Cuis-dev] Replace Pharo newline char on filein

Juan Vuletich juan at jvuletich.org
Mon Jul 29 10:04:17 PDT 2019


Hi Maximo.

On 7/29/2019 1:02 PM, Máximo Prieto wrote:
> Hi, Juan. I didn't know the story but I suspected it. It never made 
> sense to me to have different standards for fileOuts.

Well, I agree, but it is broader than just fileOuts. To me it doesn't 
make sense to have different line ending conventions at all.

In the old days, OSes had various line ending conventions: 
https://en.wikipedia.org/wiki/Newline . When Smalltalk-80 was built it 
made perfect sense to choose cr as the line end. Later MacOS also chose 
it. Unix had already chosen lf. CP/M and later DOS and Windows, chose crLf.

Much later, in 2001, Mac OS X started using lf on Mac. After that 
moment, to keep using cr is asking for problems on _any_ platform. 
Another thing that happened is that Windows programs started to handle 
lf reasonably. Last year, Microsoft finally fixed Notepad: 
https://www.theregister.co.uk/2018/05/08/windows_notepad_unix_linux_macos .

As an argument against automatic line ending conversions, also consider 
that it requires the program to know whether a file (or network stream) 
is text or not, as it would break any executable or jpg, etc. It is 
better not to do it, and stick to _some_ convention. On the convention 
of using lf for code stored in GitHub, see 
https://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line . 
Also take into account that GitHub considers changing the line ending of 
a file as a diff.

I think lf is the most reasonable convention today, and I made Cuis use 
it many years ago, before Cuis had wide adoption, so it was a hindrance 
for few people.

> Quoting you: "Besides, isn't it time for Pharo to drop cr as the line 
> ending?" Stop quoting. How do we make that happens?

I'd suggest:
1) be an active member of the Pharo community
2) try to convince others
3) be ready to lead the technical effort to make it happen

Cheers,

> El lun., 29 jul. 2019 a las 12:49, Juan Vuletich via Cuis-dev 
> (<cuis-dev at lists.cuis.st <mailto:cuis-dev at lists.cuis.st>>) escribió:
>
>     On 7/26/2019 6:24 PM, Gastón Caruso via Cuis-dev wrote:
>>     Hi all! With Facu we've done a changeset to replace all the new
>>     line characters used by Pharo by the ones Cuis uses when we
>>     perform a File in.
>>
>>     Before:
>>     ...
>>     After:
>>     ...
>>
>>     Let us know what do you think!
>>     Cheers!
>
>     Hi Folks,
>
>     In general, I don't like tools modifying files without me asking.
>     In Cuis lf, cr, and crLf are shown in a clearly distinct way. If
>     the user wants to convert a file, the user can select it in the
>     File List, and do cmd-a (select all) shift-cmd-u (convert to Cuis
>     line ending) and cmd-s (save). I think it is convenient enough,
>     and there's no risk the user not knowing the file is being modified.
>
>     Besides, isn't it time for Pharo to drop cr as the line ending? 
>     The ony mainstream platform using it was MacOS something like 20
>     years ago...
>
>     -- 
>     Juan Vuletich
>     www.cuis-smalltalk.org  <http://www.cuis-smalltalk.org>
>     https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
>     https://github.com/jvuletich
>     https://www.linkedin.com/in/juan-vuletich-75611b3
>     @JuanVuletich
>
>     -- 
>     Cuis-dev mailing list
>     Cuis-dev at lists.cuis.st <mailto:Cuis-dev at lists.cuis.st>
>     https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 
Juan Vuletich
www.cuis-smalltalk.org
https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev
https://github.com/jvuletich
https://www.linkedin.com/in/juan-vuletich-75611b3
@JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20190729/d7c973ee/attachment.htm>


More information about the Cuis-dev mailing list