Skip to content

Commit 1739e23

Browse files
committed
translate ### 😂
1 parent c11b91e commit 1739e23

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
7. [Pengujian](#pengujian)
1111
8. [Concurrency](#concurrency)
1212
9. [Penanganan Kesalahan](#penanganan-kesalahan)
13-
10. [Format](#format)
13+
10. [Menyusun Format](#menyusun-format)
1414
11. [Komentar](#komentar)
1515
12. [Translation](#translation)
1616

@@ -563,7 +563,7 @@ function createTempFile(name) {
563563
```
564564
**[⬆ Kembali ke atas](#daftar-isi)**
565565

566-
### Avoid Side Effects (part 1)
566+
### Hindari Efek Samping (bagian 1)
567567
A function produces a side effect if it does anything other than take a value in
568568
and return another value or values. A side effect could be writing to a file,
569569
modifying some global variable, or accidentally wiring all your money to a
@@ -608,7 +608,7 @@ console.log(newName); // ['Ryan', 'McDermott'];
608608
```
609609
**[⬆ Kembali ke atas](#daftar-isi)**
610610

611-
### Avoid Side Effects (part 2)
611+
### Hindari Efek Samping (bagian 2)
612612
In JavaScript, primitives are passed by value and objects/arrays are passed by
613613
reference. In the case of objects and arrays, if your function makes a change
614614
in a shopping cart array, for example, by adding an item to purchase,
@@ -657,7 +657,7 @@ const addItemToCart = (cart, item) => {
657657

658658
**[⬆ Kembali ke atas](#daftar-isi)**
659659

660-
### Don't write to global functions
660+
### Jangan menulis fungsi global
661661
Polluting globals is a bad practice in JavaScript because you could clash with another
662662
library and the user of your API would be none-the-wiser until they get an
663663
exception in production. Let's think about an example: what if you wanted to
@@ -687,7 +687,7 @@ class SuperArray extends Array {
687687
```
688688
**[⬆ Kembali ke atas](#daftar-isi)**
689689

690-
### Favor functional programming over imperative programming
690+
### Gunakan functional programming daripada imperative programming
691691
JavaScript isn't a functional language in the way that Haskell is, but it has
692692
a functional flavor to it. Functional languages are cleaner and easier to test.
693693
Favor this style of programming when you can.
@@ -743,7 +743,7 @@ const totalOutput = programmerOutput
743743
```
744744
**[⬆ Kembali ke atas](#daftar-isi)**
745745

746-
### Encapsulate conditionals
746+
### Enkapsulasi Kondisional
747747

748748
**Buruk:**
749749
```javascript
@@ -764,7 +764,7 @@ if (shouldShowSpinner(fsmInstance, listNodeInstance)) {
764764
```
765765
**[⬆ Kembali ke atas](#daftar-isi)**
766766

767-
### Avoid negative conditionals
767+
### Hindari Kondisional Negatif
768768

769769
**Buruk:**
770770
```javascript
@@ -789,7 +789,7 @@ if (isDOMNodePresent(node)) {
789789
```
790790
**[⬆ Kembali ke atas](#daftar-isi)**
791791

792-
### Avoid conditionals
792+
### Hindari Kondisional
793793
This seems like an impossible task. Upon first hearing this, most people say,
794794
"how am I supposed to do anything without an `if` statement?" The answer is that
795795
you can use polymorphism to achieve the same task in many cases. The second
@@ -845,7 +845,7 @@ class Cessna extends Airplane {
845845
```
846846
**[⬆ Kembali ke atas](#daftar-isi)**
847847

848-
### Avoid type-checking (part 1)
848+
### Hindari type-checking (bagian 1)
849849
JavaScript is untyped, which means your functions can take any type of argument.
850850
Sometimes you are bitten by this freedom and it becomes tempting to do
851851
type-checking in your functions. There are many ways to avoid having to do this.
@@ -870,7 +870,7 @@ function travelToTexas(vehicle) {
870870
```
871871
**[⬆ Kembali ke atas](#daftar-isi)**
872872

873-
### Avoid type-checking (part 2)
873+
### Hindari type-checking (bagian 2)
874874
If you are working with basic primitive values like strings, integers, and arrays,
875875
and you can't use polymorphism but you still feel the need to type-check,
876876
you should consider using TypeScript. It is an excellent alternative to normal
@@ -901,7 +901,7 @@ function combine(val1, val2) {
901901
```
902902
**[⬆ Kembali ke atas](#daftar-isi)**
903903

904-
### Don't over-optimize
904+
### Jangan Optimasi Berlebihan
905905
Modern browsers do a lot of optimization under-the-hood at runtime. A lot of
906906
times, if you are optimizing then you are just wasting your time. [There are good
907907
resources](https://github.com/petkaantonov/bluebird/wiki/Optimization-killers)
@@ -926,7 +926,7 @@ for (let i = 0; i < list.length; i++) {
926926
```
927927
**[⬆ Kembali ke atas](#daftar-isi)**
928928

929-
### Remove dead code
929+
### Hapus kode mati
930930
Dead code is just as bad as duplicate code. There's no reason to keep it in
931931
your codebase. If it's not being called, get rid of it! It will still be safe
932932
in your version history if you still need it.
@@ -957,8 +957,8 @@ inventoryTracker('apples', req, 'www.inventory-awesome.io');
957957
```
958958
**[⬆ Kembali ke atas](#daftar-isi)**
959959

960-
## **Objects and Data Structures**
961-
### Use getters and setters
960+
## **Objek dan Struktur Data**
961+
### Gunakan getters dan setters
962962
Using getters and setters to access data on objects could be better than simply
963963
looking for a property on an object. "Why?" you might ask. Well, here's an
964964
unorganized list of reasons why:
@@ -1017,7 +1017,7 @@ account.setBalance(100);
10171017
**[⬆ Kembali ke atas](#daftar-isi)**
10181018

10191019

1020-
### Make objects have private members
1020+
### Buat objek memiliki private member
10211021
This can be accomplished through closures (for ES5 and below).
10221022

10231023
**Buruk:**
@@ -1055,8 +1055,8 @@ console.log(`Employee name: ${employee.getName()}`); // Employee name: John Doe
10551055
**[⬆ Kembali ke atas](#daftar-isi)**
10561056

10571057

1058-
## **Classes**
1059-
### Prefer ES2015/ES6 classes over ES5 plain functions
1058+
## **Class**
1059+
### Gunakan class ES2015/ES6 daripada fungsi ES5
10601060
It's very difficult to get readable class inheritance, construction, and method
10611061
definitions for classical ES5 classes. If you need inheritance (and be aware
10621062
that you might not), then prefer ES2015/ES6 classes. However, prefer small functions over
@@ -1132,7 +1132,7 @@ class Human extends Mammal {
11321132
**[⬆ Kembali ke atas](#daftar-isi)**
11331133

11341134

1135-
### Use method chaining
1135+
### Gunakan metode chaining
11361136
This pattern is very useful in JavaScript and you see it in many libraries such
11371137
as jQuery and Lodash. It allows your code to be expressive, and less verbose.
11381138
For that reason, I say, use method chaining and take a look at how clean your code
@@ -1214,7 +1214,7 @@ const car = new Car()
12141214
```
12151215
**[⬆ Kembali ke atas](#daftar-isi)**
12161216

1217-
### Prefer composition over inheritance
1217+
### Gunakan composition daripada inheritance
12181218
As stated famously in [*Design Patterns*](https://en.wikipedia.org/wiki/Design_Patterns) by the Gang of Four,
12191219
you should prefer composition over inheritance where you can. There are lots of
12201220
good reasons to use inheritance and lots of good reasons to use composition.
@@ -1281,7 +1281,7 @@ class Employee {
12811281
**[⬆ Kembali ke atas](#daftar-isi)**
12821282

12831283
## **SOLID**
1284-
### Single Responsibility Principle (SRP)
1284+
### Single Responsibility Principle (SRP) / Prinsip Tanggung Jawab Tunggal
12851285
As stated in Clean Code, "There should never be more than one reason for a class
12861286
to change". It's tempting to jam-pack a class with a lot of functionality, like
12871287
when you can only take one suitcase on your flight. The issue with this is
@@ -1338,7 +1338,7 @@ class UserSettings {
13381338
```
13391339
**[⬆ Kembali ke atas](#daftar-isi)**
13401340

1341-
### Open/Closed Principle (OCP)
1341+
### Open/Closed Principle (OCP) / Prinsip Terbuka/Tertutup
13421342
As stated by Bertrand Meyer, "software entities (classes, modules, functions,
13431343
etc.) should be open for extension, but closed for modification." What does that
13441344
mean though? This principle basically states that you should allow users to
@@ -1425,7 +1425,7 @@ class HttpRequester {
14251425
```
14261426
**[⬆ Kembali ke atas](#daftar-isi)**
14271427

1428-
### Liskov Substitution Principle (LSP)
1428+
### Liskov Substitution Principle (LSP) / Prinsip Subtitusi Liskov
14291429
This is a scary term for a very simple concept. It's formally defined as "If S
14301430
is a subtype of T, then objects of type T may be replaced with objects of type S
14311431
(i.e., objects of type S may substitute objects of type T) without altering any
@@ -1540,7 +1540,7 @@ renderLargeShapes(shapes);
15401540
```
15411541
**[⬆ Kembali ke atas](#daftar-isi)**
15421542

1543-
### Interface Segregation Principle (ISP)
1543+
### Interface Segregation Principle (ISP) / Prinsip segregasi antarmuka
15441544
JavaScript doesn't have interfaces so this principle doesn't apply as strictly
15451545
as others. However, it's important and relevant even with JavaScript's lack of
15461546
type system.
@@ -1726,7 +1726,7 @@ Test Driven Development (TDD), that is great, but the main point is to just
17261726
make sure you are reaching your coverage goals before launching any feature,
17271727
or refactoring an existing one.
17281728

1729-
### Single concept per test
1729+
### Satu konsep tiap pengujian
17301730

17311731
**Buruk:**
17321732
```javascript
@@ -1778,7 +1778,7 @@ describe('MakeMomentJSGreatAgain', () => {
17781778
**[⬆ Kembali ke atas](#daftar-isi)**
17791779

17801780
## **Concurrency**
1781-
### Use Promises, not callbacks
1781+
### Gunakan Promises, jangan callbacks
17821782
Callbacks aren't clean, and they cause excessive amounts of nesting. With ES2015/ES6,
17831783
Promises are a built-in global type. Use them!
17841784

@@ -1822,7 +1822,7 @@ get('https://en.wikipedia.org/wiki/Robert_Cecil_Martin')
18221822
```
18231823
**[⬆ Kembali ke atas](#daftar-isi)**
18241824

1825-
### Async/Await are even cleaner than Promises
1825+
### Async/Await lebih sederhana daripada Promises
18261826
Promises are a very clean alternative to callbacks, but ES2017/ES8 brings async and await
18271827
which offer an even cleaner solution. All you need is a function that is prefixed
18281828
in an `async` keyword, and then you can write your logic imperatively without
@@ -1865,13 +1865,13 @@ async function getCleanCodeArticle() {
18651865
**[⬆ Kembali ke atas](#daftar-isi)**
18661866

18671867

1868-
## **Error Handling**
1868+
## **Penanganan Kesalahan**
18691869
Thrown errors are a good thing! They mean the runtime has successfully
18701870
identified when something in your program has gone wrong and it's letting
18711871
you know by stopping function execution on the current stack, killing the
18721872
process (in Node), and notifying you in the console with a stack trace.
18731873

1874-
### Don't ignore caught errors
1874+
### Jangan abaikan kesalahan yg tertangkap
18751875
Doing nothing with a caught error doesn't give you the ability to ever fix
18761876
or react to said error. Logging the error to the console (`console.log`)
18771877
isn't much better as often times it can get lost in a sea of things printed
@@ -1903,7 +1903,7 @@ try {
19031903
}
19041904
```
19051905

1906-
### Don't ignore rejected promises
1906+
### Jangan abaikan promise yg ditolak
19071907
For the same reason you shouldn't ignore caught errors
19081908
from `try/catch`.
19091909

@@ -1938,7 +1938,7 @@ getdata()
19381938
**[⬆ Kembali ke atas](#daftar-isi)**
19391939

19401940

1941-
## **Formatting**
1941+
## **Menyusun Format**
19421942
Formatting is subjective. Like many rules herein, there is no hard and fast
19431943
rule that you must follow. The main point is DO NOT ARGUE over formatting.
19441944
There are [tons of tools](http://standardjs.com/rules.html) to automate this.
@@ -1948,7 +1948,7 @@ For things that don't fall under the purview of automatic formatting
19481948
(indentation, tabs vs. spaces, double vs. single quotes, etc.) look here
19491949
for some guidance.
19501950

1951-
### Use consistent capitalization
1951+
### Gunakan Kapitalisasi yg konsisten
19521952
JavaScript is untyped, so capitalization tells you a lot about your variables,
19531953
functions, etc. These rules are subjective, so your team can choose whatever
19541954
they want. The point is, no matter what you all choose, just be consistent.
@@ -1985,7 +1985,7 @@ class Alpaca {}
19851985
**[⬆ Kembali ke atas](#daftar-isi)**
19861986

19871987

1988-
### Function callers and callees should be close
1988+
### Fungsi yg memanggil dan yang dipanggil seharusnya berdekatan
19891989
If a function calls another, keep those functions vertically close in the source
19901990
file. Ideally, keep the caller right above the callee. We tend to read code from
19911991
top-to-bottom, like a newspaper. Because of this, make your code read that way.
@@ -2070,8 +2070,8 @@ review.perfReview();
20702070

20712071
**[⬆ Kembali ke atas](#daftar-isi)**
20722072

2073-
## **Comments**
2074-
### Only comment things that have business logic complexity.
2073+
## **Komentar**
2074+
### Komentar hanya untuk hal-hal yang memiliki kompleksitas logika.
20752075
Comments are an apology, not a requirement. Good code *mostly* documents itself.
20762076

20772077
**Buruk:**
@@ -2114,7 +2114,7 @@ function hashIt(data) {
21142114
```
21152115
**[⬆ Kembali ke atas](#daftar-isi)**
21162116

2117-
### Don't leave commented out code in your codebase
2117+
### Jangan meninggalkan kode yang dikomentari dalam basis kode anda
21182118
Version control exists for a reason. Leave old code in your history.
21192119

21202120
**Buruk:**
@@ -2131,7 +2131,7 @@ doStuff();
21312131
```
21322132
**[⬆ Kembali ke atas](#daftar-isi)**
21332133

2134-
### Don't have journal comments
2134+
### Jangan ada komentar tentang jurnal
21352135
Remember, use version control! There's no need for dead code, commented code,
21362136
and especially journal comments. Use `git log` to get history!
21372137

@@ -2156,7 +2156,7 @@ function combine(a, b) {
21562156
```
21572157
**[⬆ Kembali ke atas](#daftar-isi)**
21582158

2159-
### Avoid positional markers
2159+
### Hindari komentar marker
21602160
They usually just add noise. Let the functions and variable names along with the
21612161
proper indentation and formatting give the visual structure to your code.
21622162

0 commit comments

Comments
 (0)