Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, for one you can probably make your own "+=" for strings, if not available, since Dart has operator overloading.

Also, System.getProperty("line.separator") does not translate to n"\n".

The first makes your program more portable. Of course it could be made accesible easier, eg as a constant System.NEWLINE or something.

[UPDATE] Downvote? Really? Because someone thinks "\n" is the same as "line.separator"?



Indeed they do not translate into the same thing. But neither makes your program more or less portable in itself. It all depends on what you want to use it for. Some files and protocols should always have \n some always \r\n while in some cases it should be the system line separator. I think Python, Perl, C, and Ruby have fixed that quite well by making the IO library do the conversions. I do not remember if it is the same in Java.


I didn't downvote, but see universal newline support in Python http://www.python.org/dev/peps/pep-0278/


Of course they could have taken perl's tact and defined "\n" to mean System.NEWLINE not 0x0A.

That would have been an improvement right there.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: