What about cargo.toml
(lowercase C) and cargolock.toml
? Or lockcargo.toml
? cargol.toml
?
I donāt see a compelling reason to change the name of this file. The package manager is Cargo. And so Cargo.toml
makes it clear that it has to do with the package manager. I wonāt be arguing about this too much because in the end, itās just a file, but I donāt get what changing the name of this file will bring us, apart from having to rename it in all existing Cargo projects.
I think that changing the name of the file just so it feels familiar is not a good reason. If Rust had tried to feel familiar, it wouldnāt be Rust.
Finally, Iāve always found the idea of having file
inside the name of a file questionable.
EDIT: Since writing this, the posts below have convinced me that cargo.toml
might make things easier to type. And so I support this suggestion.
Using your same argument (which I do not agree with) you call cargo
on the command line, so the file should be called cargo.toml
.
Cargo is a proper noun, it should be capitalized, Python has Pip (setup.py), Java has Maven (pom.xml), Gradle (gradlew.bat), Ant (build.xml), etc. but as you see, they are all lowercase files.
Rust does not, i repeat not, try to be different. The whole point of Rust is that it does nothing new, but stands on the shoulders of giants, so to speak. Lifetimes are from Cyclone, much of the syntax is from ML- or C-like languages. Rust is familiar.
So you are saying we should be different for the sake of being different? All of the configuration files that I have seen with an extension start lowercase. The argument that brought up was to group it with configuration files. This is from the *file precedent, and does not belong with the style we are using.
From your post, Iām assuming youāre replying to me.
About the filename: IMO, cargo.toml
and Cargo.toml
is pretty much the same. Calling it the one or the other doesnāt make much difference apart from where the file appears when you list files (since C < c
). When I talked about Cargo and Cargo.toml
, I just meant that having Cargo and Cargofile
, or Cargo and setup.cargo
was not clearer than Cargo and Cargo.toml
. Maybe I should have been more clear on that particular point.
About Rust being different: I did not say that Rust tries to be different. I said it did not try to feel familiar. Otherwise, we would probably have parenthesis around if
statements, since the 4 most used languages (according to http://langpop.com: C, Java, PHP, Javascript and C++) have that. This is the first time I hear about Cyclone and from a quick Google search, it seems difficult to say that Cyclone is familiar. All Iām saying is that Rust is not trying to be the same.
I disagree, having to hit shift for no reason for the test of time heavily outweighs any negatives from updating the current packages in the wild. It is non-trivial mental overhead for me when working in a terminal, because usually all the other files are all lower-case.
Iāve never had terminal issues due to case, because my bash will autocomplete with tab regardless of case.
Same as @steveklabnik for me.
Although Iām wondering about something: is case insensitive matching easy on Windows too? What is the reason to not have case insensitive auto completion? This is a real question, not a rhetorical one. Iām wondering. I have never come accross a project with two files named the same with different casing, hence my question.
For the record, if youāre on Linux and want case insensitive matching for Bash, this should do it (this may work for other shells and UNIX like OSs, but I havenāt tried that):
echo "set completion-ignore-case on" >> /etc/inputrc
This does not solve the fact that when I type car<TAB>
, I do not get the full autocomplete because there is a choice between Cargo.toml
and Cargo.lock
to make. Is there a need to edit Cargo.lock
manually? If not, maybe that could be changed to something like .Cargo.lock
. This way, autocomplete is more useful and the file would just be recreated on the next cargo build
.
(The Linux kernel is such a project, causing woe to OS X users who try to compile it inside the default case-insensitive filesystem.)
Inside Windows cmd.exe you can always case-insensitive match. For example if I have ābanana.txtā, āBanana.jsonā, and āBANANA.CSVā in a directory, and I type āgvim ban[TAB]ā I get one of those, ā[TAB]ā again I get the second, ā[TAB]ā again the third, and cycling back again for further tabs.
(This is one way, perhaps the only way, in which I prefer cmd.exe over Bashās default behavior.)
+1 to cargo.toml
. I prefer lowercase file name, as most of others.
I really donāt understand ANY of the motivation for keeping the upper case convention. Itās simply forward looking to fix it now and just make it lowercase before MORE projects are created.
Can anyone provide a reason to prefer the capital āCā over lowercase ācā besides needing to rename the file in projects that exist today?
The rationale by the Cargo maintainer was linked in the first post:
Thanks for linking me this. Atleast I understand the rationale now
If you wanted to have lowercase file names, and canāt have it starting with a ā.ā, could you use an underscore? ā/_cargo.tomlā and ā_cargo.lockā.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.