Hide full rooms - bonk.io

Hides rooms that are full in bonk.io.

< Opiniones de Hide full rooms - bonk.io

Pregunta o comentario

§
Publicado: 22/11/2022

I haven't tried the script (I wouldn't want to hide full rooms), but the fact that you didn't waste time adding semicolons to the JavaScript is amazing; more people need to follow

§
Publicado: 22/11/2022

I haven't tried the script (I wouldn't want to hide full rooms), but the fact that you didn't waste time adding semicolons to the JavaScript is amazing; more people need to follow

Using semicolons is recommended by most of the javascript community. Javascript automatically inserts semicolons where it sees fit, but there exist edge cases that will break this expected behaviour. For example if you start a line with parentheses (e.g: executing a function inside a closure, or using a Number function on a raw number), javascript might interpret this as you passing parameters to some invocation on the line above.

So while 99% of the time it's just personal preference, that 1% of the time will actually produce unexpected results.

§
Publicado: 23/11/2022
Editado: 23/11/2022

So while 99% of the time it's just personal preference, that 1% of the time will actually produce unexpected results.

If you're able to stay aware of the edge cases ("^(", "^\["), what's wrong with explicitly stating semicolons there and using none by default? (Especially if the code is short enough that it's easy to test and doesn't require multiple maintainers, like here)

§
Publicado: 26/11/2022

If you're able to stay aware of the edge cases ("^(", "^\["), what's wrong with explicitly stating semicolons there and using none by default? (Especially if the code is short enough that it's easy to test and doesn't require multiple maintainers, like here)

Absolutely nothing wrong with that. Just that a lot of newer JS devs won't even know those edge cases exist. Someone needs to be the "um ackshually 🤓" when semicolons are mentioned or else those new devs reading will assume there's 0 functional difference between using or not using semicolons in JS.

§
Publicado: 26/11/2022
Absolutely nothing wrong with that. Just that a lot of newer JS devs won't even know those edge cases exist. Someone needs to be the "um ackshually 🤓" when semicolons are mentioned or else those new devs reading will assume there's 0 functional difference between using or not using semicolons in JS.

Ah, that makes sense. Yeah, when you're completely new to a topic, it's hard to pick out which things to take at face value and which are counterintuitive

§
Publicado: 26/11/2022

Honestly i just do it cuz i usually use python and i'm too lazy to add semicolons

And when it breaks occasionally i add it then

Publicar respuesta

Inicia sesión para responder.