Update Code_Conventions.mdx

This commit is contained in:
nchn27 2020-07-19 01:00:54 -04:00 committed by GitHub
parent 0845590c01
commit 36d5e785f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
id: code-con
title: Code Conventions
author: Nathan Wang, Benjamin Qi, Michael Cao
description: "?"
description: "The conventions that this guide uses"
prerequisites:
- expected
- modules
@ -10,7 +10,20 @@ prerequisites:
The code we provide should follow the conventions below. Please note that you do _not_ have to copy our conventions; there is no "right" convention for coding!
Everything should compile assuming that the templates below are included. If any code does not compile or is hard to read, submit a complaint using the "Contact Us" button.
If any code does not compile or is hard to read, submit a complaint using the "Contact Us" button.
<LanguageSection>
<CPPSection>
If you find unrecognizable symbols or functions in `C++` code, note the template below! Everything should compile assuming that the template below is included.
</CPPSection>
<JavaSection \>
<PySection \>
<LanguageSection>
## General
@ -72,14 +85,14 @@ else
- Use `true / false` for boolean values, not `1 / 0`.
- Explain the use of any not well known standard library functions with comments that haven't been introduced before like `__builtin_ffs()` or `tie(a, b, c)` in C++.
## Template
The template is assumed to be in every code file. The word "template" usually refers to a C++ template as C++ templates can generally take advantange of more powerful features and be more customized by each competitor. Don't be afraid to write your own template! (Though the USACO Guide will assume the use of the following template)
<LanguageSection>
## Template
<CPPSection>
The "template" refers to code that is assumed to be in every file. The word "template" usually refers to a C++ template as C++ templates can generally take advantange of more powerful features and be more customized by each competitor. Don't be afraid to write your own template! The USACO Guide will assume the use of the following template in any C++ Code:
See [C++ Tips & Tricks](./cpp-tips).
```cpp