https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39059

--- Comment #7 from Michał <[email protected]> ---
(In reply to Martin Renvoize (ashimema) from comment #5)
> Coming from perl, it's second nature to me to add semi-colons and I also
> agree I find it clearer to read... but I do realise I'm probably a little
> old fashioned on that front.

I'm the youngest here and I still agree lol.

For posterity, I also want to point out these two examples of perfectly valid
code that'd be screwn over without semicolons from the AirBnB examples:

```js
// bad - raises exception
const luke = {}
const leia = {}
[luke, leia].forEach((jedi) => jedi.father = 'vader')

// bad - raises exception
const reaction = "No! That’s impossible!"
(async function meanwhileOnTheFalcon() {
  // handle `leia`, `lando`, `chewie`, `r2`, `c3p0`
  // ...
}())
```

These are real-life examples of code snippets that'd result in very confusing
exceptions (especially if stuff worked while testing, and then a pre-commit
hook got rid of the semicolons):

```
Uncaught ReferenceError: can't access lexical declaration 'leia' before
initialization
```

```
Uncaught TypeError: "No! That\u2019s impossible!" is not a function
```

Would you glance at these errors, the code, and immediately figure out the lack
of semicolons is the cause?

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to