vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.5k stars 2.15k forks source link

rename os.getwd -> os.getcwd #21492

Open hholst80 opened 1 month ago

hholst80 commented 1 month ago

Describe the feature

"getwd" is a deprecated C name and "getcwd" will feel much more familiar to users of the standard library.

image

Use Case

To support Python and C developers coming to V lang the standard library should follow common conventions.

Proposed Solution

No response

Other Information

No response

Acknowledgements

Version used

0.4.5

Environment details (OS name and version, etc.)

V full version: V 0.4.5 a1f3624.2e64e28
OS: linux, "Artix Linux"
Processor: 4 cpus, 64bit, little endian, Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz

getwd: /home/root
vexe: /home/root/Apps/v/v
vexe mtime: 2024-05-05 20:51:43

vroot: OK, value: /home/root/Apps/v
VMODULES: OK, value: /home/root/.vmodules
VTMP: OK, value: /tmp/v_0

Git version: git version 2.45.0
Git vroot status: weekly.2024.18.2-13-gc14c803a (67 commit(s) behind V master)
.git/config present: true

CC version: cc (GCC) 13.2.1 20240417
thirdparty/tcc status: thirdparty-linux-amd64 40e5cbb5

[!NOTE] You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote. Other reactions and those to comments will not be taken into account.

JalonSolov commented 1 month ago

It you're going to rename it, it should be renamed to a V name, not a C name.

get_current_dir would be more V style.

hholst80 commented 3 weeks ago

having a 'style' that is idiomatic to V is ofc most important.

just as a side note, as these things does not come for free: naming things is the hardest problem in computer science and I see any kind of preexisting naming convention as a gift from God. ;-)

image