From 2a8fca33ea8b0ac4fdbd96245fe7379e5fc35dbe Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 20 Nov 2019 16:58:34 -0500 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index adf061692e..e8870a2f23 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -41,7 +41,14 @@ In general, if you are using IntelliJ, you should be warned about platform incom #### Use `arc` collections and classes when possible. Instead of using `java.util.List`, `java.util.HashMap`, and other standard Java collections, use `Array`, `ObjectMap` and other equivalents from `io.anuke.arc.collection`. Why? Because that's what the rest of the codebase uses, and the standard collections have a lot of cruft and usability issues associated with them. -In the rare case that concurrency is required, you may use the standard Java classes for that purpose (e.g. `CopyOnWriteArrayList`). +In the rare case that concurrency is required, you may use the standard Java classes for that purpose (e.g. `CopyOnWriteArrayList`). + +What you'll usually need to change: +- `HashSet` -> `ObjectSet` +- `HashMap` -> `ObjectMap` +- `List` / `ArrayList` / `Stack` -> `Array` +- `java.util.Queue` -> `io.anuke.arc.collection.Queue` +- *Many others* #### Avoid boxed types (Integer, Boolean) @@ -59,4 +66,4 @@ If something needs to be encapsulated in the future, IntelliJ can handle it with #### Do not create methods unless necessary. -Unless a block of code is very large or used in more than 1-2 places, don't split it up into a separate method. Making unnecessary methods only creates confusion, and may slightly decrease performance. \ No newline at end of file +Unless a block of code is very large or used in more than 1-2 places, don't split it up into a separate method. Making unnecessary methods only creates confusion, and may slightly decrease performance.