サクサク読めて、アプリ限定の機能も多数!
トップへ戻る
ノーベル賞
www.codereadability.com
Magic numbers are numbers that appear in source code without any explanation of what they mean. This makes the code difficult to understand and maintain. In CSS, it's harder to tell if a value is a magic number than in other languages. This is mostly because there are more numbers that don't require additional explanation. Refactoring CSS to remove magic numbers Let's look at this example design.
(This post was originally titled "Don't use || to set default values in JavaScript". However, if you're careful to avoid the pitfalls and your whole team understands the syntax || can be convenient to use.) If you’re working with JavaScript I’m sure you’ve seen code that uses the OR operator (||) like this: function eatFruit (fruit) { fruit = fruit || "strawberry"; ... } What does this do? It sets
このページを最初にブックマークしてみませんか?
『www.codereadability.com』の新着エントリーを見る
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く