Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1811 (closed wishlist: worksforme)

Opened 14 years ago

Last modified 14 years ago

WTF is 'cwd'?

Reported by: torhu Assigned to: larsivi
Priority: major Milestone: 1.0
Component: Tango Version: trunk
Keywords: Cc:

Description

I know what the cwd command does, but many Windows programmers are not familiar with unix commands. So when they see Environment.cwd in someone's code, they'll probably go "WTF is cwd". And have to look it up. And then they go WTF again when they see how simple it was. And then go "WTF, why couldn't they call it currentDir or something. WTF!!!"

Just trying to imagine an actual real-life situation here. I hope I get my point across. ;)

There is a 'directory' alias, but it's not visible in the docs. But for consistency with the rest of Tango, the function should probably be called currentFolder. And cwd should be removed, or at least become an undocumented, deprecated alias.

Change History

12/22/09 18:21:24 changed by larsivi

  • milestone changed from 0.99.9 to 1.0.

In programming (get)cwd appears to be the most widely used function name for this, and is also part of several standards including Posix, and win32 api provides _getcwd.

So although the name may not be the most typical Tango name, it sure is shorter - and your argumentation seems to not hold water ;)

The alias should probably show up in the docs though, so I will keep it open until we have sorted that one out.

12/22/09 20:23:27 changed by torhu

Maybe I got a little carried away, but I still that cwd think isn't a good fit for Tango. :)

The win api function is GetCurrentDirectory?, and .NET uses the same name. Presumably getcwd (deprecated on win32, I think) and _getcwd are just other names for that function.

But at least there shouldn't need to be more than one name for this. Two names can only create confusion. I know which name I'd keep...

12/22/09 20:24:40 changed by torhu

By the way, Boost calls their function 'current_path'. But that returns a path object, not a string.

01/12/10 07:50:07 changed by kris

  • owner changed from kris to larsivi.

02/10/10 17:28:09 changed by larsivi

  • type changed from defect to wishlist.

Actually, I feel for closing this - the alias stuck around for compatibility reasons I think? In which case it shouldn't necessarily be documented.

03/28/10 13:30:49 changed by larsivi

  • status changed from new to closed.
  • resolution set to worksforme.