Created
April 18, 2012 06:01
-
-
Save kastaneda/2411383 to your computer and use it in GitHub Desktop.
JS and semicolon - my opinion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code is OK | |
if (navigator.geolocation) { | |
deploySelfDrivingCar() | |
notifyFlyingMonkeys() | |
} else { | |
asknicelyforlocation() | |
} | |
// Not OK | |
foo(); bar(); |
В качестве примера могу привести Python и использование ;
в нём.
# Так написать можно, но этого следует избегать
x=1;y=2;z=3;
# Лучше писать так
x = 1
y = 2
z = 3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Источник драмы: http://christianheilmann.com/2012/04/16/of-parser-fetishists-and-semi-colons/
Этот весёлый человек пытается сравнивать тёплое с мягким и утверждает, что
;
в конце строки в JS так же важно, как закрывающие теги или кавычки атрибутов в HTML. Я категорически не согласен с этим утверждением.Более того, я считаю использование
;
признаком дурного тона и плохо отформатированного кода.