Currently, if you type “cargo new foo”, it will create a new project template in the ./foo directory. This template, by default, is a library template. When I first saw this, it struck me as a quirky default but didn’t pay all that much mind.
Fast-forward, and we’re teaching new users over and over via the book and materials to always pass --bin when they start learning cargo. I got to wondering if we possibly should change the default. How often are people creating a binary vs creating a library? Shouldn’t the default be the common case?
I did a quick browse at the survey data also to see, and ~550 of the roughly 2000 active Rust developers are contributing to crates.io. This seems to be one data point in favor of changing the default.
Sounded like a good question for a Rust internals thread. How often do you cargo new/init a new application vs a new library? Should we change the default?