News for hackers. Stuff that matters.
Re:Since when does Windows support forward slash as path sep... by freedomben on Tuesday January 30, 2024 @02:40AM (#39187363)
Heh, I was one of those purists! I do still prefer using `File.pathSeparator` but I fully concede that it is a useless and unneeded abstraction so my preference is likely purely religious.

All in all, I think the Java world suffers majorly from that extreme abstractions. Never in my life have I worked in a language/ecosystem with more (and often unnecessary) abstractions than in Java. Pretty good language overall, but the culture could really benefit from some good old fashioned pragmatism

Re:Since when does Windows support forward slash as path sep... by JdeBP on Tuesday January 30, 2024 @03:55AM (#39187834)
For what it's worth, .NET Core has the same capabilities of abstracting away pathname separators, if one wants it. Personally, I don't regard such things as useless and unneeded; because I see the value in not writing programs that break what has been a well-known piece of computer lore for 4 decades: namely that one can be Unix-like to a degree on non-Unix platforms such as MS-DOS, DOS+Windows, OS/2, and Windows NT.
Re:Since when does Windows support forward slash as path sep... by vips7L on Tuesday January 30, 2024 @02:46AM (#39187399)
The Path api will choose the right separator for you. Thinking about it really is a non-concern nowadays.
Re:Since when does Windows support forward slash as path sep... by LoganDark on Tuesday January 30, 2024 @03:03AM (#39187501)
Yeah, usually I don't bother with manually inserting separators and instead use Path.join or whatever else. It'll do the right thing on basically all platforms.
Re:Since when does Windows support forward slash as path sep... by 9dev on Tuesday January 30, 2024 @06:33AM (#39188864)
They still have a point, though. There are virtually no platforms that don’t support forward slashes, yet there are abstractions in place to avoid simply using slashes. This may be irrelevant, but it’s still a useless layer of complexity.
Re:Since when does Windows support forward slash as path sep... by LoganDark on Tuesday January 30, 2024 @09:38AM (#39190572)
I generally don't like to treat paths as strings just like I don't like to treat pointers as memory addresses. But hey, you don't always have to care about that stuff to make a functioning piece of software. You know, pick your battles, or however the saying goes.

(Not intended to be sarcastic, just in case it comes off that way. I only add the "useless layer of complexity" because it makes the intention more explicit for me.)

Re:Since when does Windows support forward slash as path sep... by vips7L on Tuesday January 30, 2024 @11:07AM (#39191789)
It is not a useless layer of complexity. Encapsulating paths in an object isn’t purely about slashes.