Closed greentore closed 9 months ago
This is copied from the terminology and functionality that's already familiar in the JavaScript ecosystem: https://nodejs.org/api/path.html#pathbasenamepath-suffix which is copied from unix https://en.m.wikipedia.org/wiki/Basename
I'm also not a fan of the terminology, but it's very common. Personally I would have preferred to call it .filename()
(where file names refer to only the last component and file paths are with multiple components), but that would have diverged from this already common naming and I'm not sure that would be good to do.
I opened an issue for the bug you mentioned https://github.com/dsherret/dax/issues/186
I find it confusing that a method named
basename
returns filenames with extensions. It also doesn't help that there's no ergonomic way to get the bare filename (withExtname("")
contains a trailing dot). In my opinion Python's pathlib'sstem
andname
terminology for bare and full filenames respectively is more intuitive.