Remix.run Logo
Stylish Bugs(flak.tedunangst.com)
6 points by todsacerdoti 4 days ago | 7 comments
kookamamie a day ago | parent | next [-]

Ok, so the author thought it's a great idea to embed a little mini-game onto the page - in case two squares shot by the things in each bottom corner ever collide, your mouse cursor vanishes. Brilliant - tab closed.

PS. fix the origin of the projectile shooters - right now they are shooting from the "side" and it looks sloppy.

voidUpdate a day ago | parent | next [-]

Oh so that's why my cursor randomly vanished. I ended up just putting it in the middle right at the bottom so the little squares wouldn't get in the way of me trying to read

theamk a day ago | parent | prev [-]

I spent some time trying to disable those with uBlock but they kept hiding once I entered the picker.

And then I've realized that uBlock has an option to "disable all JS on that website" - and that worked wonderfully, and stopped vanishing cursor too.

Recommend everyone does the same.

skrebbel a day ago | parent | prev | next [-]

I feel like the JS community solved this problem by and large by standardizing on Prettier. Love it or hate it, there's nearly no discussions of the kind the article is about anymore. Have an opinion about automatic semicolon injection? You loss, prettier says semicolons so semicolons it is. Not because it's better, but because we don't want to spend any more time discussing this nonsense.

Author addresses this a little bit by saying that every language has a formatter these days, but people actually using it means all these discussions go away. For me, that's a big win even it it means that sometimes my code doesn't lay out exactly as prettily as I'd have liked.

moritzwarhier a day ago | parent [-]

I don't think this is the point of the article.

Prettier is really good. But it makes not much of a difference regarding the ASI issues the article talks about, unless you (like the article describes) look at the formatting output diff everytime, and/or have tests and lint rules preventing mistakes.

Regarding ASI, if you are accidentally writing

  return
    ((oopsItsUndefinedBut ? itsSoLongThat : accidentallyIPutItOnItsOwnLine(but, that, shouldntHappenRight ?? false)

sure, Prettier will make it

  return;
  oopsItsUndefinedBut ? itsSoLongThat : accidentallyIPutItOnItsOwnLine(but, that, shouldntHappenRight ?? false);

Both will hopefully trigger a type error or a test fail, or at least a lint error about unreachable code after return statement, unused expression etc.

But the point of the article is that stylistic concerns (the change Prettier makes) do NOT solve this problem.

You need the aforementioned static typing with return annotations, lint rules, tests, anything.

And sure, JS could make it a runtime error to have statically unreachable code, like Java does (well, it can't, don't break the web etc).

Until then, ASI is an example for the author's point.

And even if this point didn't exist at all: the post is not about formatting or lint rules.

It's about the impedance mismatch between style guides / "rules of thumb", and semantic errors in program behavior.

It's about the fact that style guide can never make hard-to-spot bugs impossible.

This point is explained with examples, of which one ASI is.

There's a reason it doesn't mention static typing I guess: not even the strongest types will guard you from yourself.

So yes, Prettier is awesome, but no, it doesn't nearly "solve" the issues that the article talks about.

It's more like a refutation to the line of thinking that style guides can make all errors obvious. For example, a bit like what Joel Spolsky represented in his ancient post "Making wrong code look wrong" (although that one is not just about code style, more about naming, sanitization, hungarian notation, yada yada)

alpha_trion a day ago | parent | prev | next [-]

My brain misinterpreted the title of this as "stylish rugs" so I was expecting something totally different.

lemper a day ago | parent | prev [-]

i actually enjoyed the bullet hell mini game.