add section for naming conventions
ref: https://github.com/denoland/deno_std/pull/2359
add section for naming conventions
I agree this is mostly our current rule. But there seem some exceptions. We recently introduced JSONParseStream and JSONStringifyStream in std which don't follow this rule. The decision was made so because most people were in favor of that casing.
Should uppercase be used if a class name starts with an acronym or is this an anomaly?
What should the course of action be? Shall I also open a PR for the renames? @kt3k @nayeemrmn
candidates:
- https://github.com/denoland/deno_std/blob/d7cd0080b8aa8a2df315edb220f919f4b88c4086/textproto/mod.ts#L65
- https://github.com/denoland/deno_std/blob/6d33b18a8c89f7caf0a8e7588f9ea31efe5a45fc/encoding/json/_stringify.ts#L34
What should the course of action be? Shall I also open a PR for the renames? @kt3k @nayeemrmn
I agree. We should be consistent and use the "capitalize only the first letter" rule. For example:
- watchFs
- serveHttp
- listenTls
Current APIs that violate that rule should be renamed: JSONSomething => JsonSomething.
Open question is whether we should also rename isatty to isaTty or isATty :)
@piscisaureus Thanks for your opinion.
Ok. Let's land this and fix readMIMEHeader and JSON* APIs in std.