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

In terms of file path, windows seems to always support \\ or /, both in API or in software like Explorer. That's still true for Windows 10.

That leads to some interesting answers on stackoverflow sometimes about cross compatibility, where the correct answer of "use whatever constant your language has for directory separator" gets down-voted in favor of "use forward slash everywhere".



Because it isn't the correct answer.

Many applications assume \ and deal with paths directly, instead of using the Windows APIs for path manipulation.

This means the moment your application gives a / to another application, there is a high probability that it will break, regardless of what the Windows API supports.

Even cmd doesn't handle / properly.


I know, you will notice I said above "the correct answer [...] gets down-voted", I was not suggesting using forward slash was the way to go.

You can take it as a side criticism of how things are turning sour on stackoverflow with "popular" being more valuable that "right", I guess.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: